Hail the return of native code and the resurgence of C++

Interpreted languages and virtual machines are all well and good, but a new version of C++ signals renewed interest in old-fashioned native binaries

Page 2 of 2

Oddly enough, these moves put Google in harmony with its rivals in Redmond. As the world's largest desktop software vendor, Microsoft has always been friendlier toward C++ than many companies. In recent years, however, native C/C++ developers have felt somewhat marginalized as Microsoft directed most of its energy toward C#, its managed-code C derivative for the .Net platform.

But that appears to be changing. Visual Studio 2010 already supports most of the features of C++11. In July, Microsoft launched a new video series on its Channel 9 developer website called "Going Native," dedicated to native-code development with a particular emphasis on C++. Meanwhile, astute observers have noticed a distinct lack of .Net-related hype leading up to Microsoft's Build conference (formerly the Professional Developers Conference, or PDC) in September.

The natives are restless
Those of us who learned to program before the Java era will naturally appreciate a renewed interest in native code. Traditional software development methods have a long and storied history, and sometimes a well-optimized native binary is still the best way to wring the maximum possible performance out of a CPU.

That said, native code has its drawbacks. First among them are the security issues I mentioned earlier. Because languages like C and C++ allow developers to get closer to the bare hardware than they can with managed languages such as C# and Java, there are a lot more concerns to weigh, and inexperienced programmers can do a lot more damage.

Portability is another concern. For Windows developers living in a Wintel world, writing code that could compile on multiple processor architectures was never much of a problem, even in the old days. On the Unix side of the fence, however, it was a different story.

Now Google's NaCl environment has reintroduced some of the same problems. Web developers are accustomed to their applications working in any reasonably standards-compliant browser, but NaCl modules are tied to specific processor architectures. To get the same module to run on x86, x64, and ARM processors, you have to compile three separate versions and host all three on the Web server. That will take some getting used to for developers raised on PHP and Perl.

But the most important thing to remember is to always choose the right tool for the job. No one wants to go back to the bad old days of wrangling text data for the Web using CGI scripts written in C. On the other hand, shoehorning every application into the same interpreted language or managed code environment, irrespective of the task at hand, isn't the right way to go, either.

Modern computers are incredibly sophisticated, versatile, and powerful. To make the most of them, developers should have access to the broadest range of tools possible. The resurgence of native code is a welcome step in the right direction.

This article, "Hail the return of native code and the resurgence of C++," originally appeared at InfoWorld.com. Read more of Neil McAllister's Fatal Exception blog and follow the latest news in programming at InfoWorld.com. For the latest business technology news, follow InfoWorld.com on Twitter.

| 1 2 Page 2
From CIO: 8 Free Online Courses to Grow Your Tech Skills
View Comments
Join the discussion
Be the first to comment on this article. Our Commenting Policies