What to Learn? Cpp vs. Go
I have less than 10 yrs of exp and primarily focused on web, JS(node, react) and kotlin.
Now I want to try my hand in building low level stuff like parsers, small KV stores and some network programming.
Go seems to be more approachable for my goals but I have the FOMO of not learning to manage memory. I want to be able to work on performance critical stuff later.
I used some Cpp in college and I went through some tutorials (learn go with tests) in GO. I like them both.
Which language do you think I should go deeper in.
8 comments
[ 69.8 ms ] story [ 302 ms ] threadC++ is a bit of a mess due to its long, personality warping, traumatic history. There are many awkward parts to it due to fundamental designs that have since been discovered to be bad (although we only know that through hindsight). So you have things bolted on like smart pointers, which give you reference counted memory management (and that really is the recommended way now, because the old way of purely manual memory management was a disaster).
Rust is an attempt to give the power of C++ without the mess. It's also a lot harder to grok from the start because they front-load you with a lot of required knowledge before you're able to do even the simplest of things.
If you have the ambition, I'd suggest diving into rust. The concepts you learn in there will cross over into many other languages, and you'll have a very strong foundation in ownership, transitional dependencies, and temporality in general (which you can get away with not knowing in most languages, but really should be aware of if you want to avoid some nasty bugs creeping in).
It supports cross-compilation to a wide range of targets and supports C & C++ as well.
Once you’ve cut your teeth with a few projects, I’d recommend Rust first, then C++. I built good habits fighting with the borrow checker that improved the C++ I wrote out of the gate.
That's not actually "low level"; you can pretty well do all of this using JS or TS. Go is very well suited for these kind of topics, and you can master it within a year. I don't see a necessity or clear advantage to learn C++ for these kinds of topics (mastering C++ takes 3 to 5 years).
> I have the FOMO of not learning to manage memory
There is no reason for this. It would be different if you would like to develop resource constrained embedded systems (those with less than a MB of RAM).