I saw a friend running Resharper for C#, and was impressed with a few specific features. Does anyone know of some good similar productivity tools for C++?
In particular, the ability to mark a block of code and split it out to a new function, taking all relevant local variables and parameters along with it. This is something that can be very time consuming, but is essentially a mechanical and logical process.
Would also be nice to have an Intellisense/autocomplete/go-to-definition that actually works.
Visual C++ HAS an intellisense/autocomplete/go-to-definition that actually WORKS for programs written in C++.
Probably you refer to C++/CLI for which, AFAIK, there are some missing intellisense features, prior to VS 2012.
Just to note: C++ and C++/CLI are pretty different programming languages.
And about Resharper and similar tools.
IMO, making from starting a good design, it's better than blindly write tons of code and after that use whatever tools to arrange it.
At least, that's the philosophy in C++.
Just to complete.
IMO, making refactoring as well as intellisense for a managed language like C# is much easier than making the same for C++.
That because for C++ it should, for example, parse tens/hundreds of header files containing tons of preprocessor definitions.
@ovidiucucu: Well, I think starting from a good design is a good practice in any language - especially C#. However, in an iterative process, as the code and requirements potentially evolve, a need for refactoring might arise anyway. And also, sometimes, if you're working on an implementation detail which is somewhat more specific, and finer grained than the design itself is, you might start out writing it one way, and then realize that it's better to do it slightly differently.
That said, you're right - C++ is harder to parse, and that's probably the main reason that's hard to find such refactoring tools.
@OP (and everyone):
Anyway, I know that there's a commercial tool that can be used for C++ code refactoring, and more - it's called Visual Assist X, and it's a VS Plugin.
A trial version is available for download.
Also, as the eclipse IDE, normally used for Java developement, can also be used for C++ development, you could perhaps try to integrate your workflow with it, since it provides basic refactoring support for C++; see here for details. I'm not sure if this is feasible, though. On the up side, it's completely free.
@ovidiucucu: I'm using C++, no CLI, and Intellisense has never worked properly. A lot of the time it won't even "Go to definition" or "Go to declaration", and much of the time it won't give me the popup function headers as I type. It's fine when it works, but it's more off than on.
@TheGreatCthulhu - Thanks for the suggestion. I've installed VA-X, and it looks fairly good. It certainly has some great capabilities. Can't say I'm far enough into it to know if it will really do everything I expect, but there are some good simple time savers there, that's for sure. It still seems to struggle sometimes with showing me function headers when type the function name, and doesn't fix the native Intellisense problems, but hopefully I'll figure out ways to get what I need from it.