I recently found myself in the position of needing to refresh my skills in a programming language that I haven’t used in nearly a decade. Â That language is C++. Â I’ve been happily living in the world of managed languages for the last 10+ years. Â Going back and learning a systems language like that after all this time has really made me appreciate managed languages like Java and C#. Â There are so many things in the development cycle that you take for granted in managed languages. Â It’s been really refreshing diving into something so low level.
The reason for this foray into C++ is work. Â I’ve recently been getting involved with the server and client programming of the MMO my company has been working on. Â I’m excited to be venturing out of my comfort zone (tools, processes, enterprise software) and into something that feels somewhat akin to the wild west. Â There are a lot of similarities with enterprise server software, but there are a lot of new areas to explore.
Originally I just opened Visual Studio and started poking around in the cpp files, figuring that it wouldn’t be that big of a deal getting into it. Â It can’t be that different than the tools, can it? Â This worked fine for some of the basic aspects of the server, but that’s not where I needed to spend my time. Â I needed to dive into the guts of the thing, see what makes it tick. Â When I got deep down in there I started getting overwhelmed by all the templates, STL, multiple levels of indirection, custom data structures, non-standard memory allocators, etc. Â I took a step back, looked at my computer screen and decided it was time to get serious about this. Â I needed to get back to basics.
Our server software is designed to be run on a Linux machine, but we cross compile it for Windows. Â Most of the developers work on Windows machines and we rely on automated builds run after SVN check-ins and cmake project file generation to make our lives more tolerable. Â Personally though, I like to be as close to the hardware my software is going to be deployed on as I possibly can. Â Now it’s time to get involved again with my old friend, Linux. Â I installed vim, setup my config files the way I like them, built the ctags and cscope databases and fired everything up.
It’s still amazing to me how hard it can be to explore a large, pre-existing c++ code base. Â The navigation tools are very primitive. Â Finding references, usages, jumping between symbols and files and even class structures can be difficult and inconsistent in the tools available, especially when comparing against whats available with Java tools and Visual Studio plugins like ReSharper. Â But I’ve been sitting in my office for the last couple of weeks devouring all of the information I can get my hands on from the huge pile of books that I have sitting all around me and the web. Â I finally feel like I’m starting to get my head around this whole thing. Â Pieces of the puzzle are starting to fall into place and I’m feeling a lot more comfortable moving around and finding the information and resources that I need.
This whole experience has been really good for me so far, if a bit frustrating at times. Â It’s made me go back and look at a lot of fundamental things that I use on a daily basis but have forgotten the hows and whys of them over the years. Â Going back to basic algorithms, the structure and implementations of containers, fundamental design patterns and, last but not least, memory management. Â I can’t say that I’ve missed having to deal directly with memory management on that level, but oh well! Â It’s a whole new world out there and a fresh perspective on old topics and I’m excited to be able to apply my skills to this as well and hopefully it will give me some ideas for cool new ways I can approach some of the game data tasks we deal with in the tools. Â Anything that makes the process for the users better!