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: Patrick Richard Wibbeler Subject: Re: To Initialise or not Date: 1996/05/01 Message-ID: #1/1 X-Deja-AN: 152391980 references: <318508FE.204B@sanders.lockheed.com> <3184E9CE.5C7A@lmtas.lmco.com> content-type: TEXT/PLAIN; charset=US-ASCII organization: Cal Poly, San Luis Obispo mime-version: 1.0 newsgroups: comp.lang.ada nntp-posting-user: pwibbele@trumpet.aix.calpoly.edu Date: 1996-05-01T00:00:00+00:00 List-Id: One other point about the following exchange... > >> > 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. What if either of the following occur... 1] For some reason the language is changed so that pointers are no longer initialized to null as when C started using a negative number rather than zero as the end of file. Those who had while(flag != EOF) rather than while(flag != 0) still had code that worked! 2] Someone attempts to re-write the code in another language that doesn't initialize pointers to null. He/she may not know whether or not to initialize the pointer to null without looking closely at the code.. Readability is not just for now. It is for later. The main point is who knows who or why the code will be used in the future. At such a small cost, the readability/maintainability in the future could be large. Patrick