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,5f764f1f7822ab9c X-Google-Attributes: gid103376,public From: "Marc A. Criley" Subject: Re: Top 10 Language Constructs (Ada) Date: 2000/07/15 Message-ID: <3970F56F.F3A70FAD@icdc.com>#1/1 X-Deja-AN: 646831379 Content-Transfer-Encoding: 7bit References: <8kmjja$l5h$1@pollux.ip-plus.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@supernews.com Organization: Posted via Supernews, http://www.supernews.com MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-07-15T00:00:00+00:00 List-Id: Bruno Gustavs wrote: > > What do you think are the top ten language constructs in Ada? > Please don't answer in terms of OO concepts, but try to restrict > yourself to those statements you really use to cope with your > daily work. > > Curious why I'm asking this question? In spite of all requirements > engineering effort we know exactly *how* to solve problems > with computer languages but know fairly, *what* we're doing > during this process. > > Regards > Bruno Gustavs I don't find looking at Ada in terms of "Top 10 Constructs" especially enlightening. (I'm not criticizing that approach, it just isn't in sync with my point of view :-) The critical foundation of the Ada programming language is its "type model". (In claiming this I want to credit Doug Bryan for triggering this insight for me at an Ada conference seminar about a dozen years ago.) Any decent programming language has to have some programming paradigm that it seeks to embody with syntax and semantics. This paradigm can be obvious within the language or somewhat obscured, depending on how well it is defined and captured in the programming constructs. - Smalltalk's programming paradigm is clearly inheritance - A variety of languages are oriented around logical expressions (Lisp, Prolog) - Java's paradigm appears to focus on the "interface" concept, though that's not particularly obvious at first glance, given as its technical hype is typically "C++ with garbage collection" - C manages memory contents and addresses (it's effectively a portable assembly language, and I don't intend that in the perjorative sense). For COBOL, Fortran, Eiffel, etc., I'll leave it for others with hands on experience to characterize those. Ada, then, is built around its type model. In a strongly typed language, a startingly signifiant amount of information can be embedded within the code through the intelligent use of types. Most of the technical advocacy for Ada that mentions its strong typing aspect usually centers around range checking, and neglects almost everything else strong typing provides. Experienced Ada programmers almost take for granted attributes like 'first, 'last, 'pred, 'succ, 'image, 'value, 'length, 'range, and the many others. Well, without Ada's typing model, you get at best a subset of these, and likely only a handful. Consider the parameter of this procedure specification: procedure Process_Data(Data : in out A_Data_Array_Type); Knowing that Data is an array, consider all the attributes available to extract all the information possible about that Data parameter given only what's provided in the declaration you see. Contrast that with a corresponding C declaration: void processData(aDataArrayType *data); What can you determine about this *data parameter? When tries to determine what paradigm Ada's syntax and semantics are trying to embody, the majority of it centers around the type model. - Concurrency is provided as protected types, task types, or tasks (which is really a degenerate task type) - Generics provide static polymorphism - Tagged types provide inheritance and dynamic polymorphism - Dynamic invocation is implemented by "access subprograms", i.e., "subprogram types" Certainly other languages employ the same type-centric approach for their corresponding constructs (and of course inheritance is pretty much type-centric by definition), but none to the same unified level of capability and consistency as Ada. (In fact, the only significant construct that could have been type-centric, but wasn't, was exceptions. And even those have started sliding that way in Ada 95 with its introduction of "exception objects".) By exploiting Ada's type model, programmers embed an incredible amount of supporting information within their software...and can then extract it and put it to work through the use of Ada's attributes. This, to my mind, is the most powerful and fundamental construct of Ada: the type model that underlies the language and serves as a repository of information for aiding the production, quality, and reliability of software. Marc A. Criley