Diving into C++ as a Rust Developer
I recently decided to learn C++ alongside my Rust knowledge. My initial impression is that modern C++ (C++20/C++23) is much cleaner than the old legacy tutorials make it out to be.
What is interesting so far:
- References and Pointers: In Rust, the compiler forces me to think about lifetimes constantly. In C++, I have to enforce those exact same rules in my head.
- RAII: Resource Acquisition Is Initialization is basically how C++ handles cleaning up memory when variables go out of scope, which maps directly to Rust's
Droptrait.
I will be posting my progress here as I read Bjarne Stroustrup's A Tour of C++ and work on my custom heap allocator.
let code: i32 = 64;