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,FREEMAIL_FROM,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7dbba1cd16d32bb8,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 14 Jun 2008 08:25:10 -0500 From: "Steve" Newsgroups: comp.lang.ada Subject: Ada OOP syntax Date: Sat, 14 Jun 2008 06:26:03 -0700 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Original Message-ID: <_9adnb1KYvIrW87VnZ2dnUVZ_vOdnZ2d@comcast.com> X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 24.20.111.206 X-Trace: sv3-3YbT5Vv/LCE/1ML5lHxWJz8gpV1RHy2P/ep6GeDUrUxGtU2SI2EHXgQnQpbX+8aW+/7c3BkGfolbyEj!tLSHdSuXPvwSO07NBK+/y2JuVN/1cwIYvA6FwN7MGe011NVrhsjFv5id2ZSfH6bZQ4SY5MIyk6qp!trhvqIqIrgpmslziR0DxbJop9nDAbA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Xref: g2news1.google.com comp.lang.ada:702 Date: 2008-06-14T06:26:03-07:00 List-Id: For a programming language that has so much right, Ada sure has oop syntax wrong. What's more is the syntax is inconsistant with a lot of things that Ada got right and other languages didn't. One of the strengths of Ada is the lack of ambiguity in code. In Pascal you have either: if then statement; or: if then begin end; or: if then begin end else begin end; In C/C++/C#/Java you have a similar arrangment. In Ada you have: if then end if; or if then else end if; When you're reading Pascal/C/C++/C# or Java code you have to hunt and look very carefully to figure out the end of an if statement. It isn't so hard when you have a small block of code, but when you run into a bigger block with nested for, while, and if statements it can get pretty tricky. Ada is much improved in that regard since the end of an if statement is clearly marked with an "end if". Ada is has similar constructs for loops, records, block declarations, etc. Tagged type definitions, IMO are an abomination. If you look at Delphi (an object oriented version of Pascal), or C++, C# or Java, there is no ambiguity of the scope of the entities that belong to an object. In Ada there are rules that define the scope of an object. In my opinion this syntax deficiency is the reason the "overriding" and "not overriding" constructs were added to Ada 2005. They improve the situation, but you still have to look closely to figure out which entities belong to which objects. Sure you can use a programming convention to always define one tagged type per package, just like you can use a convention in C++ to always add an "// end if" comment after a closing bracket, but I would expect it to be a requirement of the language. Don't try to respond by explaining how to deal with tagged type definitions in Ada. I already understand and have used them. It's just that when I work with OOP in Ada it's kind of like the drudgery of working with other more deficient programming languages. Perhaps the language could be enhanced to permit an alternate syntax that clearly defines the scope of a class (or tagged type if anyone is stuck on a name) and a pragma to only permit the alternate syntax added? Regards, Steve