Where to start learning modern C++
-
Hi Devs,
I used to program in C and a bit more in C++ some 20 years ago. Some of the basics are there but my experience ended in object-oriented coding. I'm asking for your recommendations on literature/courses/tutorials on how to restart my coding skills in order to make some firmware modifications for the Duet 3 family. Any advice will be appreciated.
-
This may sound like an odd suggestion, but I'd recommend you start by purchasing a small microprocessor like a raspberry pi pico or an an ESP32 (I like the pico better myself) and start your C refresh programming for that. These things are cheap, cheap cheap. They give you access and experience dealing with the hardware more directly than playing with programming for windows.
I'd set up a development environment using microsoft's VScode. It's free and has a lot of good features.
I speak from near-experience. I'm a mechanical engineer and learned to code way back when Fortran was the top dog and punch cards were turned in for the professor to review your work. I eventually learned python and when I decided I should see what the big deal was with C, I took the microprocessor path. I never followed through after someone suggested I needed to write my own file system to write to an SD card (in hindsight, probably not true). Then I got into programming micros with micropython. But if/when I decide to take a crack at header files, make files, compiling and all that, I'll definitely do it by programming for a small microprocessor.
-
@DDD bear in mind that C++ for embedded processors is not the same as C++ for desktop machines and servers. In particular, use of dynamic memory is minimised, so most of the STL classes are avoided.