On Wednesday 09 November 2005 11:32 am, Steven T. Hatton wrote:
The places where C++ code can be faster are not relevant to a lot of applications. They mostly apply to number crunching and chains of mathematical expressions. If I get motivated, I may try to fish out an example.
This isn't completely correct. There are some more mundane places were you can really exploit C++ features. A disciplined and skilled C++ programmer in the habit of using the most efficient coding styles will produce code that has few pointers, avoids redundant memory allocations and cleans up after itself thus not needing garbage collection. My opinion of garbage collection in C++ is that a C++ programmer needs garbage collection like an alcoholic needs wiskey. I've taken 200 lines of C-style code and reduced it to a dozen lines of C++. Most of those lines were of the form out << "The input provided was stupid..." << "\"; Yes, I know about std::endl. Don't use it on every line. It makes unnecessary calls to flush. only use it when you really want to call flush. C++ has huge potential. One of its greatest shotcomings is the subornness on the part of the established C++ community. The are too quick to reject any form of criticism. OTOH, there are people doing some good things. Though I don't like everything about Qt, it is one of the nicest toolkits I've seen. And Qt 4 is markedly better than Qt3. Right now I'm spending my days arm wrestling Mathematica. Talk about a bizarre language. For example f[g[x_]] ^:= -g[x] is assigning what is called an up-value to g. And it just gets strangerer and strangerer from there. Steven