C++ The Good The Bad and The Ugly

Yet another C++ opinion blogpost

In a perfect word every blog should have a post to criticize C++. I personally find myself in a hard situation. I am in my last year of undergraduate school in Applied Mathematics thus am looking for career opportunities and C++ is in demand. So I end up using it and not using it,in the sense that outside of a single file or maybe tiny project C++ you’ll find yourself less productive. It’s still hell to make a GET request in C++ (try it) an it still takes 1 hour to compile project that take less than 6 minutes in Golang (Bitcoin vs BTCd).

To me it’s not really about compile time I like going for a coffee or a walk, to me it’s about being productive and being able to help others with my code. I want my code to be easy to provide to others without having to solve OS-specific dependency problems or having to decide whether “headers only” is good or bad.

The thing is C++ is what Java was in 2000’s it’s an enterprise language. Altough it’s still in heavy use in the numerical departements (almost every Deep Learning or Numerical Library is written in C++) there’s less users of C++ when it comes to newish tech companies and I think this is related to the fact that C++ is counter-productive.

The Good

Starting with good things is always the right thing to do in my opinion. What’s good about C++ well, the following comes to mind :

The Ugly

The Bad

Well the bad thing is that there are more ways to solve the ugly problem. Should programming languages converge to one set of tooling ? I don’t think so but from a productivity point of view it’s far more fun to have a standard way of doing this than tons of ways to do this, technical debt is real. If you have to learn something new to use it and especially when it goes in the other direction of intuitive then you might be wasting your time.

The usual suspects of why C++ is bad are memory allocation… but even then you really don’t need to explicitly write new even the C++ hooded sect recommends against it.My personal opinion of why C++ is bad is it’s too hard to become productive.

At the end of the day, a programming language is just a tool to solve a problem but it’s often important to choose the right tool. We’re humans after all and we do make mistakes that may lead to catastrophic bugs, but when the language helps you defend against such issues then you’re more likely to become productive. In my case the tool I use should help me move forward not fight me and make me want to throw this out of the window and go herd like in the old days.

Takeaways

My personal key takeaways are these :

Last but not least, think for yourself