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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,86c750b8474bf6d5 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-xxxfer.readnews.com!news-out.readnews.com!transit4.readnews.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: About String Date: Sun, 15 Jun 2008 15:48:49 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <484ABED3.8040909@obry.net> <484b802a$0$23844$4f793bc4@news.tdc.fi> <484d0d5c$0$7537$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1213559329 31309 192.74.137.71 (15 Jun 2008 19:48:49 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 15 Jun 2008 19:48:49 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:yjcciHZgqIEJPmFs+e2yO7gcbjs= Xref: g2news1.google.com comp.lang.ada:718 Date: 2008-06-15T15:48:49-04:00 List-Id: Georg Bauhaus writes: > Robert A Duff schrieb: >> Maciej Sobczak writes: >> >>> You did not state it explicitly, but I presume that you allow mixing >>> declarations with executable code ("as in Java and other languages")? >> Yes, if I ran the circus, I would allow that. I really find it >> annoying >> that I have to add 3 useless lines of code (declare/begin/end) and an >> extra level of indentation, when all I wanted to do was declare >> a very-local object. > > I find it annoying when I have to search other people's > procedures for variables. A typical sequence of statements is > sprinkled with declarations (Java, C, Perl, ...) and no oher > indication of the newly introduced variables other than > two identifiers before "=" or ";". I suppose it's a matter of taste, at least in part. But the situation in C-style languages is different -- declarations don't stand out very well. In Ada, the declaration syntax is clear enough without adding "declare/begin/end". Besides, even with "declare/begin/end", you still have to search all over the place to find declarations -- they can be in various packages, and in any outer block, procedure, etc. > As Dmitry says, there is an *implicit* scope only. > When I'm up the wall I speculate whether this viewpoint on language > use is driven by a desire to achieve income by obfuscation? > The tempting quick hack? Not at all. IMHO, "declare/begin/end" obfuscates, by pretending that the stuff between declare and begin is just declarations, no executable code. > To me, ad hoc variables between statements and Java classes fully > named in source but without "import" at the head of the source file > are similar in character. They seem completely different, to me. I agree with you that importing without saying so up front is not good. > The good news is: computers can help us with getting the > necessary "paper work" (declare block etc.) done; use a > good editor. Sure, I do use a good editor. That's not the point -- I'm not complaining about how much work it is to type in "declare/begin/end" -- I'm complaining about how much work it is to _read_ that extra clutter. The blocks of code we're talking about are often just 2 or 3 lines of code, so adding several nested declare blocks can easily double the size of the procedure. - Bob