Hacker News new | ask | show | jobs
by shin_lao 4935 days ago
Or you can use Clang.

Feel free to shoot C++ in the face. Don't forget to rewrite most of compilers and operating systems in use in the process.

4 comments

Except that clang++ is only marginally better. E.g. trying to copy a std::copy a string vector in a size_t vector will give you this beauty:

http://pastebin.com/H68j6E50

Cascade a bunch of errors, end you'll soon be writing a script to analyse error output ;).

Clang is not the solution. Yes it has some better error messages. Although GCC is quickly catching up.

But it can't solve the core problem. It's simply the language. The lack of Concepts (or something similar) means that error messages simply refer to implementation internals of the Template you are using. Easily giving you a long cascade of error messages when it's in some Template that is used by the Template.

All of the sudden you have to look at implementation details of your standard library or something even worse such as boost. Just to figure out what the mistake was.

And there is nothing Clang or GCC can do about it.

Linux doesn't use C++ and AFAIK the BSDs also don't.

So go ahead, I won't have a problem with a dead C++. :-)

Then prepare to drop GCC. Then drop whatever browser you are using and most of the cross platform compatible GUI frameworks (GTK, QT etc).

https://lwn.net/Articles/390016/

GTK is written in C, not C++.
Sorry was thinking of something else.
There is much more to the OS than the kernel. Lots of important software is written in C++.
that's not a problem in the long-term perspective as it doesn't force anyone else to use C++
What would the clang error message be?
It's roughly the same as the improved GCC error message ("index out of range"), but with only 29 extra lines of incomprehensible compiler meandering and stdlib internals!