Intellisense in VC++
Reader zakimirza asks:
Just needed to ask a simple thing. Why is there such a huge Intellisense support for C# in VS 2005 and not for C++ in the same IDE. intellisense is just a helper tool that i guess is a part of VS 2005 and should be applicable to every programming/scripting editor in the studio as is. no? or am i missing something here that intellisense in C++ mode is a different story in intellisense in C# mode or VB mode. (coudnt find a "ask me" or "contact me" thingie on the blog so posting here)
Good question. Let me preface by saying that you're totally right: Intellisense is a very valuable tool for developers, and it should be every bit as good for the C++ language as it is for the C# language. The problem is, of course, that Intellisense support for C++ really isn't as good as it is for C# or VB.NET. This begs the questions: 1. why is this the case, and 2. if we know it's a problem, what are we doing about it?
Why is this the case?
Part of the answer here is that C++ is a much more complex language, so it's a tougher problem in general. C++'s preprocessor, lack of a language-based notion of modules, and general funky lookup rules all play various supporting roles in this complexity. However, to blame it all on language complexity wouldn't be fair or accurate because, despite the complexity of the language, we have some very good engineers on the team that understand this problem and are perfectly capable of solving it.
The more onerous problem is that the infrastructure we have in place today is far from optimal for solving this problem. Our C++ compiler front-end is actually really good at making sense of even the hairiest C++ code and even compiling it to a binary if the code is valid. However, our C++ compiler front-end is a very old piece of code (portions of it are well over 20 years old!). It was designed in an era when compilers needed to use as little memory as possible and any thought of a compiler interacting with an editor to provide something like Intellisense wasn't even yet the stuff of science fiction. Those original design constraints have created a situation today where providing interactive, incremental information to the IDE is a difficult engineering challenge.
Fine, then what are you doing about it?
Today the VC++ team is investing a significant amount of resources in a building a new compiler front-end infrastructure that is designed from the ground up to work hand-in-hand with the IDE and tools. This is an investment for which it will actually take several years to our realize full return, so you won't begin to see the fruits of this effort until after the Orcas release of Visual Studio. Meanwhile, we'll continue devoting some resources to tweaking the current infrastructure to get the most out of it.