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 Steven, I appreciate this is continuing to drift further OT and apologize in advance. Given your frank observations on C++ development, can I ask for your suggestions/advice? I own a small software development company (3-5 emps). I would like to move our applications to C++. We have about 50 variously active customers all running custom apps of roughly an extended accounting nature. We have over 20 years experience and have converted all our apps three times
On Wednesday 09 November 2005 14:00, Steven T. Hatton wrote: previously. Obviously we would like to do this conversion with a high degree of skill and appreciate there may be several passes to produce a version to release. The question, then, is: where would one look amid the abundance of C++ information to separate the wheat from the chaff in development? To get accustomed to C++, I downloaded 'Thinking in C++' by Eckel. I'm using it to both learn C++ and to teach my 17 year old son (which I think is one of the better ways to learn, that is, by trying to teach someone else). The book is excellent but some parts use C examples to teach C++ and are a bit heady for a non C programmer. (Our current version is written in a RAD environment). I bought one of those 'learn C++ in x hours' books to get some simpler examples. It's OK for examples in some areas but the book is too limited and the author's comments too naive for serious development. Would you recommend any books, mailing lists, Internet sites for 'quality' input for C++ development? Again, this would be for end user application development, not device drivers, O/S extensions, etc.? I appreciate much of the discipline would be in common and so would appreciate any such sources worth considering. Thanks in advance. jcp