Live data from Hacker News

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

news.ycombinator.com

11–20 of 44 posts

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

#12

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#…

This guy is giving you the best advice. They are considering the fact that you already know Objective-C.

One thing: I use Objective-C and I really like it. I don’t feel the same way about C++. If you feel the same way, honor the feeling. Still, I think you can learn C++ and have it be useful for you.

My best wishes!

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

#13
>- 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.

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

#15

>- 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.

Lindy Effect:

> The Lindy effect is a theorized phenomenon by which the future life expectancy of some non-perishable things like a technology or an idea is proportional to their current age, so that every additional period of survival implies a longer remaining life expectancy

Example:

> If a book has been in print for forty years, I can expect it to be in print for another forty years. But, and that is the main difference, if it survives another decade, then it will be expected to be in print another fifty years. This, simply, as a rule, tells you why things that have been around for a long time are not "aging" like persons, but "aging" in reverse. Every year that passes without extinction doubles the additional life expectancy. This is an indicator of some robustness. The robustness of an item is proportional to its life!

https://en.wikipedia.org/wiki/Lindy_effect

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

#16

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.

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

#17
I think it's always a good idea to learn as many different paradigms as possible. It also really depends on what direction you want to take your career/what the C++ team at your company is working on. C++ will be king for high performance, real-time compute for a long, long time. I work for a VR company making a VR-specific game engine, and C++ is pretty much the only game in town for extremely high performance, real-time graphics. So if you're interested in taking your career in the direction of high-performance, real-time systems then C++ is a great language to learn.

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

#18
TL/DR: The answer depends on what you want to do. If you want to sell ads in google or facebook, you’re right to be hesitant. If you want to build Windows kernel in Microsoft or VFX in DreamWorks, I think you do need C++ even in the long run (at least couple decades).

C++ and similar unsafe languages have lost majority of the markets they once had. When I started my career in 2000, it was used for pretty much everything, people wrote C or C++ for desktop, web, mobile (PalmOS, later Windows CE), embedded (was mostly bare metal back then).

Over these 2 decades, it’s mostly gone from desktop (initially replaced by Java and C#, and now being replaced by JavaScript and TypeScript), gone from web servers (Java, then Ruby, then JavaScript/TypeScript), gone from mobile (Obj-C in iOS and Java in Android), and I think being slowly replaced even for embedded, I personally shipped embedded Linux stuff based on .NET Core.

Whenever you don’t care about performance too much, and have enough RAM — higher level memory safe languages are strictly better, IMO.

Still, there’re large areas when it’s unlikely to be replaced any time soon. Game engines are written in C++. Many low-level performance critical things like database engines are written in C or C++. C++ is all over CAD/CAM/CAE, 3D modeling and animations, VFX, everything related to multimedia (video streaming, processing, editing). And even some embedded: since you’re southern Germany, there’s probably a lot of work in automotive sector.

I think C++ is here to stay in most of these areas. When you have working set measured in gigabytes and want your software to be fast, the “have enough RAM” requirement of GC runtimes is often a showstopper. Large RAM requirement is expensive for code running on servers, and shrinks potential user base for code running on clients. There’re other things too: tooling, library ecosystem, performance in the broad sense.

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

#19
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 build, with 10+ people working on the same code base. You should consider if such a change is for you. - Then again, the salaries you can draw as C++ developer reflect all that, especially the fact that C++ is not an easy language to pick up. - Since you claim to be from Southern Germany: the automotive industry is particularly strong in that region. And not only in Stuttgart or Munich but also in e.g. Ulm. And they do most, if not all, their stuff in C++. - C++ is going to stay. Software development for automotive is done in C/C++ as the MISRA standard more or less mandates it. And I do not know of any effort to change that, even by newer players in the field. So: don't worry. Learning C++ to a sufficiently advanced level will be a very good career investment, even in the long term. - It is difficult to "vet" language in terms of the future they have. But as a rule of thumb you can say: the larger / more complex the code base, the longer the language will be around. C++ has a huge and complex code base, and companies tend to be conservative with such "investments". Shipyards still use Fortran, banks still use COBOL. Perl is still actively used in web development, despite Ruby on Rails. - Finally: perhaps you are looking at the whole situation from the wrong angle, i.e. career advancement / employer loyalty. Why not instead ask yourself: what projects do I want to work on, and in what kind of industry? Then find out which language is pervasive through that domain and learn that. After all: C++ is modern compared to C. And there is still plenty of embedded development going on in C.

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

#20
I think another very important question to ask is "What version of C++ will you be using?" Is your companies codebase stuck on a pre 2011 version of C++ for some archaic reason? If so, I would be less inclined to touch that codebase.

Or is the codebase using a relatively modern standard (such as C++17 or C++20?)

Does the team track new versions of C++ upgrade every 3 years so your not left behind?

Remember if your not upgrading, it means you and your team is not able to take advantage of the latest C++ features. For example C++ 20 brought lots of goodies such as Modules, CoRoutines, Concepts and a new Ranges library.

Post reply on HN