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: 146b77,d275ffeffdf83655 X-Google-Attributes: gid146b77,public X-Google-Thread: f5d71,d275ffeffdf83655 X-Google-Attributes: gidf5d71,public X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,d275ffeffdf83655 X-Google-Attributes: gid109fba,public From: robert_dewar@my-dejanews.com Subject: Re: Ada vs C++ vs Java Date: 1999/01/15 Message-ID: <77np3q$e6h$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 432973231 References: <369C1F31.AE5AF7EF@concentric.net> <369CBD05.79D0@telusplanet.net> <369CBDA8.D3673C68@pwfl.com> X-Http-Proxy: 1.0 x13.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Fri Jan 15 16:07:31 1999 GMT Newsgroups: comp.lang.ada,comp.lang.c++,comp.vxworks,comp.lang.java X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-01-15T00:00:00+00:00 List-Id: In article , drc@adni.net (David R. Conrad) wrote: > After he got to know Turbo Pascal somewhat, he said, "Oh, > now I understand why your COBOL code is so unusual -- > you're writing Pascal in COBOL!" > > I considered it one of the greatest compliments I've ever > gotten as a programmer that some sense of structured > programming was coming through, even when I was writing > COBOL. (Luckily, I haven't had anything to do with COBOL > since then.) No, this is a criticism. I cannot imagine anything more horrible than importing Pascal style into COBOL. It is of course perfectly possible to write structured code in COBOL (as a matter of fact one of my PhD students, Carma McClure, who is now married to James Martin) wrote her thesis in this area in the mid 70's. But proper COBOL style is very different from Pascal style, because COBOL has much nicer structuring tools for the procedure division than Pascal. For example in COBOL you would write: PROCESS-BALANCE. if Balance is negative then perform SEND-BILL else perform RECORD-CREDIT end if. SEND-BILL. ... RECORD-CREDIT. ... This kind of in-the-small top down refinement with nice names for sections of code makes well written COBOL easy to read, and by contrast the Algol (and hence Pascal, C, Ada, C++ etc) style of using nested if's is often much less clear. I really miss this ability to define local procedures and use them easily in languages other than COBOL. Note that in languages like Pascal, the syntax for simple procedure definitions is far more verbose than in COBOL (where the syntactic definition overhead for a procedure is the name of the procedure and two periods), and worse, you have to declare the procedure before you use it, exactly wrong for this kind of called-only-once top-down-refinement approach. Now it maybe that you don't agree that this is a nice style and prefer the nested if's of C, but too bad! If you are writing COBOL (or any other language) part of your job is to learn the style that is considered standard and desirable in that language. Writing code that practioners in the language regard as "unusual" and judge to be the result of importing inappropriate foreign paradigms from other languages is the sign of a poor programmer. One of the great advantages of COBOL is that people who know and understand the language well tend to write in a very uniform style, so that people can easily read one another's code. If you ever encountered convoluted use of templates in C++, you will know what I mean by this failing to be the case in some other languages. Obviously you never really learned COBOL well, if you did not understand that importing Pascal style is NOT the right answer to anything. Consequently, your "Luckily" comment is not surprising, it is always frustrating to program in a language you do not understand! Robert Dewar -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own