I don’t normally enjoy writing controversial posts about why new technologies are bad; I LOVE it! So here we go! We’re starting a new large-scale first-party project over at The Mad Botter (sorry no details today) that requires a significant level of low-level engineering work on Linux. Initially, we considered using some sort of solution like CYthon to compile Python to native code, but we ultimately decided against it. That led us to look at compiled languages. Spoiler alert! We went with C++. Before you flip your lid, here’s why.
Multiple Platforms / Native Code: Sure, I’ve spent a lot of energy trying to find cross-platform solutions that work well and the solution I came to is that are always compromises that aren’t the ones that I care to make; with that said, there’s a lot of good reasons to go with more traditionally write once run everywhere solutions. C++ allows us to have shared code (with some platform specific modifications to be sure) compiled for each of our desired platforms while also having specific modules to take advantage platform specific features. A key point here is that by platforms we are not just talking about operating systems but also processor architectures; I’m looking at you Apple Silicon
Modern C++: Over the last few releases C++ has seen some changes that aim to sand down some of the rougher edges of the language. Collections and memory management have been getting a lot of good attention in the last few releases. In particular, we found smart pointers to be particularly attractive; dare I say they are downright familiar at least on their face to this Objective-C die-hard fan; yes, I am still pining for my square brackets!
Team Familiarity: OK, so this is a bit of a weak one in terms of technical reasons, but it’s actually pretty important. Compared to the competing low-level languages (Go and Rust), all of the team has at least some experience in C++ with some of us having quite a bit of experience in the language. While it shouldn’t drive all technical decisions, experience is a factor.
Before landing on C++ we ended up with three languages in the running at the end of the process: C++, C# (.Net) and Rust. C# was eliminated first for a few reasons including some extra hoops to work in it on Linux and macOS; having said that, .Net is much easier to develop in on Linux and macOS now than it ever was before. Rust almost took the cup and Coder Radio listeners will know I am a Rust fan, but ultimately the existing C++ experience on the team carried the day and like a vinyl record collection at a hipster swap-meet, it’s golden. Let me know what you think on Twitter and if you’re in need of Python, IOT or mobile development, reach out! A