Learning C++ and Database Systems in Parallel
I just started CMU's Introduction to Database Systems course, and I'm learning C++ as I go. No preparation phase, no "get comfortable with the language first"—just straight into implementing data structures while figuring out what std::unique_ptr actually does.
Is this a good idea? I'm not sure yet.
I have some experience with Go and NodeJS, plus a bit of C from an old ALX program, so I figured: how different could C++ be? The answer is very different, but in ways I didn't expect. It's not just the syntax, though template error messages are genuinely incomprehensible, it's that C++ makes you think about problems differently.
When you're coming from Go, you don't really think about object lifetimes. The garbage collector handles that. But the first time you implement a hash table where objects can outlive the scope that created them, manual memory management stops being an academic concern. You start to understand why RAII exists, not because someone told you it was important, but because your program keeps crashing without it.
The weird thing is that learning C++ in this context feels more natural than learning it in isolation would. Database systems care deeply about things that high-level languages abstract away: memory layout, cache efficiency, precise control over when allocations happen. C++'s complexity starts to feel justified when you're writing code where performance actually matters.
Maybe this is backwards. Maybe I should have learned C++ properly first, then applied it to databases. But there's something to be said for learning tools in the context where you'll actually use them. The language features make more sense when you have real problems to solve.
Right now I'm slower than I'd like—half my time goes to understanding the assignment, half to figuring out how to express the solution in C++. But I think I'm getting a more complete picture of both subjects than I would learning them separately.
Comments (1)
Join the conversation