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: 145282044 references: <315FCD11.D7E@lfwc.lockheed.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-04-01T00:00:00+00:00 List-Id: In article <315FCD11.D7E@lfwc.lockheed.com>, Ken Garlington wrote: >Robert A Duff wrote: >> >> I really do think the extra >> verbosity damages readability, and there's "no good reason" for it. > >I do think "declare" is useful, if you name the declare block. OK, no argument here. But what about the case where I don't *want* to name it? Adding lots of names doesn't make the code more readable. You only want to add names when there's something conceptually name-able. Locally nested scopes with names seem useful, but locally nested scopes without names, and without extra syntax, seem useful, too. >...This gives you >an easy way to find the end of the scope, even in the presence of nested scopes. >Of course, an alternative would be to have the ability to name all constructs that >would introduce a scope. Something like? > >a_scope: if foo > bar then >... >end if a_scope; > >You could do this with comments, of course, but then you lose the compiler >checking... True. But don't forget that the compiler is just checking that the names match up, which is useful, but it's not checking that the names actually tell the truth about what "a_scope" is all about. So let's not attach too much significance to this amazing magic of compile-time checking. Note that the block_statement *name* is option in Ada, which I think is good -- you can name it if there's a name the gives useful information, but if the name is just "The_Loop_Body" or "The_Else_Part", you can omit it. - Bob