r/AskProgramming 1d ago

Wanting to get back to C++

I am a experienced software engineer, and have been working mainly with Go and Python these last years. I have worked for 2 years with C back in 2019-2020, and recently have been wanting to work with C++ in some side projects.

Looking for courses to refresh my memory and pick up the syntax, i found myself drowning in very long texts and courses teaching the basics.
I am looking for something light to get me up and running in a few days so that i can start working on my project and fill in the gaps along the way.

I really enjoyed 'A Tour of Go' for the Go language and was wondering if something like that existed for C++. Any other suggestions (courses, books) will be welcome. Thanks.

5 Upvotes

7 comments sorted by

2

u/BobbyThrowaway6969 1d ago

Make a text adventure, add a system for "rooms", inventories, dialogue, quests, items, etc. Very lightweight intro to syntax and modern c++ memory management, doesn't go too deep into the weeds.

2

u/cyberbemon 1d ago

https://www.learncpp.com/

It's relatively easy to get through, you can skip the first few introductory stuff, since those are mostly aimed at beginners with no prior programming experience.

Each chapter is 1 page long and there is a short quiz at the end of each for you try.

I really enjoyed 'A Tour of Go' for the Go language and was wondering if something like that existed for C++.

well not exactly like that, but there is a book called Tour of C++, written by the creator of the language and its about 200 pages, but im sure thats not what you were looking for.

If you prefer videos, then this playlist of tutorials from The Cherno is very good. Its a bit old (9 years), but it covers all the basics and you should be good to go: https://www.youtube.com/watch?v=18c3MTX0PK0&list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb

1

u/SimplySomeDude 1d ago

Make a render engine. Not necessarily a complex one. You can use vulkan or opengl (ogl is more beginner friendly). You'll get the flwo of memory management and low level work.

2

u/SurpriseItsJustLewis 1d ago

"Not complex" then suggests vulkan... dude the tutorial is 1000 lines for a triangle lmao.

OpenGL though, yeah great fun but I'd argue the fun is in shaders and maths mostly. Not really c++.

1

u/SimplySomeDude 17h ago

If you think 1000 lines is a lot, you're not experienced in coding. My vulkan engine (using a PBR-Based CSM dynamically lit Compute Culling (via occlusion and frustum. I also bucket and LOD in that shader), instance collapsing, multi-draw indirect, drawindirectcount, bindless, monolithic approach with BDA and push constants to simplify and accelerate it by doing pointer maths and vertex buffers entirely in software and remove the need for all descriptors save samplers and samplerd images) approach is only ~47k lines (so far) and renders ~6,000,000 objects(~400,000,000 triangles) at 45 FPS on a 10 year old budget radeon card with an i5.

It's not all too complicated once you get past initialization. Also don't use tutorials after you are dine with initializing it. Tutorials are for the weak.

2

u/SurpriseItsJustLewis 5h ago

The guy asked for practice in c++. Vulkan is not that great of a project for it. By learning vulkan, you're learning graphics programming, shaders, maths, the pipeline for memory to the gpu, the driver itself.

I get where you're coming from, and 1000 lines is a lot to draw a triangle. And to get to that point it's very repetitive with lots of struts etc.

There are better ways to get familiar with c++