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.1 required=5.0 tests=BAYES_20,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!dciem!nrcaer!scs!spl1!laidbak!att!ihnp4!ucbvax!skvax1.csc.ti.COM!linnig From: linnig@skvax1.csc.ti.COM (Mike Linnig) Newsgroups: comp.lang.ada Subject: The danger of comparing languages Message-ID: <8806021643.AA12926@ti.com> Date: 2 Jun 88 16:39:56 GMT Article-I.D.: ti.8806021643.AA12926 Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: Jerry Callen writes: > In case you can't tell, I wrote both the Ada and (shudder) Cobol code > for this "benchmark" (such as it is). Many years ago I did commercial > programming for online systems in Cobol. I KNOW Cobol. Why I'm admitting > this in public I don't know. :-) I have been writing Ada for 2 years, > I think it's fair to say that I KNOW Ada, too. I can see advantages and > disadvantages to writing data processing code in Ada rather than Cobol. > But to use this ONE crude test to claim that "Cobol outperforms Ada by > 50%" is baloney. You have to be very careful in this type of comparison, even if you do lots of different test programs in both languages. The Cobol program was probably written by someone that know which features were inefficent, and they avoided them. We are only beginning to discover what those features are in Ada. If both programs were written using the "identical algorithm" the Ada version may be slower because that algorithm used an inefficient Ada feature. A knowlegable Ada programmer may be able to rewrite the same program to execute much more efficiently. My favorite example of this is the Pascal pointer type. Most folks would translate them into an Ada access type. I've worked with one Ada compiler that automatically created an access collection (heap) when a new access type was declared. Heaven forbid you should declare an access type in a frequently called procedure. This doesn't mean that you cannot use access types, it just means you need to declare them once (say in a package). Mike Linnig, Texas Instruments