Live data from Hacker News

Ask HN: Should I learn C++ in 2021?

news.ycombinator.com

21–30 of 44 posts

Re: Ask HN: Should I learn C++ in 2021?

#21
post #9

I'm actually on the same train right now, are there any good learning resources to get into modern C++(CPP17/20)?

If you are starting with C++ right now, I'd suggest Scott Meyer's More Effective C++ (and his other books) and the books by Herb Sutter. Don't worry too much about C++ 17/20 unless you are working for a company that use the newer standards. A lot of companies still stick to C++ 11.

Re: Ask HN: Should I learn C++ in 2021?

#22
I've recently decided to learn c++. I've used Java for over a decade and have had felt little reason to learn c++ until now.

What changed? There is code I need to do maintain in c++. If I don't do it, it might not happen.

Sounds like you are in a similar situation.

It feels weird learning a language competing with a HN darling (Rust), but I have the need.

Re: Ask HN: Should I learn C++ in 2021?

#23
I learned C++ at the start of my software career. I am glad I did; but I am also glad I never had to write it commercially.

Learning C++ makes learning other languages easier. It's C++ that made me grok the difference between stack and heap allocations; it taught me about moving semantics, dynamic arrays, reference counting garbage collection, data structure alignments, dynamic/static linking, segmentation faults and many more things.

The above things made me understand better how other programming languages work under the hood.

At times I find C++ code that is of intrinsic interest to me. Bitcoin, for example, was authored in C++. However I dread writing C++ because I find it very complex and it has outdated coding environments. Thus I am very happy I don't have to write it.

Re: Ask HN: Should I learn C++ in 2021?

#25

To be honest if you know C#, Java or ObjectiveC you already know the core 90% of C++. The main thing left is understanding pointers vs references vs stack vs heap allocation (egthe instance.x vs instance->x difference) because C++ has those explicitly different pointer vs non-pointer intances of "instance", while C# or Java hide that difference (so if you know C# you can slightly think of it as struct vs class in C#…

> To be honest if you know C#, Java or ObjectiveC you already know the core 90% of C++.

If we change 90% to about 20% then this becomes a true statement. Yes, you can get toy code to compile and apparently work by pretending C++ is Java with some low level stuff that can be ignored, but that's nowhere near proficiency. The language is full of seemingly obvious concepts like static initializers that function unlike what you'd expect from working with C#, Java, or even C.

> IMO C++ got some very bad rep for no reason at all: it got mythologized into a "very difficult arcane language that people makes meme about".

It got that reputation on account of having an 1853 page standard that even members of the committee admit no one of them fully understands.

> C++ just makes this even more explicity(sic) since YOU can decide if a class is a copy-by-value or a reference on the fly

And this is why it's such a kitchen sink standard. The C++ community is so large and has so many stake-holders relying on diverse problem domains and programming paradigms that the standard has to permit the developer much greater control than higher level languages like Java.

In closing, to speak to the original poster's question, becoming proficient in C++ is in no way a career limiting move, and will definitely open up some opportunities. However, becoming an expert is a very deep rabbit hole to go down. Even a level of proficiency that will allow you to work on a large project will take some serious intellectual commitment. One way this is apparent is how the C++ community has its own large and distinct conceptual lexicon that for the most part has not worked its way into the general programming community. I personally found working on large C++ projects intellectually gratifying, so I would recommend helping out on the project for a year or so to start. That's enough time to get a very basic understanding of the language and see if it's something you really want to become an expert at. And even if you don't, you'll learn a lot.

Re: Ask HN: Should I learn C++ in 2021?

#26
Ha! C++ is not going away, probably not ever but certainly not any time in our lifetimes.

There is a LOT of code in C++ out there. I write in it every day. There are a lot of open source project written in C++.

C++ isn't even that hard to learn, at least to a basic level of fluency, but there is a lot to know to be good at it.

Re: Ask HN: Should I learn C++ in 2021?

#27

C++ is vast and diverse, but if you have interest in functional programming you may actually end up enjoying C++, since thanks to it's value types and it's imperfect albeit powerful type system (it's a bit like a compile-time dynamic typing, allowing interesting translation of Lispy patterns). I'm actually on a mission to build a solid ecosystem of functional and value-oriented tools for C++ and interactive software,…

What's funny is the move toward value types as trendy right now, meanwhile 10 years ago I was writing copy constructors in C++ to control the value semantics of values.

Yes, I agree! However, I think move semantics and standardization of RVO/Copy Elission have been crucial to make value-semantics work at scale.

Re: Ask HN: Should I learn C++ in 2021?

#29

>- I’m hesitant towards C++ as it seems an ancient programming language and I don’t know for how long it will be around. Twenty years ago, I learned Delphi rather than C++, because I thought C++ is an ancient language, and Delphi was modern. Now Delphi is basically dead, and C++ is still around.

And I use both!

C++ has new versions every three years, and Delphi is still widely used, just not well-known in the English-speaking dev work.

Re: Ask HN: Should I learn C++ in 2021?

#30

Just a few things you should consider: - C++ is highly complex. The poster lower down claiming you already know 90% if you know C#/ObjC is simply wrong. The learning curve is steep. - Your stated experience sounds a bit like "App developer" and while that gives you plenty of experience, the projects tend to be a bit smallish. C++ projects on the other hand can be huge and extremely complex. Think 4 hrs for a clean bu…

> C++ projects on the other hand can be huge and extremely complex. Think 4 hrs for a clean build, with 10+ people working on the same code base.

I'm not sure what this has to do with the language itself or why you think other languages don't also have large projects written in them.

Post reply on HN