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-Language: ENGLISH,ASCII X-Google-Thread: 103376,7f2ce8bda9cae4ab X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!news.cs.univ-paris8.fr!proxad.net!feeder2-1.proxad.net!news2-e.free.fr!not-for-mail Sender: kanze@lns-th2-14-82-64-63-6.adsl.proxad.net Newsgroups: comp.lang.ada Subject: Re: "Must instantiate controlled types at library level." Why? References: <13392802.3gDeTK7ybb@linux1.krischik.com> <2780491.NPbR8AFya6@linux1.krischik.com> <11924003.IfRfnULeIG@linux1.krischik.com> <1676457.GMYvKY1ieA@linux1.krischik.com> <1616198.O4tUV8TdF7@linux1.krischik.com> <87lljuvd6j.fsf@insalien.org> <874qqgpjok.fsf@insalien.org> <3tVpc.34871$vz5.29965@nwrdny01.gnilink.net> <21700814.aMYQM4SCxr@linux1.krischik.com> From: James Kanze Date: 17 May 2004 21:48:29 +0200 Message-ID: <86d652ygvm.fsf@lns-th2-14-82-64-63-6.adsl.proxad.net> Organization: James Kanze User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.93 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 17 May 2004 21:46:03 MEST NNTP-Posting-Host: 82.64.63.6 X-Trace: 1084823163 news2-e.free.fr 13009 82.64.63.6:32781 X-Complaints-To: abuse@proxad.net Xref: controlnews3.google.com comp.lang.ada:647 Date: 2004-05-17T21:46:03+02:00 List-Id: Martin Krischik writes: |> Hyman Rosen wrote: |> > Ludovic Brenta wrote: |> >> You are not being helpful to anyone with this comment. If you |> >> think I am ignorant, please explain why, or otherwise give me one |> >> good reason not to put your name in my kill file. |> > Oh, by all means put my name in your kill file! |> > But OK. You state that "The std::vector template class is not a |> > first-class citizen". I haven't a clue as to what that might mean |> Ruffly: First class is everything you can use without (in C/C++) |> "#include" or (in Ada) "with" or (in Java) "import". So bool and complex are not first class in C, because you need to "turn them on"? I'm afraid I don't really understand this distinction. (The way most C++ intantiations implement this is extremely primitive. But there's nothing second class about it, in the context of the language.) |> vector <> is not a first class citizen because you need "#include |> " And on many of the early C implementations I'used, float wasn't first class, because you needed to link in a special library to get it? |> And, of corse, to copy the hole content of an other file into your |> own file is cheating. It's certainly not the most robust or the most elegant way of getting the job done, but I don't quite understand why "cheating"? What makes it less honest than anything else (as opposed to simply being a less efficient way of getting the job done)? |> More precisely: First class are only keywords, predefined operators, |> predefined types, (in Ada ) attribute and perhaps pragmas. More precisely: First class is what you like, and second class is everything else. Not much of an argument, really. |> Actually: Even "#include" isn't first class since it is part of a |> preprocessor. |> I am unsure if, in Ada, Integer is first class since there is an |> implicit "with Standart; use Standart;". |> The argument is that everything inside a language need to be |> implemented with first class citizen - they are the fondatation of |> everything else and design errors in this area have profound |> consequences. And one of the basic premises of Stroustrup is that there should be as little in the language as possible. I don't necessarily agree with this attitude; some things, like closure, can really only be done effectively from within the language. But just saying it is bad, or second class, doesn't prove anything. |> Out of my 10 years+ experience with C/C++ I say that the following |> are my personal top 3 C/C++ design mistakes which lead to most of |> bugs I had to hunt down insted the compiler just finding them for |> me. |> 1) #include instead of an proper import/with. |> 2) implicit type convertion. |> 3) arrays are pointers. Arrays aren't pointers. There's just another implicit type conversion. And you don't mention the declaration syntax, which is enough to drive any sane man up the wall. -- James Kanze Conseils en informatique orient�e objet/ Beratung in objektorientierter Datenverarbeitung 9 place S�mard, 78210 St.-Cyr-l'�cole, France +33 (0)1 30 23 00 34