From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56131a5c3acc678e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-09 10:48:18 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news-out1.nntp.be!propagator2-sterling!news-in.nuthinbutnews.com!cyclone1.gnilink.net!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.rapidnet.com!news.rapidnet.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 09 Dec 2003 12:48:16 -0600 Date: Tue, 09 Dec 2003 12:42:53 -0600 From: Chad Bremmon Reply-To: bremmon@acm.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Question about OO programming in Ada References: <5JmdnUF_9o_ABE-iRTvUrg@rapidnet.com> <1070926760.852068@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.13.119.67 X-Trace: sv3-NFyO9SinNQK4/PmOU1E5k48vbEtTNed7Sl4m5z93z3UnjQFD3qgvaw9TiVLBp6//vQV8ZzT97yhE5AL!7E4VSEo1H1QTaJd9DdNkdYGBnRhBDJrNQmC28VNJMGLf4rEz6jtwR05/5AH89jVwDB9dE/f4XU8I X-Complaints-To: abuse@rapidnet.com X-DMCA-Complaints-To: abuse@rapidnet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:3289 Date: 2003-12-09T12:42:53-06:00 List-Id: After looking back, I agree with Hyman's criticism of my code. I should have been setting the variable. It was actually very difficult to keep in the code what was meaningful and delete what wasn't when I was deciding what to stick in the article. If you go back to the purpose of my article, it was to refute testimony that OO programming would NOT work for embedded systems programming at all. The other guys point was: "With using C++, I got all of this overhead." I explained two reasons for his overhead! 1. The idea of encapsulating a register and calling it a register when you get done is pretty stupid. I went on to explain that if you wanted to encapsulate a register that represented a light, then write a light class. 2. C++ has a lot of problems with redispatching, etc. If you still wanted to access a register and encapsulate it, you can't do it without using a Class in C++. We are discussing the "default" behavior of C++ here. You can do a pretty good job of tying down, but open and dispatching is the way C++ works out of the box. In actuality, if you wanted to encapsulate a meaningless register, you would want to use a variable and set the address for it's location specifically. Thanks, Chad Georg Bauhaus wrote: > Chad Bremmon wrote: > : The state of the boolean is not kept in a variable. The code I wrote > : actually changes the register to turn the light on and off. A boolean > : is not necessary to keep track of the light. Either the damn light is > : on or off. > > Though, if you are the maintainer of a program and see a record > with a boolean component that is never used, how do you, as a > maintainer of readable code, decide what the boolean is about? > All the more when the Boolean, by its name, is obviously related > to subprograms with similar names and "matching" parameter profile? > And then you learn that the author says, the Boolean is unnecessary? > (And this has nothing whatsoever to do with C++ or Ada, does it?) > > I would have enjoyed the article more if it had stuck to > the interesting and clear explanation of why O-O is useful, > and how it is done in Ada. > I could imagine that due to its C++ bashing readers are > less likely to see advantages of Ada that you have depicted. > > -- Georg