Why does everyone here seem to dislike C++?
11–20 of 46 posts
Re: Why does everyone here seem to dislike C++?
#12Apart from school, let me give you an advice. If you have a brain that can handle multiple levels of OO in c++ across multiple threads; keeping multupltformness in mind and crunching out optimized code with all that you learned in your data structure classes, stick with C++. The pay is way better (like three times more here in Toronto) than anything web or app related, the working hours are more sane, and stuff are u…
Re: Why does everyone here seem to dislike C++?
#13Re: Why does everyone here seem to dislike C++?
#14Compared to plain C, C++ tends to become unmaintainable. Everybody knows a tiny subset of the huge language, yet must somehow work together on a team. People do not stick to a common subset of the language that everybody is comfortable with, especially considering team members that will be hired in the future. In theory, C++ can be as fast as C. (officially lacking the "restrict" keyword, but otherwise fine) In pract…
Yeah, true. Used to think otherwise, but experience shows over and over again this happens in most large teams. C++ somewhat encourages too many abstractions and complicated control flow (exceptions, [multiple] inheritance, templates, ninja operator overloads). Building and linkage (especially against third party blobs) is also a big issue even in 2016. Builds are slow and binary incompatible between compiler versions and vendors.
> In theory, C++ can be as fast as C.
Actually, it can go both ways, C++ can be faster as well. For example when C++ enables inlining - std::sort beats idiomatic C qsort quite handily. Depends how you use it more than anything else.
Re: Why does everyone here seem to dislike C++?
#15For an EE, C++ is a pretty good language, in that it lets you get very close to the hardware. Most of the people who criticize it don't work in that world.
Huh. I've always kinda thought it is other way around. People who tend not to criticize C++ are not suffering it on a daily basis in dysfunctional organizations. :-)
Re: Why does everyone here seem to dislike C++?
#16For an EE, C++ is a pretty good language, in that it lets you get very close to the hardware. Most of the people who criticize it don't work in that world.
> Most of the people who criticize it don't work in that world. Huh. I've always kinda thought it is other way around. People who tend not to criticize C++ are not suffering it on a daily basis in dysfunctional organizations. :-)
Re: Why does everyone here seem to dislike C++?
#17I was writing a test output parser in Python: ~50 lines of functional code in less than an hour. Testing the script for about 10-20 mins and tweaking it to my liking.
The same in C++ would've required me to look up/read up a bunch of library functions that I've forgotten (Should I use file I/O, string manipulation C functions or C++ functions?), link to a few libs (non-C++11) or read some obscure documentation on C++11's regex implementation. Compile, test, change, repeat. This is way more time spent as compared to the Python option.
This is not a fair judgment of the language, but my point is that for something simple there are other languages. For something complicated, C++ has been used in many applications (successfully and unsuccessfully). But there is no doubt that once a C++ code base becomes large it is extremely hard to maintain.
Re: Why does everyone here seem to dislike C++?
#18Re: Why does everyone here seem to dislike C++?
#19Re: Why does everyone here seem to dislike C++?
#20I almost came back to the language with C++11, but its core problem remains the same: the only maintainable codebases seem to be those strictly ruled over by language experts with an iron fist -- and too many people think they're experts (hint: if you haven't read the language standards (or written them!) and hacked on a compiler or two, you probably aren't an expert).
You inevitably have to choose an opinionated subset of C++, which often results in a language which is more on par with many modern languages, but with more pitfalls and traps, and which you have to teach to every person you bring on board.
And let's not even start on compile times and other problems C++'s legacy brings with it.
FWIW, I still do a lot of C and assembly. Modern C is pretty nice, although it will be nice to see a newer systems language finally take over.
You will probably end up doing C++ professionally, and that's fine, but for your own sake and the sake of your coworkers, learn some other languages that will broaden your mind.
You can find many suggestions in this thread, and I could go on about the more mind-broadening ones (logic programming, dependent types, metaprogramming, etc), but the most valuable might be another systems language, even if it's not popular, just so you can see how things could be otherwise. I think reasonable candidates might include Ada, Modula-3, Rust, D (which is a little too close to C++), BLISS if you can track down a compiler, Forth; maybe even Common Lisp.