A Year with C++
Photo by Oscar Nord on Unsplash.

A Year with C++

Background

I've always loved to tinker with software. From a young age, I would obsess over simple batch script tutorials, acting like I'm an international super-hacker. Even during middle school, I would play around with Python and always dip my toes into the vast world of programming. However, these bouts of learning never went anywhere. I would play around with basic programs for a few weeks and then drop what I was learning in pursuit of a different hobby.

However, last year's March was different. As I'm nearing graduation, I've had to think about and ask myself important questions: What do I want to be doing in 10 years? What impact do I want to leave on this world? Will red stay my favorite color? All of these questions lead me to programming. It's a curiosity I've had since I was young and the industry (from an outsider's point of view) looks fun and entertaining. So, I sat down and I forced myself to try to learn how to program.

I decided to ditch Python in favor of C++; I didn't ditch Python for any technical reasons, I dropped it because I heard that C++ was hard, and I assumed that if I could struggle through it, then other languages would be a breeze.

What I've Learned

I've learned a lot! With the internet at my fingertips and a copy of C++ Primer by my side, I felt ready to take on this beast. I started with the language-agnostic things, and slowly worked my way through the beginner items onto the more intermediate patch of things. Out of all of the intermediate topics, pointers and memory management were the hardest topics for me. It made sense at first, and then I was thoroughly confused, and then it finally clicked after metaphorically banging my head into a wall of text.

C++ has also (thankfully) forced me to view computers from a lower level too. From basic CPU optimizations to how OSs run programs, I've had to take a peek behind the curtain to try and learn some of the magic happening behind the scenes. I quickly learned that things that seemed simple were actually fairly involved. Even running a simple program involves a ton of legwork for an OS.

What I Like about C++

If I could describe C++ in a word, I would choose "flexible". Everything about C++ is flexible; from 3rd party tools to language features, it feels like there are a million different ways to approach a problem. It's akin to being handed a box of legos instead of a few premade sets; I have to figure out how to put everything together. This especially comes in handy when you need an extra level of control over your programs.

If I had to list my three favorite features specifically, I would choose RAII, smart pointers, and templates, but there are a ton of other features I love too.

What I Don't Like about C++

The "lego approach" is a double-edged sword. As Mr. Stroustrup put it, "C++ makes [shooting yourself in the foot] harder, but when you do it blows your whole leg off." The added complexity of C++ makes it easy to back yourself into a corner when you use features improperly. Think shoving objects in places where simple procedural code would work better or overengineering a function to show off your knowledge of template metaprogramming.

Another gripe I have with C++ is the rampant UB. I understand that UB is a helping hand for increasing performance, but I would love to live in a world where indexing an array out of bounds threw some type of error.

My last (albeit minor) complaint of C++ is the lack of a package manager. There are 3rd party tools, but I wish there was a standardized version.

Goals for the next year

By this time next March, I hope to improve my proficiency in general. I also hope to be able to leverage newer C++ features when applicable. These are vague goals, but at the same time, I'll take any improvement I can.

Final Thoughts

I write this article as both a time capsule and a discussion starter. It's important to be able to look back on life, and I hope to be able to read this article to reminisce about all the new things I've learned and experienced. I also hope to read a bit about other beginners' programming journey. We all run different, exciting races. See you next year!

To view or add a comment, sign in

Others also viewed

Explore content categories