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,f92fbb4a0420dd57 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: some questions re. Ada/GNAT from a C++/GCC user Date: 1996/04/01 Message-ID: #1/1 X-Deja-AN: 145246256 references: <4jjul6$637@ra.nrl.navy.mil> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-04-01T00:00:00+00:00 List-Id: In article , AdaWorks wrote: > Surely you inadvertantly omitted your smiley for the phrase, "for no > good reason." No, I'm absolutely serious. No joke. I really do think the extra verbosity damages readability, and there's "no good reason" for it. Don't get me wrong -- I don't think is really a big deal. Another point: The extra verbosity also encourages people to declare things up at the top of the procedure, rather than at the innermost statement list in which they're used. For example, I believe I saw a post from Norman Cohen a while back, saying that (in some particular example), the extra verbosity of declare/begin/end just isn't worth it. That's sad, because when you move the thing up to the top, you make the declaration harder to understand: - Its scope is larger, so to see how it's used, you have to read more code. - In many cases, the initial value of the variable is not known at the top of the procedure -- it's something that gets calculated along the way. So you have to initialize it with an assignment statement. That's bad, because it becomes harder to understand whether the variable is properly initialized. - In many cases, making the scope bigger than it needs to be causes the object to be a variable, rather than a constant. Constants are easier to understand than variables. So here's a case where trying to FORCE people to write good code backfires. Norm Cohen is not some evil doer who revels in terse, arcane notations! - Bob