Skip to content

Windows C++ IDEs – A Quick Tour

June 22, 2011

A few months ago my trusty little Sony Z600 laptop finally gave up the ghost. It had been ailing for some time, and finally its USB controller stopped working altogether. This 10-year old machine, with 256Mb or RAM, 900Mz processor and cool, purple magnesium alloy shell, must be the most cost-effective box I’ve ever bought. Running Win2K, I used it as my main development machine for much of the last decade. But things move on, and I have now got a dual-core Dell Inspiron, with a sensible amount of memory. But it’s not as cool as the Sony – black is not the new purple.

Anyway, what does a C++ developer do when given a new box? Well, after loading up some games, desktop eye-candy, and removing most of the software Dell kindly installed, he turns his attentions to C++ compilers and IDEs. In the past few months, I’ve been fiddling around with all the major Windows contenders in this area, and here is a summary of my findings. I’m breaking this up into several posts, and will present a summary, together with some compilation performance figures in the final post in the series.

Note that I only looked at free (as in beer) products, and my findings are perhaps a little subjective and certainly very far from being exhaustive reviews of the various IDEs. My methodology was to transfer an existing small project of mine, to each of the IDEs in turn, and see how much effort was involved in getting it up and running.

Visual C++ Express

We start with the platform’s leading C++ IDE, Microsoft Visual C++ 2010 Express. This is the free version of Microsoft’s flagship product, and is a pretty hefty download. Once you have downloaded and started it up, you may well wonder why it took so much code to produce such a simple, though quite pleasant-looking IDE. I created an empty console application project, and then looked to see what the the IDE had wrought. Well, it had wrought quite a lot, actually. I don’t really see why an empty project should contain seven configuration files. But still, lets try and add my own files to the mix. The project I’m using, nclip, has its source files in a subdirectory called src, and its include files in a subdirectory called inc. Can I maintain this structure in VC++?

It turns out that I can. Adding the copied directories was fairly painless, except that whenever a dialog was to supplied to look up a path or a file, it invariably opened in somewhere other than the current project. Why? Isn’t it highly likely that if I’ve created a project I want to work in its context? Anyway, files were added to the project, and with trembling fingers I pressed the “Build” button. Oooh – lots of errors. A bit strange, as this code compiles cleanly with GCC. What can be the problem?

First off, obviously the include path was wrong. This was easily fixed using a dialog which seems to have changed little since VC++ 6.0 (the last incarnation of VC++ I used). That dialog was kind of naff then, and hasn’t improved with time. It did the job, but I was still getting compilation errors about casting to wide-characters. Oh no! Unicode alert! Of all the ghastly technologies in the world, Unicode is possibly my least favourite (after CORBA, anyway) and one I have vowed to have nothing to do with. Can I work out how to turn it off? It turns out I can, the character set is configurable in the project properties – I set it to Not Set, a curious way of saying I don’t want Unicode or wide-characters.

OK, hit the build button again, and it compiles and links. Not let’s run it. But wait a minute, the “Run”button on the toolbar, (or what seems to be a button) is greyed-out. Here it is:



Now why should that be? Let’s have a look in the Debug menu. Nope. There is a “Start Debugging” option, but no way of simply running the program from inside the IDE.

At this point must admit I almost gave up. The ability to run your program in a convenient way is I would say one of the key features of any IDE, but one Microsoft seemed not to want to provide. I could always open a command prompt and run the program from that, but why should I have to? So I did what any sensible person would do, I asked about the problem on StackOverflow. Quite a few people didn’t know the solution, but one did. It turns out there is an “Expert Settings” option in the “Settings” menu, which enables quite a few features that I would have thought were essential for all developers, expert or not. Do Microsoft really think that the ability to run a program from the IDE is something that should be reserved for experts? Apparently, they really do. And that “Run” button we saw earlier? This one really is unbelievable – it appears to be a caption on the toolbar!

So far, I am not exactly finding VC++ Express to be a rich and rewarding experience. However, I hadn’t actually tried to write any code yet, so I decided to add a new command to nclip, one that would detect if a fixed text (no regexes was in the clipboard). I wiggled my my fingers and began to hack!

First off, the IDE’s text editor is very clean to look at. Also, for ageing people like me, it has a handy zoom feature. In fact the font size of all components can be adjusted separately, which I consider a major usability plus point.So far so good – I start to write my new function:

int FindCmd( CmdL

Now at this point I would like the IDE to offer me some possibilities (I am trying to type CmdLine) in the form a of a popup list, but it stays ominously quiet. Time to look at the help, maybe? Microsoft as always had good help for its applications in the past, but … no longer, it seems. The help takes me to the MSDN website. No thanks. Eventually, trial, error and past experience leads me to the Ctrl-SPACE combination which does complete the class name for me. I type in an opening brace (curly bracket) – it doesn’t give me the matching closing bracket, admittedly a feature I can take or leave. I type a bit more, and make syntax error – a wavy red “spelling-mistake” line appears under it. Very nice indeed. I type in the name of a class object and a “.”, and this time code completion does work automatically – no need to type Ctrl-SPACE.

Lastly, I tried a bit of debugging. I must confess to only using a debugger very, very rarely, so I didn’t try anything spectacular here. Everything worked very nicely, as I was expecting it would do – Microsoft have always make good debuggers. In particular, the display of standard library class instances like strings was very clear and easy to understand.

So to sum up, the positives:

  • looks quite pretty
  • on-the-fly error highlighting
  • configurable text in IDE
  • excellent debugger

and the negatives:

  • big download
  • confusing expert/beginner settings
  • inconsistent code completion
  • very poor help system

That’s all for VC++ – in my next post in this sequence, I’ll consider the Code::Blocks and CodeLite IDEs.

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: