From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3e1162e60604101618u4e4ce0c1yac9f0246a116a2e5@mail.gmail.com> Date: Mon, 10 Apr 2006 16:18:56 -0700 From: "David Leimbach" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] Good enough approximation for ape/pcc In-Reply-To: <200604102304.k3AN4vJN003576@haides.silverbrookresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <229aaef51090aa24504f7f55d106b8c2@quanstro.net> <6.0.2.0.0.20060411100415.01cb6490@pop.monitorbm.co.nz> <200604102304.k3AN4vJN003576@haides.silverbrookresearch.com> Topicbox-Message-UUID: 345d2fa6-ead1-11e9-9d60-3106f5b1d025 On 4/10/06, Andy Newman wrote: > On Tue, 2006-04-11 at 10:07 +1200, Andrew Simmons wrote: > > I was recently told about the following compiler option. I honestly tho= ught > > it was an April Fool's joke: > > > > -Weffc++ > > The "joke" is more that to use the language safely/correctly pretty much > requires such an option. There is a mini-industry of "don't do that" > books as the g++ switch shows. Having now done a lot of C++ I find it > quite unbelievable what people will put up with and claim to be good > (but hey they pay me for it). Although C++ does provide a few niceties > it creates a whole slew of problems of its own which need to be fixed > with all manner of convoluted constructs and practices. Don't get me > started on the library, they're only now figuring out that it mostly > sucks. > > > Here here! And this is from a guy who used to think that C++ was pretty much it. I learned it early on (right after QBASIC on DOS, and before I learned C believe it or not...). Concurrency, exception-safety, clearness of error messages, networking, memory management. I don't think *any* of these problems have been adequately handled in C++ in a way that doesn't require you to think of the possible side-effects and consequences of any lines of code you may write. It's really pretty scary to think how much C++ is probably out there, and written in a hurry. It's possible to write good C++ code, just not likely to fall into it by accident. One would think that even middle managers could just look at the volumes of books on the subject of being careful about C++ and realize that if there is an industry around writing high quality code in just one language, that maybe that's not the best tool to use in all cases. Interesting example... SomeContainer::iterator it =3D SomeContainerObject.begin(); for (; it !=3D SomeContainerObject.end(); ++it) is probably a lot faster than for(; it !=3D SomeConatinerObject.end(); it++) And I'd bet that not much more than half of the so-called C++ programmers out there in the world know why this is. Dave