Dec 25 2008

All developers are equal, but some are more equal…

Category: ProgrammingMaciek Talaska @ 12:48 am

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.

Tags: , , , , , , ,


Dec 07 2008

Color customization in CodeRush XPress

Category: Programming, toolsMaciek Talaska @ 8:30 pm

A while ago DevExpress introduced a new, totally free product for developers using Visual Studio – CodeRush XPress. I found it quite helpful, so it became one of the plugins I am using during my day to day developer activities. However, I was looking for possibility to change default colors (I have black background in my VS environment, so not all the colors are easy to notice), and couldn’t find one. Recently, I have found the solution on DevExpress site. It’s a pity, that one must be aware of this magic key combination, instead of being able to configure plugin behaviour from VS options menu. Anyway, after pressing Ctrl+Shift+Alt+O (easy to remember, right? all the modifier keys and ‘O’ as in Options ;) you will see an option dialog, with dozen of things to change (or better: ‘personalize’):

CodeRush XPress' option dialog.

Tags: , , , ,


Sep 19 2008

Visual Studio & SVN integration

Category: Programming, toolsMaciek Talaska @ 2:29 pm

SVN is nowadays one of the most popular version control systems. There is a great tool for Windows called TortoiseSVN – it is very popular, easy to use and has a lot of features. But… it is not very convenient while developing. The need to switch from Visual Studio just to check-in, resolve conflicts… well it is definitely not what I want. I wanted to have a tool that integrates with Visual Studio just like Microsoft’s Visual Source Safe or TFS does. Quite a while ago I tried AnkhSVN, but it didn’t work as good as I wanted – it had a heavy impact on my Visual Studio (sometimes I had to wait very long to be able to do anything – because VS tended to freeze).

Few months ago I found out that many people praise VisualSVN. It is not a plugin (just like the old AnkhSVN) – it uses SCC interface, so it behaves just like VSS/TFS. Some people says that the only thing they dislike is that they feel it just a wrapper for TortoiseSVN (VisualSVN just launches TortoiseSVN’s dialogs for most of the operations). I think it is not a disadvantage – TortoiseSVN is a great client, so if there is a way to use not, and not be forced to switch from Visual Studio to Explorer / Total Commander / any other shell… that’s just great (for me). The only disadvantage of VisuaSVN is that one have to pay for it. In the past it was very cheap (19$) but after gaining popularity it became much more expensive – now it costs 50$ (but there is a way to get it for free – one just have to be active developer involved in open source project).

Well… I wanted to find a free alternative, and that’s how I found Garry Bodsworth’s special settings, that integrates TortoiseSVN with Visual Studio. It is free. It is fast (there is no impact on Visual Studio performance). It contains both: version for VS2008 and VS2005. Perfect? Well… almost ;) It is just a setting file, so ‘Pending Checkins’ won’t work, there is no mechanism showing new files or changed files in projects / solutions…

All those things that Garry’s settings lacks are provided by the latest, totally rewritten version of AnkhSVN! Now AnkhSVN works not as a plugin, but as SCC package – the integration is done the way it should be. The impact on Visual Studio performance is not noticeable. ‘Pending Checkins’ works just like with VSS / TFS, managing newly added, changed or deleted files in solutions / projects is much simpler – thanks to showing all the changes right in the solution view. Personally I think that TortoiseSVN’s dialogs are better ;) so at the moment I am using both – Garry’s settings and AnkhSVN. Garry’s settings allows me to use very well known by me mechanisms provided by TortoiseSVN, and AnkhSVN shows me all the changes I have made recently – it saves me a lot of time, and I am sure I won’t miss any file while doing heck-in.

Tags: , ,


Feb 24 2008

Problems uninstalling VS 2003?

Category: Programming, WindowsMaciek Talaska @ 5:57 pm
Recently I was just trying to get rid of some apps I would not use any more. I found out that I still have VS 2003 installed. VS and MSDN takes about 3GB of space so I almost immediately launech “Add Remove Programs” and clicked “Remove”. As for my surprise VS did not want to unistall. It just showed me again the dialog box where I could choose which features I would like to install. I repeated procedure several times, but nothing changed. In the act of desperation, I just deselected everything and clicked “install”. Then (just at the very begging of installation) clicked “cancel”, and started the procedure again from clicking “remove” in “Add Remove Programs”. And… it worked.

One thing that struck my mind is that installing / uninstalling applications is still a pain. If you are to install / uninstall several applications… you are to waste some time sitting in front of your PC and waiting for any actions you should take. Why there is no possibility to choose many apps to deinstall? Why is it still so hard to install several apps one after another? Why can’t you just have the possibility to “batch” installation processes? Why nobody though of making installers able to read some “setup configuration” (so that you could specify some basic options for installation like: destination folder, type of installation: full / minimal – custom will need of course your assistance…). PC hardware and OS’es changed a lot in recent years, but maintaining your software is still not as painful as it should be. When will we see new better setup technology? Will we see it at all?

Tags:


Nov 25 2007

Getting started with Silverlight

Category: Programming, toolsMaciek Talaska @ 1:59 pm
Recently I have heard about INETA’s “Silverlight European Challenge” and I have thought that it is a great opportunity to learn this cool new technology from Microsoft. My first steps were to go to Silverlight’s site (community -> gallery) – just to install the runtime and watch some samples. Some of them were really amazing, so I was very excited, and started to install everything I thought I would need as a developer. I have installed:
After a couple of minutes, when everything I have listed above was installed I created first Silverlight project in Visual Studio 2008 Beta 2. It compiled at once with no errors or warnings. But when I wanted to run the application (you know, the simpliest “Hello world from Silverlight” thing) it didn’t work. I saw the “Get Microsoft Silverlight” instead of what I expected. I went back to the silverlight.net site, just to check if problem was with the application, or something was broken in my developer’s environment. Samples I was watching a few minutes earlier just stopped working. I decided not to spoil my working environment and to test Silverlight’s installation on virtual machine. I used images with Visual Studio 2008 Beta 2. At the very beginning I realized that I did not need to install Silverlight 1.0 SDK. The next thing I have discovered was that samples stopped working after installing VS 2008 Tools for Silverlight. Unfortunately it is impossible (at least very hard) to develop anything using Silverlight without those VS tools (VS Beta2 is not able to cope with Silverlight’s project type without this add-in). The last thing I tried was to install only Silverlight 1.1, and VS 2008 Tools for Silverlight 1.1. and… it worked!

It is really dissapointing that there is no information concerning what you should install to get everything work as it should. There is a topic on a forum on a Silverlight community site, but it describes installation issues with older version (July 2007) of Silverlight 1.1 Alpha package.

So… just to sum everything up, to have environment for Silverlight development configured properly all you need to do is install:

  • Silverlight 1.1
  • VS 2008 Tools for Silverlight

and that’s it! Nothing more! (you may also install SDK for Silverlight 1.0 and 1.1 – it should not spoil your environment).

Hope it helps… happy Silverlight-contest coding ;)

Tags: , ,