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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-07 14:21:42 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Lao Xiao Hai Newsgroups: comp.lang.ada Subject: Re: How to make Ada a dominant language Date: Tue, 07 Aug 2001 14:23:02 -0700 Organization: AdaWorks Software Engineering Message-ID: <3B705C36.364298E7@ix.netcom.com> References: <3B676974.C80C72E5@sneakemail.com> <3B6F5893.8F620D80@ix.netcom.com> <3B6F99FC.F3CDB609@sneakemail.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 9e.fc.cd.4a Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 7 Aug 2001 21:22:33 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:11529 Date: 2001-08-07T21:22:33+00:00 List-Id: "Russ P." wrote: > That's all very interesting, and I appreciate the explanation. However, > I did not make any statement whatsoever regarding the advisibility of > using "use" or the proper way to use it. The fact is that if you put > "use SomePackage" at the top of a file, it doesn't make sense unless you > have already put "with SomePackage" (or am I still missing something?). > All I am saying is that you shouldn't need the "with" statement if it is > already implied. Now, if that causes some logical problems, then I guess > it can't be done. Let me see if I can summarize. A context clause, "with", puts the services of a library unit in scope. A visibility clause, "use", makes all those services directly visible. In a sense, the visibility clause is similar to the "import" clause in Java where the equivalent of a context clause is, indeed, implied. For production code, we discourage the visibility clause. However, it is still necessary to put selected library units in scope. That selection is enabled through the context clause, "with." Ada never permits anything to be implied. Each construct is explicit and intentional. There is a very sound engineering principle in this model, but it does not always jump to the eye. As to your comments regarding syntatic changes, I did not respond to them in my original post. In my own programming practice, the current syntax seems to work quite well so I have no complaint about it. I do understand that those who migrate to Ada from another language will sometimes find the syntax unnatural. When I migrated from Assembler to Fortran, all my code looked as if I were coding Fortran in Assembler style. When I had to do some projects in COBOL, my COBOL code looked like Fortran. When I did my first project in C, my code looked like Assembler, and I actually found C to be quite annoying. As I gained more experience using a greater variety of programming languages, I developed some preferences, but I also found that I had little trouble simply adopting the syntax of each new language. Adopting the structural differences of a new language was quite another matter. On first encountering Ada, I found it confusing, verbose, full of what I thought were unnecessary and extraneous constructs, and generally not my idea of a great programming language. Once I had some good experience with it, actually writing code and designing programs, I changed my mind. At present, I place it quite high, syntax included, in my preference for programming languages. I also like Eiffel, which has no C-family syntactic baggage, as well as Smalltalk. These things are a matter of personal taste, as noted earlier by Mr. Falis. So far, I have rarely encountered a programmer who was so set in the ways of one language that she/he found Ada syntax that annoying, after using it for a while. I respectfully disagree with the proposition that language syntax has very much to do with Ada's lack of popularity. Certainly the C-family syntax, borrowed heavily by Java, Python, C++, C#. Perl, and Ruby, is more widely used. That does not make it better. The popularity of this syntax does not originate in a search for better syntax. It derives from a tendency to follow the "path of least resistance," common in human nature. So I would consider changes in Ada syntax, at this juncture, to be a bad idea, if for no other reason than the many millions of lines of code, the many changes to compiler design, and the many Ada programmers who are quite satisfied with it as it is. This is not to mention that some of the changes you have suggested are in the language to satisfy its underlying goal of reliability. Many of those syntactic artifacts are in place to tip-off the compiler to a potential inconsistency in design, poor programming reasoning, or sloppy coding practice. In some cases, they are the key to the compiler's being able to detect unconfirmable constructs. You may object to this line of reasoning, but I see no good reason to make changes in the language syntax unless those changes contribute to the underlying goal of the language: the ability to build more robust compilers that detect errors as early in the development process as possible. I do appreciate your starting this dialogue since we all benefit from an occasional bit of criticism and questions about the rationale for the language design. Thanks, Richard Riehle