
Ask HN: I know a few high-level languages. Is it still worth learning C++? - kixpanganiban
I specialize in Python, but I know a fair bit of Go, Elixir, PHP, and JavaScript (and its flavors).<p>That said, would learning C++ add to my [market] value as a developer, and&#x2F;or would it allow me to do things I otherwise could not with my current set of languages? If not, is there any reason at all why I should consider C++?
======
T-A
C/C++ is still the tool of choice when you need to eke out max performance
from the available hardware. That could be because the hardware is weak (maybe
an embedded system) or because you need real time performance (game engines
come to mind) or because you need to perform very large calculations (e.g.
train neural networks, simulate fluid dynamics).

When the going gets tough, the tough reach for their C/C++ compilers. :)

------
devnonymous
If you don't know C, I would recommend to invest time in learning that first.
Learning C++ would certainly not be a waste of time. However, if you want to
be efficient about the use of your learning time, choose the
technology/languages that would come in handy for what you would like to do
next.

C++ is seeing a revival of sorts due to IoT/Automotive/Fintech software etc.
So from a career perspective it would be a good investment of time (if, for
instance, you are inclined to work in those fields).

However, keep in mind what is being called Modern C++ (c++11 and later) is a
completely different beast than C++ which is uttered in the C/C++ sense.

My prediction is that the reality of C++ in the near future would be a
mishmash of old and new C++ ...and it would go the Java way -- heavily adopted
but a _lot_ of bad code written by confused practitioners.

~~~
shanwang
Your prediction is very true, especially in the Finance/Auto/Embedded
industry, while oftenly the work horse C++ code were written 10 years ago
using old C++, you write modern C++ code around them.

------
Rannath
c/c++ adds to the market value of a dev iff that dev needs it for their job.
Same story with every other language. Javascript won't help you get a ruby job
for instance. You might consider learning C & assembly, because they'll give
you a greater appreciation for what your computer is doing closer to the
metal. You don't have to be good, but learning to do at least basic stuff can
help you be better with other languages.

~~~
zer00eyz
Everything you have said here is correct but I would like to add one thing.

Someone who writes a higher level language (like python, php or ruby) and can
understand the internals (written in C not C++) can at times have a distinct
advantage.

Not only are you able to/capable of understanding what is going on at a deeper
level you now have the ability to optimize things in a way that would not
normally be possible. On the PHP side I have used C to do some low level
optimization that would not have been possible otherwise, and a long time ago
simply get some features to work properly.

------
itamarst
C++ is fundamentally different insofar as it has no garbage collection. Which
means it's different enough that learning it will be educational (e.g. it
means different forms of resource cleanup are possible:
[https://codewithoutrules.com/2016/03/10/compare-
contrast/](https://codewithoutrules.com/2016/03/10/compare-contrast/)).

On the other hand, it's also a massive language, and modern C++ is very
different than the legacy code bases you'll encounter in the real world. So
it's a large time commitment to learn it well enough to code well in anger.

If you have the time try skimming a tutorial, and doing some exercises, enough
that you can get the differences in mindset. But it's probably not the most
efficient way to increase earnings, if that's all you care about.

------
kahrkunne
It's always worth it to learn more languages. Every developer should learn C
imho (it's a very widely used, influential language and it's pretty small).
Seeing how C++ is essentially a superset of C, you might as well check it out
after you learn C.

Also, don't focus on your "market value", focus on becoming a better
developer. You're a craftsman, not a piece of merchandise - have some pride in
your craft. (not meaning to say you don't, I just liked the sound of that)

------
informatimago
I concur with Rannath, if you don't have a C++ job, or you don't want to
contribute to some C++ free software, my advice would be to learn C.

~~~
Rannath
Also: C/C++ is the king if you want to make games, then C# (thanks to unity).
Don't use java for games. Unless it's an android game, even then use the
native API if you can.

------
tedmiston
It's hard to answer this question without knowing what it is you are doing or
want to do. Python + C++ can be a good combo in the computer vision, pattern
recognition, machine learning, etc spaces. But for say a normal web app
developer, C++ doesn't add much. I haven't written any C++ since school.

------
wayn3
I'd rather learn C.

