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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c1131ea1fcd630a X-Google-Attributes: gid103376,public From: Ken Garlington Subject: Re: To Initialise or not Date: 1996/04/29 Message-ID: <3184E9CE.5C7A@lmtas.lmco.com>#1/1 X-Deja-AN: 152114502 references: <318508FE.204B@sanders.lockheed.com> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Tactical Aircraft Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01 (Macintosh; I; 68K) Date: 1996-04-29T00:00:00+00:00 List-Id: Steve O'Neill wrote: > > > As an aside, I always write ":= null;" when I want to *rely* on the > > initial value of a pointer, even though I know that pointers are always > > default-initialized to null. > > You're not the only one. :) I think I'm the only person in the world that _doesn't_ like this coding style. I don't like it because I can't find a use for it. Generally, I only want to enter information if there's some use for it, either to make the program work, or to make it more readable, etc. Otherwise, I'm just adding another source for error (suppose, for example, there's an object called mull, nell, etc. of a compatible type and scope, and I make a typo?) Some people say that initializing to null adds a hint to the reader that it's an access. That seems (a) kind of redundant, since I should always use the type of the object for such information, and (b) kind of dangerous, since initial values for access types aren't always "null". If I use the keyword to look for access values, I'll miss some.