The above link points to an excellent talk by Herb Sutter (Microsoft Research) on the real advantages of C and C++ (and Objective C! – all known as “native” languages) in what concerns performance per $, per Watt, per transistor and per cycle.
And it’s not just on mobile platforms – he shows that “The world is built on… C/C++”: servers, desktops, mobile platforms and large scale data centers (talk about C++ being an eco-friendly language! :-)).
So, I’m glad to see the start of an age of the “return of the King”, which will not only last for the next decade, but will perdure even more when Moore’s law finally gets to an end.
Managed languages (i.e. Java, C#, etc) still have their place where “productivity” is key (which does not seem so much the priority nowadays – not even in the foreseeable future, so they say – and in case you still believe in the myth that those managed languages are as speedy as C/C++, have a look at this paper), but I’m glad that we finally got enough of it (it took almost 10 years of waste and stalling!!), where they were used as a hammer to solve any problem, which had first to be turned into something resembling a nail (just look at what happened to the Windows Vista fiasco and its C#/.Net managed code base… but not all was bad in Vista – a good lesson was learned… the hard way, but those are the lessons that usually become persistent for generations to come… hopefully ;-)).
we are on the verge of finally getting we already have the brand new C++ standard, C++11, which includes quite some exciting new features for C++, making it an even more exciting language to program with. Add to that the new impressive developments in the LLVM/Clang toolchain, and you start seeing the killer combos we are getting nowadays for native development.
So, these are exciting times for C/C++/ObjC folks, and computing in general. Glad to see Apple, Google and Microsoft (among others) really betting all their game on these native languages and investing a lot on taking the best out of them.
I’ve always believed in the power of C/C++/ObjC, even when a lot of people became fully fascinated with all those fancy new managed languages and looked at the folks still coding in native world as a bunch of old weirdos stuck into some “obsolete” and “uncool” language universe.
Well, I started my programming career back in 1996 coding in assembly for DSP chips (TI C3x, C6x series and AD Shark – already floating point chips, which later on started having some basic C support). So my starting point may be a bit different from most of these younger folks. And maybe that’s why I anticipated that the days where efficiency would eventually become king once again would not be far – it was just a matter of “when”, instead of “if”. Glad to see that the “when” is finally “here”. 🙂
Threads in C++ has been a long topic of pain and moaning, mainly because the C++ standard does not provide (until recently, at least) a platform independent and efficient support for threads built-in the language (POSIX pthreads lib is not C++; being a C library, it requires some careful use when dealing with multithreaded C++ objects which usually include constructors and destructors).
Boost is a set of free peer-reviewed portable C++ libraries (more info here and here) that implements for some time now the Boost.Threads library, which is a highly optimized (and growingly flexible) platform independent thread library (i.e. should work in Linux, OSX, Windows, etc), and that seems to be the candidate best positioned to be included into the next C++ standard revision (i.e. C++0x). When that happens, the need for 3rd party libs in C++ for platform independent thread support will be finally over.
You can learn a bit more about how Boost.Threads will handle threads in the following articles:
Really nice interview with two senior MS “native” C++ programers, where they talk about the “renaissance” of C++.
An Interview with C++ Creator Bjarne Stroustrup – CodeGuru, where he talks about the upcoming new standard version of C++ (0x).
Strousstrup C++ page is also a must visit.
And one of his books a must read for someone starting with the language.
This is really cool news! The newest Anrdoid NDK (revsion 5) now allows to natively program full Android apps in C/C++!