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,b30bd69fa8f63cb2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-13 08:24:16 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: kanze@gabi-soft.fr Newsgroups: comp.lang.ada Subject: Re: C bug of the day Date: 13 Jun 2003 08:24:15 -0700 Organization: http://groups.google.com/ Message-ID: References: <1054751321.434656@master.nyc.kbcfp.com> NNTP-Posting-Host: 62.160.54.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1055517855 14810 127.0.0.1 (13 Jun 2003 15:24:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 13 Jun 2003 15:24:15 GMT Xref: archiver1.google.com comp.lang.ada:39125 Date: 2003-06-13T15:24:15+00:00 List-Id: James Rogers wrote in message news:... > kanze@gabi-soft.fr wrote in > news:d6652001.0306120623.151b7fa3@posting.google.com: > > I don't know. I find using my propre collections far less > > error-prone than the STL. No iterators becoming invalid just > > because I happened to insert an element, for example. > > I use the STL because it is standard, not because it is a > > particularly good generic library. > Maybe it is a reflection of my age, but I do not find it terribly > difficult to create my own collections. I agree to a point. Before I started using C++, I regularly used hash tables in C. Which I rewrote each time around -- if genericity isn't a goal, and you only have to solve the problem at hand, a hash table is only about ten or twenty lines of code. Never the less, I use standard components whenever possible. Not for my own sake -- I think I could design and write something better for my needs than the standard library. But for the sake of the programmer coming after me, who knows, or should know, the standard library, but certainly isn't familiar with my personal components. Note that while we have been speaking here about safety, no one has mentionned readability. And IMHO, this is the most important single feature of safety: a well run code review will catch many more errors than the best compiler, but for a code review to be effective, the readers have to be able to understand what you have written. Not that I'd try and present this as an argument for C++:-). > This also lets me tune performance for my current problem, instead of > accepting a somewhat average performance from a generic > implementation. Most of the time, I really don't care. I want something that gets the job done, is correct, and is readable. And no ordering is implied -- all three are absolutly essential. -- James Kanze GABI Software mailto:kanze@gabi-soft.fr Conseils en informatique orient�e objet/ Beratung in objektorientierter Datenverarbeitung 11 rue de Rambouillet, 78460 Chevreuse, France, T�l. : +33 (0)1 30 23 45 16