5 ms·
I really don't see the point of the tone the article adopts. If it is aimed at C++ users, badly mouthing C++ can only put them off what could be useful advice.
by tspiteri 16y ago
I really don't see the point of the tone the article adopts. If it is aimed at C++ users, badly mouthing C++ can only put them off what could be useful advice. If it is aimed at C++ bashers, they don't need the C++ advice anyway.
- mambodog 16y agoSounds like you think that only people who don't use C++ have negative feelings about it. I wouldn't agree with that.
- udp 16y agoBad mouthing of C++ has become a popular thing to do lately. I think it's partly because C++ is a difficult and time consuming language to learn with many caveats, and people find it easier to give up and bash it instead. 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!
- derleth 16y ago> Bad mouthing of C++ has become a popular thing to do lately. 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++.
- udp 16y agoReally? I haven't seen many people rushing to defend it at all, just a whole lot of "C++ sucks, let's all stick with 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.
- Jeema3000 16y agoBut the main reason it's not as clean is because it has had to maintain backwards compatibility with C, which is 40 years old now. 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. :)
- dantle 16y agoCan you give an example of removing some backwards compatibility with C that would make C++ cleaner?
- WalterBright 16y agoConverting static array references to pointers when passing them as a function parameter. The whole array/pointer conflation. C's struct "tag name space". Trigraphs and \ line splicing. Replace #include with symbolic import.
- ajays 16y agoI disagree. The reason it's not clean is because they threw everything including the kitchen sink into it. 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.
- danieldk 16y agoThere are counter-examples. Objective-C is a strict superset of C and a reasonably clean language.
- danieldk 16y agoI did and do a fair share of C++ programming, but I disagree that it is fun to program in C++. Nearly everything is tedious in C++. Just to give one example: you can quickly prototype a class in Python or Ruby and rapidly revise it as your insight with respect to the problem improves. In C++ you have to decide for each member whether it should be an ordinary value, reference, pointer, or smart pointer, which methods to make virtual, behavior for the copy constructor and assignment operator, etc. 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.
- gte910h 16y agoC++ has uses, but it's the sulfuric acid of programming languages: you have to have good personnel control and fire those who screw around outside the boundaries of the right style. A programming group with one guy programming like C with classes and another guy programming like it's Ocaml without garbage collection, and you're in for a mighty piece of hell.
- rbanffy 16y agoYou assume the intersection of the sets of people who use C++ and of people who dislike C++ is empty. I have used C++ for some projects and don't exactly love it. I don't love Java, PHP and Ruby either, but I can use them.