Skip navigation

C++ has been on its way out in professional software development for the last decade with the exception of its obvious applications like embedded devices – and even that niche I believe will be overtaken by managed languages within the next decade.  The rate at which C++ is being phased out of the industry has begun to increase exponentially in the last 5 years because at this stage, virtually no universities actually teach students C++ anymore, and for good reason.  Computer Science is hard enough without leaking pointers.  I guess I’m showing my age a bit when I admit that I did learn C++ in college, but I haven’t done virtually any in the industry.  It’s getting to the point where I can barely read it anymore.

The watershed moment for my company, which consists largely of old school C++/MFC/COM developers, came right around the time that 64 bit processors shipped.

Now it wasn’t bad enough that an assembly compiled for a Windows platform didn’t execute on Linux.  Now an assembly compiled for a 32 bit Windows platform didn’t execute in a 64 bit process space.  Really?!

Of course, this event has happened before, many times.  First 8 bit processors gave way to 16 bit processors and 16 bit processors gave way to 32 bit processors and every time, programmers had to go through the same painful transitions.

The difference is that this time, in 2002ish when the 32-to-64 bit transition began, we had a choice.  We could either go through this nonsense again and accept the fact that we’d have to ship 2 versions of our assemblies, or we could see the future and start developing managed code instead that is immune to this problem.

And we weren’t the only ones.  Managed code, and specifically the infrastructure and ecosystem that exists around them, are superior for other reasons not necessarily related to the functioning of the software, such as for example the fact that you can actually find people who know how to write code in the language you’re using – something that is getting harder and harder to do for C++.  The number of bugs – catastrophic bugs, mind you – that are generated by a mediocre C++ developer is exponentially higher than the number of bugs generated by a mediocre .NET developer.  For that reason alone, managed code is worth the investment.

Native code haunts me to this day.  I am currently involved in a project in which we need to isolate native code into a COM+ server application so we aren’t forced to run our .NET processes in a constrained 32 bit process because we are using native interop that is 32-bit only.  These days, 4gb of RAM isn’t enough.  If you can’t shove our managed server application onto huge hardware with huge memory pools because we can’t scale past 32 bits thanks to native code, you don’t buy our software.  And that’s obviously bad for us.

Fortunately, 64 bits are big enough that it’s unlikely we’ll see 128 bit computers any time soon except in specialty scenarios (e.g. GPUs), so it would be fair to say that biting the bullet and going with 64 bit native with the assumption that 32 bit hardware would be dead long before 128 bit hardware arrived would have been a valid choice, except for all the reasons above.  C++ is a giant pain in the ass and honestly after working with C#’s feature set, it would be like going from a Ferrari to a Vespa.  I would sooner switch jobs than work in C++.  I have to enjoy what I do, and deleting pointers is not something that I enjoy doing.

Advertisements

One Comment

  1. I haven’t read such a misinformed view of C++ since … I can’t remember. Leaky pointers… are you still programming C++ like its 1992 ??? MFC ???? What next ? A custom string class… A lot has changed since 1992, you should look into STL,boost,Qt etc… As Herb Sutter puts it, you should never have to manage memory manually in modern C++, but I guess you missed that memo.

    As for C++ vanishing, where are you living ??? Under a rock, I guess.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: