3 ms·
> “To understand C++, you must first learn C” > “C++ is an Object-Oriented Language” > “For reliable software, you need Garbage Collection” > “For efficiency
by JoshTriplett 12y ago
> “To understand C++, you must first learn C”
> “C++ is an Object-Oriented Language”
> “For reliable software, you need Garbage Collection”
> “For efficiency, you must write low-level code”
> “C++ is for large, complicated, programs only”
Well, 2.5/5 of those aren't myths. You certainly don't need to write low-level code for efficiency, C++ does a rather poor job of acting like an OO language, and you don't need Garbage Collection, you just need to not manage memory manually, for which solutions other than GCs exist.
You don't have to learn all of C to write C++, but unfortunately you have to learn C to understand other people's C++, because other people will not restrict themselves to the subset of C++ you consider respectable. That's true both for the C bits of C++ and for the obscenely complex corners of C++.
And C++ isn't just for large, complicated programs; it's for small, complicated programs too.
- nocman 12y ago"And C++ isn't just for large, complicated programs; it's for small, complicated programs too." hahahahahahaha!!!!!!!!!!!!!!!!!!! -- I was thinking that, but hadn't put it into those exact words yet. I was thinking something like "C++ is definitely for complicated programs" -- not that they necessarily need to be complicated, but that C++ often unnecessarily complicates them. I really wanted to like the STL a long time ago, but I gave up eventually. Happily my frustration with C++ led me to investigate other programming languages (not that it was the only one I had used), and I write precious little in it lately -- mostly just to modify code others have written in it.
- yoha 12y agoI want to explain why you are getting down-voted: Hacker News don't like onomatopoeias like “hahahahahahaha!!!!!!!!!!!!!!!!!!!”. In general, a neutral tone is preferred and tongue-in-cheek is acceptable (like parent). This is an important difference with most subreddits (some, like /r/AskHistorian have a similar ambiance); it avoids ending up with long, heated and shallow conversations.
- nocman 12y agoI'm not exactly new here. I figured some might not like the "hahaha...", but I don't really care. That's exactly what I did when I read the parent comment. I didn't just leave it at the onomatopoeia -- I made a very reasonable comment afterwards.
- pmelendez 12y ago>"I was thinking something like "C++ is definitely for complicated programs" I am not sure which language are you comparing it to but there is definitely a subset of C++ that is easy to use, very readable and type safe. My only problem with C++ is somebody else code, because there is also a terrible subset of C++ where things can turn very hairy. But same can be said about C, and actually C sometimes encourage you to be "clever".
- nocman 12y agoYes, and I am fully aware of reasonable subsets of C++. However, there are multiple other languages that I would rather program in -- although there are still places where I would chose to use C or C++. I was mostly disappointed that when I tried to use many of the features of C++ that were beyond an intermediate level, the real warts of the language made it not worth the hassle. I suspect some of that has improved in the latest version of the language spec (and some in the version prior), but I haven't seen anything so far that has excited me enough to get back into it much.