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,7dd9b82cd363f55b X-Google-Attributes: gid103376,public From: Ken Garlington Subject: Re: Coding Standards Date: 1996/05/17 Message-ID: <319C52B2.36F6@lmtas.lmco.com>#1/1 X-Deja-AN: 155351937 references: <9605151401.AA04364@most> <319B286E.3B2E@lmtas.lmco.com> <4nh3n7$55g@goanna.cs.rmit.EDU.AU> 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-05-17T00:00:00+00:00 List-Id: Richard A. O'Keefe wrote: > > - ALL variables must be initialised before they are used, > WHETHER THE LANGUAGE WILL INITIALISE THEM OR NOT. > > This means I don't _care_ what Ada initialises pointers to, > and I don't care what C initialises top-level variables to > either. ... > I understand why Ada initialises pointers to null, and I wouldn't want > that changed, but if I want to check that a variable is properly > initialised, I want to _see_ an initialisation. Is this because you don't trust the compiler to obey the language rules in this area, or some other reason? Furthermore, what about cases like: (1) type Some_Thingy_Type is record Some_Component : Integer := 0; end record; Foo : Some_Thingy_Type; -- or should I explicitly initialize it? (2) type Name_Type is String(1 .. 10); Blank_Name : constant Name_Type := (others => ' '); -- is "others" too implicit? > For teaching purposes, at any rate, I am > *for* any tool that will help to detect uninitialised variable use > *against* any "solution" to the problem that requires programmer > intervention; if the students were savvy enough to use such a > solution, they wouldn't need it so much. This is certainly useful; do you see your coding standard as a "tool" in this context, or are you saying that you would like analysis tools and language features (e.g. Normalize_Scalars, 'Valid) as "tools"? -- LMTAS - "Our Brand Means Quality"