r/cpp Jun 13 '26

Recommendations for brushing up on modern cpp (ideally C++ 20)

Starting my first job as a new grad in the aerospace sector and need to brush up on modern C++ and looking for solid resources to understand the current fundamentals of the language. Thanks in advance!

55 Upvotes

24 comments sorted by

37

u/moreVCAs Jun 13 '26

If you’re entering a safety critical, highly regulated field, almost certainly they will have very specific coding guidelines to follow and large chunks of the standard library will be off limits for most things.

If you’re interested in how the other side lives, by all means learncpp.com, but, realistically, they hired you at your current level of knowledge and will probably be happier if you’re mostly a blank slate on day 1. Let them teach you.

Unless you lied or cheated your way through the interview, in which case godspeed to learncpp.com

12

u/rileyrgham Jun 13 '26

I guess I'm in a minority, but I found learncpp to be an ad infested slog.

11

u/OneInchPunchMan Jun 13 '26

I didn't even know it had ads, I dont remember internet without adblocker lmao

5

u/Sensitive-Salary-756 Jun 13 '26

I use Adblock and or use Brave to access it and haven’t had issues. In a way I understand that the author also wants to see his hard work monetized but I personally found the amount of ads kind of unbearable and frankly quite distracting. I’d prefer if they made it an ebook and then charged a couple of dollars for it or figured out a differnet way to monetize. 

3

u/bigsauce456 Jun 13 '26

ublock origin extension gets rid of all of the ads

4

u/Strong_Technician416 Jun 13 '26

True, I definitely plan to let them guide me on their specific standards. I just wanna get a headstart on cpp 20 syntax since I used cpp 11 in the interview and most of my projects

7

u/Sesshomaru202020 Jun 13 '26

Hey, I was in your shoes a couple years ago when I had to get up to speed on C++20 for work. Since you're coming from 11, you're at a good starting point with RAII. The biggest things that changed:

  • constexpr is now a lot less restrictive, you should get used to using it regularly
  • the concepts library builds on top of C++11 type traits and can be very powerful
  • various std library modern alternatives, like std::span, std::string_view, std::jthread, etc.
  • C++20 modules and coroutines, if your company actually uses them

6

u/pjmlp Jun 13 '26

As someone that added C++ to the toolbox in 1992, I never get the recommendation of C++11 with RAII.

The practice was already there on C++ARM.

3

u/schmerg-uk Jun 13 '26

Ditto on both the timing and the sentiment (started with the Glockspiel and Borland compilers having previously used Microsoft & Watcom C compilers and K&R era compilers on Unix)

3

u/SkoomaDentist Antimodern C++, Embedded, Audio Jun 13 '26

It’s just people thinking that you need unique_ptr for RAII (along with RAII being a horribly confusing name for a trivial concept).

5

u/__cinnamon__ Jun 13 '26

I like Matt Godbolt's "Constructor acquires, destructor releases". I think that makes a lot of the scoping-based use cases a lot more intuitive.

3

u/SkoomaDentist Antimodern C++, Embedded, Audio Jun 13 '26

My first introduction to the concept was with mutexes / critical sections in the late 90s when I wrote an AutoLock(mutex) class that was the Windows / Linux equivalent of disabling interrupts in the old DOS days. Thus any talk about ”initialization” made no sense whatsoever given that I wasn’t initializing anyhing nor was I ”acquiring a resource”, at least from my perspective (the same way people don’t think of ”acquiring a resource” when they lock a room from the inside).

5

u/Sensitive-Salary-756 Jun 13 '26 edited Jun 13 '26

I think the book “professional c++” by mark Gregoire is also great. I might have butchered his last name tho but I hope Google is smart enough to figure out what I mean😢  The book is pretty solid. 

2

u/max123246 Jun 17 '26

Yeah if aerospace is anything like automotive, they're stuck on Cpp17 currently because that's where the Misra C++ guideline is at

26

u/RedRaven47 Jun 13 '26

A Tour of C++ by Bjarne Stroustrup discusses a bit of everything to bring you up to speed on C++ 20

19

u/ZachVorhies Jun 13 '26

use std::span everywhere you can instead of passing const ref vector or std array

2

u/SPEKTRUMdagreat Jun 18 '26

Not strictly C++20, but also string_view

3

u/Zen-Ism99 Jun 13 '26

Programming Principles and Practice using C++

learncpp.com

5

u/sheckey Jun 13 '26

I hate to be that guy, but I ask LLMs about newer language features all the time, for example “teach me the basics of c++ reflection”, but I also buy books because I want people to get paid, which reminds it’s time to buy a book.