Just because C++ doesn't feel as "clean" as other languages doesn't mean it's not incredibly powerful, widely supported, and a fun language to develop in. To all the haters out there - give it a chance!
Just because C++ doesn't feel as "clean" as other languages doesn't mean it's not incredibly powerful, widely supported, and a fun language to develop in. To all the haters out there - give it a chance!
Of course, this is a double-edged sword. Higher-level languages have made choices so that you do not have to tinker with such details. But that also prevents you to decide on such behavior when necessary.
C++0x goes a long way in making many aspects of the language more enjoyable, such as type inference, lambda functions, range based loops and defaulted/deleted methods. But once a performant alternative shows up and becomes mainstream (strict Haskell? ;)), I will switch.
Ironically, had C++ been 'cleaner' and not as backwards compatible with C from the outset, then we probably would not be having this conversation today because no one would have ever adopted it. :)
C's struct "tag name space".
Trigraphs and \ line splicing.
Replace #include with symbolic import.
C is a very simple and elegant language. You can write down the specs for it on a dinner napkin. And implement a compiler for it overnight.
C++, on the other hand? A fully compliant compiler for it took over a decade.
Noticing this and rushing to C++'s defense has become a popular thing to do lately. I wonder why.
Myself, I merely have one comment: Bjarne Stroustrup has been known to criticize C++.
I should hope Stroustrup has been known to criticize it! It wouldn't be a very good language if it was designed by someone who couldn't spot flaws in his own work. By no means is C++ a perfect language, and everyone knows that. I'm just saying that doesn't make it any less usable or worth learning.