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,8c87bf30faa2b6b X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: [Q] To initialise or not. Date: 1996/04/28 Message-ID: #1/1 X-Deja-AN: 151925874 references: <484274071wnr@diphi.demon.co.uk> <318109B1.3B54AFBF@escmail.orl.mmc.com> <75602294@dorunth.hb.north.de> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-04-28T00:00:00+00:00 List-Id: Thorsten says " declare X : INTEGER := 12; -- 'X' is initialized to 12 here because ... -- It will be changed to '13' under the following circumstances ... -- in the code piece following. begin if not ... then X := 13;" recommending that all variables be initialized. I am not sure I like this. Now you replae the possible error of not initializing a variable with using a junk value (here using a 12 when a 12 is not intended). Furthermore, messing around with conditions and putting not's in front of them seems to me to be undesirable. I am not saying that this is never a good idea, but personally I prefer not to initialize variables unless it makes obvious good sense to do so. By the way, I see this as totally unrelated to the issue of choosing good names for variables and properly docuenting declarations. Interesting that some programmer would be scornful of this (using the word secretary, presumably NOT not in a complimentary sense). Sounds like that is a programmer who I would NOT want working on my projects. All programmers should be secretaries :-)