top | item 2548710

(no title)

jfr | 15 years ago

Most, if not all, of his arguments were already beaten to death. The rebuttal should be floating around somewhere on the Internet, but I couldn't find it with a quick search right now.

Anyways, right at the beginning of the presentation you see the quality of his arguments as he uses a very known problem of a particular compiler (GCC) to bash the language. Sort of a straw man fallacy.

discuss

order

kjksf|15 years ago

His argument is that C++ is so complex that it's extremely hard to write a fast, reliable compiler that generates good error messages.

The fact that it took gcc programmers 10 years to get to a point where gcc doesn't use ridiculous amounts of memory when compiling few lines of tricky code is a fact in favor of the argument, not against it. Gcc programmers are smarter than an average programmer. If it was easy, they would have gotten it right on the first try. Accordingly, C or Java or C# or Go compilers didn't have such problems so C++ is more complex for compiler writers than pretty much every other known language.

The same goes for error messages. In the past decades we've had tens of C++ compilers. If clang is the first one that is able to generate decent error messages for templates, then it means it was a hard problem to solve.

None of that got any easier: if you want to write another C++ compiler, it'll still be hard for you to generate decent error messages or compile tricky C++ code reasonably.

Someone|15 years ago

A possible counterargument: it took gcc programmers 10 years to get to a point where gcc doesn't use ridiculous amounts of memory when compiling few lines of tricky code _in_C_.

Clang, written in C++, is faster, uses less memory, produces better error messages, and, I brink, took less calendar time and man hours to write.

Yes, it is a hard problem to solve, but from these two anecdotes, it seems solving it in C++ is easier than solving it in C.

And yes, I know the above probably is a fallacy; gcc hackers probably spent most of their time working on CPU ports and on getting gcc to produce better code. Begin hackers, and not having a C++ code base themselves, getting good C++ error messages just wasn't important enough for them.

jfr|15 years ago

I could use your argument to describe pretty much any modern compiler or framework. "It is extremely hard to write a fast, reliable Java SDK that generates good error messages.", for example.

It took years to GCC to arrive where it is because it contained A LOT of legacy code that have been accumulating since its first versions with C++ support. GCC is a compiler that evolved little by little through long years, and many features were added with little design, to fix punctual problems, which made it difficult to converge to a clean implementation.

Clang, on the other hand, had a good deal of proper design to write a clean, robust compiler. The fact that clang reached where it is in such a short time compared with GCC is a good evidence that it is possible to write a good C++ compiler with nice performance and error reporting if you employ good engineering efforts.

KonradKlause|15 years ago

Very sad, you have read only the first few slides...

jfr|15 years ago

No, I have read it in its integrity the first time it came around, a few years ago. Please, stop judging people.