Why is C and C++ IDE tool support behind what's available for managed platforms?
If you have used any decent java or .net IDE you can see the abundance of features that they provide that either do not exist in c/c++ IDEs or exist in a much more limited form.
I am thinking about features like:
- Code Completion
- Syntax Errors (and compilation errors with no need to compile)
- Refactoring
- Debugging (the amount of infor开发者_如何学JAVAmation that the debugger can show you about objects)
- Code exploration and analysis (viewing type hierarchies, who calls this function etc...)
What is the main feature of managed languages that enables them to provide this (most would say) superior support in tooling?
C++ is an extremely difficult language to parse. For the parsers that do successfully process it (compilers), they are way too slow and not flexible enough to support IDE-style code support. Unlike in a compiler, in an IDE, the parser has to be very fast and be able to process syntactically incorrect code. Until now, no one's taken the time to do it because the people with skills required to do so are focused purely on actual compilers.
Visual Studio 2010 has a revamped C++ IntelliSense engine. It took them many, many years to get it done but its massively improved.
Languages like C and C++ make it harder to do completion and syntax correction because the syntaxes are more complicated than (say) Java. For example, the preprocessor makes things a lot harder.
Refactoring is harder because the C/C++'s weaker type systems make it harder to know if a refactoring would preserve the meaning of the original code.
Debugging is harder because C/C++'s weaker type systems mean that it is harder to know what the "real" types of runtime values actually are.
I recently laughed at the c/c++ coders still using vim, till they challenged me to find an IDE that cleanly handles conditional compiling in a large project and links to the right instance of a multiply-defined conditionally compiled method. None came upto the challenge.
Moral: Keep your design clean, vim is your IDE.
The difficulty of parsing C++ notwithstanding, I think your premise is overly broad and it's not necessarily an issue of managed vs. unmanaged.
Visual Studio, for example, has code completion, edit-and-continue (for 32-bit builds), syntax checking (as of the upcoming 2010 release), extensive debugging capabilities, and code exploration functionality for native C++ projects.
If you want open source and cross platform, the NetBeans C/C++ plugin has most, if not all, of what you desire in a C/C++ IDE.
IDEs are just crutches for programmers who don't know their craft. Get yourself a good text editor and learn to read compiler error messages.
精彩评论