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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8a402d78988bdf2b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-19 07:15:39 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nntp.abs.net!ash.uu.net!spool.news.uu.net!not-for-mail Date: Fri, 19 Dec 2003 10:15:12 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: [announcement] SYSAPI and SYSSVC for Windows References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1071846912.728815@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1071846912 27008 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:3556 Date: 2003-12-19T10:15:12-05:00 List-Id: Ekkehard Morgenstern wrote: > For example, in Ada I can simply use a limited type when I want to prevent > assignment to it. In C++ I have to declare a private copy constructor and > a private copy assignment, which makes no sense really, in a logical way. It makes a great deal of sense. You wish to prevent assignment, and therefore you make the assignment operator inaccessible. > And if I do want to support copying in C++, I have to write at least a > copy constructor and a copy assignment for every class. No, you need to do this only when the default of memberwise-assignment is not suitable. That implies that class is holding onto some resource that must not be shared (such as a pointer). It's easier and better to push down the semantics of copying that shared resource into a class of its own (generically known as a smart pointer) instead of repeating the code to copy it everywhere. If you find yourself creating assignment operators and copy constructors for many classes then you are probably designing them incorrectly. > Template classes have nonsensical limitations I know of several limitations, none of them particularly nonsensical. (Here are three: 1)Floating point template parameters 2)String literal template parameters 3)Virtual template methods.) What exactly do you mean by this? > (like no goto over initialization) are nonsensical What exactly would be the semantics of a goto over an initialization? Do you think you can jump into the middle of a scope in Ada and bypass the elaboration of the declarations of that scope? > To use exceptions in C++, I have to create a real exception class, > while in Ada I can simply declare it, which greatly speeds up > implementation of code supporting exceptions. So we have an Ada proponent bashing C++ for requiring more typing (in both senses!)? In any case, the claim is false. In Ada one writes Joe : exception; raise Joe; exception when Joe => ... If you want the same thing in C++, you say struct Joe { }; throw Joe(); try { ... } catch (Joe) { ... } > In C++, there are no built-in types for concurrent data structures and tasks, > which means you have to use a library, which is almost never portable. That's true. > Especially the concurrency aspects of Ada make it ideal as a systems > programming and implementation language. Except that the Ada concurrency system isn't portable either, except to people who know exactly what they're doing. For example, scheduling may not be pre-emptive and doing I/O may block all tasks. And it's not especially clear that you want to use the concurrency features of a programming language in an operating system, which after all is there to implement this concurrency. > The whole OO stuff isn't really necessary for an OS. Abstraction (using types) > and black-boxing (information hiding) is more important than proper OO > inheritance schemes. What does "really necessary" mean? OO stuff is useful when it's useful. Certainly driver interfaces tend to be chock full of tables of function pointers, which suggests that they should be implemented through inheritance.