Ask HN: Should I learn C++ in 2019? - humbfool2
======
davismwfl
Depends what you want to do. I love writing C/C++ still and it still drives
the majority of things you interact with daily, especially low level systems.
People argue that all the time, but almost every device you touch has a micro
controller today and almost all of those are using C or C++. Even large
complex systems still use C or C++ as a primary toolset still to this day.

My 2 cents, if you get out of the echo chamber of SV and tech startups C/C++
are still very much alive and in many cases growing in usage. Inside SV and
tech startups C/C++ are both treated like the elderly family member people
just put up with but dismiss, when in reality that person has a shit ton of
knowledge everyone could learn from.

~~~
nideguy
I have been weigh which is the easier language to write lexical, parser and
code generation for a new programming language. Is C or C++ the idea to start?

To compile to machine code, not bytecode.

~~~
davismwfl
You'll find many compilers and parsers are written in C, it gives great
portability across platforms and gives the best performance. Whether you write
in C or C++ I'd think is more a matter of design choices for a parser and code
gen tool. I'd probably go with C++ myself, but either is completely
reasonable. You'll also be able to find lots of examples online in C/C++.

Also in this case while there are some compiler differences between platforms
for C/C++ they are well documented and known. If you stay in the middle of the
language and don't try to use fringe features of the language or a specific
compiler then you won't have any issues. People that complain about
portability or GCC etc are generally using language extensions of a specific
platform compiler which can make portability a pain.

~~~
nideguy
Thanks, I have seen Lex, Yacc, Bison, do they still used in the industry?

Some used LLVM and some used GCC/Clang, I'm splitting over which is a better
choice to build "statically typed" programming language.

~~~
davismwfl
I'd argue it is mainly personal preference. But it goes to my point that if
you stay in the middle of language features and don't use compiler language
extensions it won't matter.

When I set my projects up I generally use gcc/g++, but that in no means is the
only correct way. Just a personal preference given the number of platforms
that gcc supports, including embedded.

------
detaro
As always, depends on what you're doing/planning to do. It's a widely used
language that I doubt will become irrelevant anytime soon if that's what
you're asking.

------
taf2
Yes - it’s valuable language that will really be valuable in helping you
reason with code in the future... it’s a real shame colleges started using
java instead of c and c++ as a starting language. It’s helpful to understand
the building blocks that get us to languages like java or interpreted
languages like python and ruby...

------
wikibob
Let’s discuss economics.

Does anybody have any data or anecdotes about the relative market value of
C++, Java, and Go?

C++ work seems to have an odd bimodal split. All the kernel and low level
hardware work seems to pay a fraction of what FAANG pays.

But at the same time, the majority of significant systems at Google are in
C++.

Thoughts?

------
gmrowlan
If you have any curiosity about how computers work and you haven't written
anything that low level, I'd recommend it. A lot of the modern interpreted and
garbage collected languages hide a lot of features of programming from you and
I personally think it's important and valuable to learn.

------
psyclobe
Yes, learning anything is always a good idea, expands the mind. I'd say the
same thing about any language. Too many people just stick to one, and they act
like its going to solve the worlds problems if everyone just does it their
way.

~~~
bakuninsbart
I think it really depends on context. In general, it is always a great idea to
learn, but we live in a society where there is a lot more to learn than time.

If a non-programmer asked me if he should learn C++, my answer would be "Only
if you really, really want to. Otherwise Python, Javascript or Rust is
probably a better idea".

If someone has a specific project in mind, C++ might be the answer, although
probably in a minority of cases.

If someone just wants to expand their mind, then sure, why not. But there
might be equally or more interesting things around, that's something that can
only be retrieved from context as well.

Learning is always good, but there are subjective, qualitative nuances to be
considered.

~~~
arman_ashrafian
"Python, Javascript, or Rust"

I feel like Rust does not belong in this list. Why would you introduce a non-
programmer to Rust?

------
buboard
There is no other language that will teach u e.g. templates. And the language
is still in heavy use. What is there to lose here?

~~~
ktpsns
Many popular languages have templates (generics): Java, for instance.

~~~
idnefju
I wouldn't compare it like that. Templates are more like meta-programming.
Templates can achieve what you can do with Java generics, but they can also do
a lot more.

~~~
ktpsns
I wouldn't learn C++ for the templates. Except you want to learn stuff by
getting your hands dirty. The same would be to learn C for trying out pointer
arithmetic and shooting into your own foots ;-)

------
melling
If you’re learning it just for the sake of learning it, I’d probably choose
something like Haskell. You’ll learn to think a little differently. Laziness,
pure functions, immutability, etc

If you’ve got a specific project or job in mind then sure.

~~~
quickthrower2
Haskell is great for this.

Common Lisp too for a very different perspective. Swap your powerful type
system for a powerful macro system. Then decide what you prefer!

And finally idiomatic Javascript (i.e. don’t use classes!). People have wrote
you don’t need static types if you have great tests, so I want to think about
that idea. I always keep an open mind.

------
Aperocky
You should, along with Java, Python, Ruby, Bash, JavaScript, Go.. The only
language I think that doesn't really have a place would _maybe_ PHP.

