Dec 25 2008
All developers are equal, but some are more equal…
Microsoft Visual C++ from Visual C# developer perspective…
After a while developing apps only using .NET (mainly C#) I felt a need to get a deep dive into C++ programming (DirectX). First impressions? It seems that VS is completely different (much harder) to use if you are C++ developer. There are many things that do not work as good as when using C#. First problem is that Intellisense for C++ is much poorer. You got to deal with .ncb files (sometimes the only solution is to delete .ncb file in your project and then… surprisingly IntelliSense gets back from grave).
Worth noting is that DevXpress (Microsoft partner) released another great plugin for Visual Studio without charging for it: Refactor for C++ (the plugin is mentioned also on MSDN site: http://msdn.microsoft.com/en-us/visualc/bb737896.aspx). It is definitely something you should give a try (and I bet you won’t stop using it). Don’t be fooled by installer – the latest version DOES work with Visual Studio 2008 (and not only 2005 as you could think from what is being displayed during installation). Having Refactor for C++ is much better than not having any opportunity to refactor code, but… there are many things that any Visual C# developer is used to, and think of as a ‘must be’ feature of Visual Studio IDE. The refactorings offered by DevExpress’ product are really simple, do not expect possibility to move function body between header / cpp file, extracting parts of a function to another one does not work as I expected, and even simple renaming caused me some problems. Let’s take under consideration following piece of code:
// forward declaration
void RenamedFunction( );
class SimpleClass
{
public:
void function( )
{
printf("<SimpleClass/>n");
}
};
SimpleClass *externalObject;
void RenamedFunction( )
{
externalObject->function();
}
As you can see Function is a global function name, and also a name of the SimpleClass. I had similar situation in my code. I wanted to rename Function, and what happend? Well… Refactor renamed it, but… it also renamed the name of the method (SimpleClass->Function became SimpleClass->NewName). I have fixed function names in several places, and created a new project to test if it is safe to rename functions using Refactor for C++ but I couldn’t get the same behaviour – so maybe it really WAS my fault ;) Well… I have checked it in my project… and yes, it still renames the global function AND method inside SimpleClass… I wonder why this bug does not occur in the sample I have provided above… I’ll try to investigate this issue further on.
Most of the things I am missing in Visual Studio IDE itself and Refactor for C++ are available through great plugin by Whole Tomato Software – Visual Assist X. I am sure, you have heard of its biggest opponent – Resharper from JetBrains, so why should be interested in Visual Assist X? The answer is simple, if you never ever use any other language than C#/VB.NET – you have two options: Visual Assist X or Resharper – they both increase coding speed and make you being less afraid even if there are some complicated refactorings to be made. And if sometimes you use C++ as your development language (especially unmanaged)…Visual Assist X is the only option available.
The last thing that made me mad was… VS seems to ‘lost’ support for .hlsl / fx files (pixel/vertex/geometry shaders written in HLSL / Cg). It is kind of a strange, because I remember that it worked long, long time ago (around August 2005 – Visual Studio 2005 Beta with DirectX SDK from August 2005 as far as I can remember). Why doesn’t it work now? It is hard to say. I don’t even know if it’s an issue of VS2008/2005 or just something was broken inside DirectX SDK (I am currently using November 2008). It is funny how quick one became used to something that was a ‘wow’ feature not so long ago :) I missed syntax highlighting in effect / hlsl files so much, that I started looking for some alternative or plugin for VS or some .xsd file (with definition of shader key words) at least… And I found one – Intellishade.Net. It is great that someone gives for free something I thought Microsoft offers :)
After all this, I am really curious what has been said on one of the PDC 2008 sessions concerning new Visual Studio (I think the title of the session was: “VC10 is the new VC6″). I really hope that there will be enough encouragement from all C++ developers, so that MS creates a lot more convenient and powerful IDE for VC++ developers. There is still need for the good C++ IDE for Windows, and I think it is much behind Visual C#. C++ is not dead, and it seems that it won’t be for a long time.


September 18th, 2009 at 8:26 pm
[...] All developers are equal, but some are more equal… (Maciek Talaska) [...]