The next version of Visual Studio, code-named Whidbey, is promising developers a lot of new features. What's it mean to C++ programmers?
"C++ has been a power programming language since it was born," says Ami Vora, Microsoft's program manager for the Visual C++ IDE in Whidbey. "Use its power for good and not for evil!"
Developers who choose C++ for a project are looking for more than Visual Basic's convenience or C#'s intimate relationship with .NET. Often, these developers are looking for performance, the ability to control very specific functions, and raw programmer productivity. Certainly, you can fine-tune an application in C++ better than in other languages.
ADVERTISEMENT
Yet, C++ doesn't get quite as much of the buzz as it once did. Some relegate it to the "legacy" category—as if that means something dusty, abandoned in the attic, rather than "we have a whole lot of it, and we know how to use it confidently, so we don't have to re-invent the wheel." With Microsoft giving so much attention to other, newer languages, some developers have worried if C++ will be left behind.
Not hardly.
In the last iteration of Visual C++, Vora admits, Microsoft misread some issues in regard to the use of managed extensions." Though managed extensions were a great proof of concept, they didn't always fulfill the needs of C++ developers," she says. They've learned their lessons: according to Vora, the new version that will ship with Whidbey will have better language design (it'll look like C++ with .NET functionality) in a clean, pleasant environment. Plus, you can take advantage of both all the C++ code you've ever writen and the .NET framework.
Let's get specific, with a brief overview of its improvements.
The new C++ will let developers take full advantage of the CLR, including garbage collection, finalizers, reference and value types, and mapping C++ and .NET fundamental types to one another. Templates and generics are both supported, and you'll have a choice
of compile- or runtime binding. C++ will support deterministic cleanup, so you know exactly when something is destroyed. You'll also be able to use the STL.NET library for secure library
functions.
You'll also see better interoperability, the company promises. In Whidbey, C++ will support everything the CLR supports. With a compiler switch turned on, you'll get errors if your library will not work with that of another language.
Optimization is a topic close to many C++ programmers' hearts. One new feature to look for is profile guided optimization. If you have sufficient user data and an understanding of how the program will be used, you can show the system, "This is how my application will be run," making clear which actions are most likely. (For example, most transactions do go through without error, so that's where you want the compiler to do most of its optimization
for both speed and value.) Your application is probed to collect data with a histogram of values and "hot-cold path" information. The new C++ will do (or do more) switch expansion, inlining decisions, and virtual call speculation. MSIL will also be optimized "so the back end will run even faster," explains Vora.
Naturally, C++ will cuddle up much closer with .NET. By recompiling /clr, says Vora, a developer can take advantage of all the functionality built into .NET. "That means he can just use the multitude of classes/functions provided (which can do a lot of his job for him) rather than writing all that code himself. This can be, as you can imagine, a major time-saver," she says.
What's this mean in regard to standards? Microsoft is working with ECMA to create a standard for the language C++/CLI. When TG5 has completed this specification, it will be submitted to the Ecma General Assembly. Herb Sutter, convener of the ISO C++ committee, is on the Microsoft team; his participation (and established reputation among C++ developers) bodes well for the community.
What about legacy APIs and frameworks, such as MFC and Win API? "We don't anticipate not supporting things like that in the foreseeable future," says Vora. "We still have a team actively working on libraries such as MFC. However, most of MS's brain sweat is going into making MFC interop better with .NET and letting you host MFC in a .NET application."
A Cooler User Experience
Plenty of C++ programmers expect their compiler to do the heavy lifting, and they don't expect to have to know what happens under the hood. (You can easily own a sports car because you want to go fast without any desire to tinker with the engine.) As a result, the user experience—the development environment and its tools—can often feel like the most important element. Whidbey is promising plenty of IDE improvements for C++ programmers. Among them are better IntelliSense (it understands templates and namespaces, for instance), Unicode support, and XML comment support (which C# already has). Browsing capabilities include live references, call graphs, inheritance browsing, and class view filtering.
A lot of attention has been invested in improving how C++ works with large development teams, according to Vora. There are custom build rules, better IntelliSense performance on large projects, and project property sheets.
The goal of all this, says Vora, is to enable developers to make the best use of their time.
That's just a taste. If you want more specific information on what's coming in Whidbey for C++ developers, refer to these useful resources: