Subj : Re: Compiler and an interpreter To : comp.programming From : Jon Harrop Date : Sun Jul 31 2005 02:33 pm Gerry Quinn wrote: > In article <42eb8672$0$14673$ed2619ec@ptn-nntp-reader02.plus.net>, > usenet@jdh30.plus.com says... >> C++ isn't worth using unless you use the STL, IMHO. Error messages from >> all of the compilers that I have seen are completely unwieldy when using >> the STL. For example, the following code contains an extra "const": > > STL is just a library. I got on well enough with the MFC collection > classes for a while, although I do prefer STL now. I still use MFC > CString. The rest of the stuff is just functions you might need once > in a while. > > [STL example - I'm not sure I would call it C++] I don't think there's any question that it is C++. If you write code that uses the more advanced features of C++ then you'll get many such errors (and probably even compiler errors). >> What you are saying is true in C but not in C++. > > It's true in C++ in my experience - STL errors are not as common as > simple syntax errors. In my experience, STL errors are far more common than syntax errors. I rarely make syntax errors... > Perhaps if you are trying to emulate some kind > of functional language with C++ you will get more. No, you just need to be pushing elements onto a list and so forth. I knew nothing of functional programming when I was using C++. > There is a freeware add-on called STLFilt that is supposed to parse > these errors for common compilers - haven't tried it. At the end of > the day an uninformative error message still does most of its job as it > tells you there is an error and approximately where. Yes, Bjarne gave some lectures on how he thought C++ compilers could give better messages in the context of template-heavy code. This is just one of many problems born out of poor design though. I've never seen another language with such terrible error reporting. I'd strongly advise all C++ programmers to consider something less sucky, like OCaml. -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com .