5 ms·
I think the main differentiators for clang were more readable error messages than the mess GCC had (and still has), and faster compilation (here it lost a bit o
by yakubin 4y ago
I think the main differentiators for clang were more readable error messages than the mess GCC had (and still has), and faster compilation (here it lost a bit of its advantage over time). I haven't heard of anyone praising it over GCC based on standard compliance.
That said, when I explore weird edge cases in how differently Clang and GCC parse source code, and how differently they optimise it, in my experience Clang is still the more logical one, whenever there is a disparity, whereas the way GCC parses code and what code it produces is sometimes completely baffling (and that's not just optimisation stuff - without any optimisations enabled I encountered miscompilations a lot more with GCC than Clang).
I also consider C++ a language for mostly old projects. I start new ones in other languages and don't consider repeated rewrites every two standards, because the "modern c++" crowd found a new way to initialise variables, to be a good investment of my time.
- germandiago 4y ago> I start new ones in other languages and don't consider repeated rewrites every two standards, because the "modern c++" crowd found a new way to initialise variables, to be a good investment of my time. Same here, but I update my new code as I go if there is a better/safer way to do it that does not impact in any bad way my codebase.
- cogman10 4y ago> I haven't heard of anyone praising it over GCC based on standard compliance. Back in the day (C++0x era), it was near bleeding edge. Clang had all the proposed 0x features ready to go before C++11 was released. It took a while for GCC to get all the C++11 features after the release.
- account42 4y ago> Clang had all the proposed 0x features ready to go before C++11 was released. Except garbage collection, of course.
- qsdf38100 4y agoYou don’t have to rewrite anything. C++ keeps backward compatibility. You don’t have to make it sound like it’s the case, and you don’t have to shame the "modern c++ crowd" over that false claim. That’s just uncalled for, unconstructive and partisan discourse. I expect better from HN.
- jnwatson 4y agoDid you see the original post? Lots of code changes were required for Chrome. That’s not backwards compatible.
- qsdf38100 4y agoIt’s 99.9% backward compatible. The comment makes it sound like it’s a huge pain every 2 years, as if it was the "python 2 to 3" level of pain. I went through a lot of these new versions, starting with c++11, and can’t remember one time I had to change anything to my code based, appart from silencing deprecation warnings for unicode stuff. Now I get that chromium-like code bases are huge and that the 0.1% of backward incompatibility is still a pain. Now, with that level of hugeness of code bases, maintaining it when the language evolves is going to be a pain. C++ has been very careful with backward compat, breaking very few things, compared to other languages. So these criticisms really are uncalled for to me. Sounds like good ol c++ bashing trying to sound wise. I felt the comment wasn’t fair and wasn’t an honest criticism. Sorry for my angry comment. We live in rough times.
- jnwatson 4y agoI've done several Python 2->3 transitions, and the amount of effort looks to be in the same order of magnitude described in the post.