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,fc52c633190162e0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newshub.sdsu.edu!newscon04.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr17.news.prodigy.net.POSTED!4988f22a!not-for-mail From: Newsgroups: comp.lang.ada References: <1172144043.746296.44680@m58g2000cwm.googlegroups.com> <1172161751.573558.24140@h3g2000cwc.googlegroups.com> <546qkhF1tr7dtU1@mid.individual.net> <5ZULh.48$YL5.40@newssvr29.news.prodigy.net> <1175215906.645110.217810@e65g2000hsc.googlegroups.com> <1175230352.808212.15550@e65g2000hsc.googlegroups.com> <1175236212.771445.135460@y66g2Organization: LJK Software Subject: Re: why learn C? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 70.134.100.216 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr17.news.prodigy.net 1175363746 ST000 70.134.100.216 (Sat, 31 Mar 2007 13:55:46 EDT) NNTP-Posting-Date: Sat, 31 Mar 2007 13:55:46 EDT Organization: AT&T http://yahoo.sbc.com X-UserInfo1: [[PAPDONTBWQR]TX\ZIBNFXBWR\HPCTL@XT^OBPLAH[\RYIBK^RAQFW[ML\THRCKV^GGZKJMGV^^_JSCFFUA_QXFGVSCYRPILH]TRVKC^LSN@DX_HCAFX__@J\DAJBVMY\ZWZCZLPA^MVH_P@\\EOMW\YSXHG__IJQY_@M[A[[AXQ_XDSTAR]\PG]NVAQUVM Date: Sat, 31 Mar 2007 10:56:16 -0800 Xref: g2news1.google.com comp.lang.ada:14697 Date: 2007-03-31T10:56:16-08:00 List-Id: "Larry Kilgallen" wrote in message news:c82IfUV$xbi8@eisner.encompasserve.org... > In article , > writes: > >> I cannot imagine anyone writing a column >> called "Obfuscated Ada." > > Number_of_Genders_Encountered : Integer; > Traffic_Light_Color : Boolean; > Completion_Flag : My_Special_Record_Type_Defined_in_Another_Module; OK. With a little effort, one can write obfuscated code in any language. However, with C++ it is far more likely than with Ada. Further, as your examples illustrate, one needs to really make an effort to do so with Ada. I recall a project I worked on many hundreds of years ago (it seems that long) where we were using COBOL. One of the programmers used the names of comic book characters as data and procedure names throughout his program. We had constructs such as, MOVE BATMAN TO BATMOBILE. The code worked fine, but it was somewhat obfuscated. Your last example is particularly interesting. In the absence of a global visibility clause (use), one would expect dot notation to disambiguate the other module. For your first example, coding standards would certainly apply. We learned a long time ago not to use type numeric types in package Standard. In Ada, we can define our own data types. This is not an option in C++ unless one jumps through hoops. Finally, using Boolean for Traffic_Light_Color is simply absurd, not obfuscation. There are three colors for a traffic light, and Boolean only covers two. This is not bad coding, nor is obfuscated code. Instead, it is bad design. The "Obfuscated C++" column, which I enjoyed while it lasted, was not always code that was tormented into a puzzle. Instead, it was code that one might actually find someone using on a project. Sometimes, I could figure it out through simple reasoning. Other times, I had to fire up my trusty C++ compiler to get to the answer. A couple of times I had to wait for the following month's installment with the published answer. In Ada, this kind of thing would be less likely. Richard Riehle