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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a2d45f282a1da1c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-05 10:31:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news.uunet.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Warren W. Gay VE3WWG" 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: float with 24-bit resolution References: <3F3CCB0F.543478AF@adrianhoe.nospam.com.my> <3f405ef4$1_1@news.tm.net.my> <3f54bf19_1@news.tm.net.my> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <_x36b.22730$su.613585@news20.bellglobal.com> Date: Fri, 05 Sep 2003 13:16:57 -0400 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1062782202 198.96.223.163 (Fri, 05 Sep 2003 13:16:42 EDT) NNTP-Posting-Date: Fri, 05 Sep 2003 13:16:42 EDT Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:42184 Date: 2003-09-05T13:16:57-04:00 List-Id: Randy Brukardt wrote: >>Matthew Heaney writes: >> >>> Null_Object : T := null; >> >>>I find the latter convention confusing, because it suggests that if >>>the initialization part were omitted, then the object wouldn't be >>>initialized. But that would be incorrect. > > *I* find > Null_Object : T; > confusing. A maintenance programmer probably doesn't know the class of > object that T represents, and the lack of an initialization looks like a > bug. IMHO, if this is in fact a tagged "object", and it lacks the necessary "Initialize" primitive, then you deserve what you get. ;-) Granted, there can always be exceptions to any rule. 8-) Even for just record types, you can have implicit initialization already specified for the members of that record anyway. So you don't always want to undo that with an explicit initialization. So IMHO, saying that any object is better with explicit initialization is saying that implicit initialization is a part of the language which shouldn't be used. Maybe, I am over reacting 8-) > You could "fix" that with a comment, but an explicit initializer works > just as well. But this also increases the maintenance cost if you change the nature or number of members of that object. It also creates a maintenance nightmare if the initialization defaults are changed (in the spec) but the explicit initialization undoes what is "correct" for it initially (ie. the worst case is when it compiles, but fails to work correctly because the incorrect initialization value remains, even though the spec has been corrected). > But I suspect being consistent is more important than any particular rule. > > Randy. But I guess this is what makes I.T. so interesting -- a different set of strokes for many of us ;-) -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg