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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.icp.pl!newsfeed.gazeta.pl!news.nask.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: "Robert Kawulak" Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Sun, 10 Oct 2004 23:09:24 +0200 Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: <41547dae$0$91007$39cecf19@news.twtelecom.net> <1g2d9xmnita9f.5ecju0eftkqw$.dlg@40tude.net> <87u4rkhddelw$.1uuoqhfyd2eay$.dlg@40tude.net> <6zobtdp3ckqx.plmvz5og15id.dlg@40tude.net> <2n0j0jfe6sex.2bcfi09ss44w$.dlg@40tude.net> <1xc5ofa4jkd2x.ejgxx5gcwy4l$.dlg@40tude.net> <63z609r5z0h9.180f2ao5xdqg9$.dlg@40tude.net> NNTP-Posting-Host: pt109.krakow.cvx.ppp.tpnet.pl X-Trace: atlantis.news.tpi.pl 1097447136 897 217.99.216.109 (10 Oct 2004 22:25:36 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Sun, 10 Oct 2004 22:25:36 +0000 (UTC) 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 Xref: g2news1.google.com comp.lang.ada:5016 Date: 2004-10-10T23:09:24+02:00 List-Id: Hi, >>> This "same interface" is not a language object. It is a fiction, which >>> cannot be described in language terms independently on its >>> implementation. >>> So you physically unable to program in terms of this interface. It >>> simply >>> does not exist. >> >> It's not a fiction, it's a kind of agreement. The language doesn't see >> this interface directly, but you can use it. And if you try to violate it >> in >> a place where conformance to this interface is crucial, your program >> won't >> compile. > > Yes. For *you*, it is not a fiction, because you know its semantics. The > problem is how you communicate your personal percept of semantics to other > people. It is what a language all about... Similarily, I could say that Ada has no classes. Of course it has packages, tagged records etc. but no true classes with true methods. Classes in Ada are just as fictious as interfaces in C++ template metalanguage, yet it doesn't mean you can't use OOP in Ada (and interfaces for templates in C++). > Templates constitute a meta-language. That is > inherently bad, provided there is a way to solve the problem within the > native language (maintaining a reasonable level of expressiveness). I'm afraid that our discussion will never reach its conclusion ;-) The reason is our opposite approach to templates and using them to implement containers. Of course everything that is done using templates may be as well done without them (although not always so easily). The point is that in many cases they simplify the design and, what is crucial for C++, they provide containers with efficiency. There's no need for dynamic binding, wrappers and those ugly downcasts :-P. Statically and dynamically polymorphic containers are just two different points of view, two different philosophies. It's nearly impossible to objectively say which one is the proper, for it depends on what is important to you. Both approaches have pros and cons (as we both tried to show in all our posts) and both aren't ideal in all cases. I think C++ chose the templates approach because it's closer to C++'s 'spirit' (don't pay for what you don't use, make built-in and UDTs the same etc). For contrary, Java has taken the opposite approach. And you are forced to use dynamic dispatching and downcasting, which doesn't sound attractive to me (at least you don't need wrappers, because Java object hierarchy is single-rooted). Anyway, I promise to have a look at the links you've provided (thanks), I'm sure I'll learn something new. > Ada has S'Class'Input attribute (ARM > 13.13.2) which represents a factory pattern. Basically it reads the type > tag from stream and then dispatches to an appropriate constructor, which > is > *guaranteed* to exist. The result is a class-wide object. Good to know ;-) Best regards, Robert Kawulak