Hacker News new | ask | show | jobs
by querez 1930 days ago
Pro (Arguments for learning C++):

* It will massively increase your marketability: C++ is one of the most popular languages around, and it will stay this way for at least 10-20 years. Most desktop programs are still written in it, most AAA games, and most operating systems, most multi-media data processing uses either C or C++, and it's still the most popular language in the embedded space. Wherever execution speed is a goal, C++ is the lingua franca. As an iOS dev, these might be markets you didn't consider before, but knowing C++ will go a long way towards unlocking them for you, should you ever want to go into them. It will increase the potential places of employment for you like very few other languages could.

* C++ is powerful. It lets you do stuff that's out of reach in a lot of other languages. Have you ever thought "gee, this inner loop costs too much runtime but is easily vectorizable. Man I wish I could hardcode this piece of code in SSE intrinsics (or other modern CPU instructions) or write inline assembly"? Or "man, I could actually already compute this at compile time if the processor would let me" or "If I could store this information in the upper bits of the memory addresses that go unused, I could squeeze the data in a cache line, making cache misses almost a non-issue"? C++ makes these things (and many others) available to you, if you ever want to.

* It will massively increase your software-craftmanship: There are very few popular languages that will expose you to such a breath and depth of programming language concepts, From bare-metal pointers and references, manual memory management & smart pointers to template metaprogramming. At least for me, no other programming language has given me this many instructional "aha" moments, because C++ makes a lot of stuff explicit that is just hidden away in most other languages. Even if you end up not using C++ much later on, knowing and understanding the concepts of C++ will make you a much better programmer in other languages as well. And will make learning other new programming languages much easier. Haskell and LISP are the only two languages I can think of that had similar effects for me.

Contra (Arguments against learning it):

* C++ is difficult. It has massive footguns and error messages (especially in templated code) are sometimes not very helpful. A lot of things that are easy in other languages are suddenly hard, and manual. Some bugs are absolutely non-trivial, hard to understand and to debug, on a level that you haven't seen before. With great power comes great responsibility.

* C++ is old: This may just be a riff on "it's difficult". But on several occasions, it'll get on your nerve. The build and link system are outdated. And C++ in 1998 looked different than C++ in 2017. And the language is still evolving.