C#, Visual Studio and the lure of the Dark Side

Published February 20th, 2007

A few months ago I began work on a project — a relatively simple Windows application — as a favour for a friend. Because I’d been fiddling with it for a while and it seemed like a convenient choice, I chose to develop the app in AutoIt.

I’ve mentioned before how cool I think AutoIt is, and how suitable for the rapid development of small Windows utilities and applications. Well as time went on and the app grew in complexity, I began to struggle. The problem stemmed mainly from my inability to adjust my thinking to cope with AutoIt’s BASIC-style procedural syntax. I’ve been thinking in an Object-Oriented way for so long now, that I tried to organise the code in a way that was as close to OO as AutoIt could manage. The result was a mess of global variables, tortuously long variable names, and complex and inconvenient hash arrays. Development was slowing to a halt and I was rapidly losing interest in the project.

Back when I was first planning my approach, I’d briefly considered writing the app in either C# or Java. I quickly gave up on the idea because, frankly, I was scared off by all the extra faff that comes along with these ‘grown up’ frameworks — i.e. having to learn all about strong typing, managing dependencies, building executables from source and so on. It’s just not what I’m used to: this was supposed to be a bit of fun, not a massive project where I would need to learn to be a real programmer. 

But about two weeks ago I was getting a bit desperate and I decided to reassess my options. I considered Java for a brief interval (mainly for cross-platform support, which I don’t really need in this case), but then I found that Microsoft is giving away various ‘cut-down’ versions of Visual Studio for free. Just out of curiosity I downloaded the snappily-titled ‘Visual Studio C# 2005 Express Edition‘ and was sucked in almost instantly.

Not being a programmer by training, I’ve never encountered Visual Studio (or the like) before. And I was genuinely surprised by just how…tight it is. Yes I knew vaguely that it allowed you to create GUIs with drag-and-drop. But then I clicked on a new button and it built a stub event handler for me. I dragged a table from an SQLite data source onto the GUI and it created a data grid, and populated it. I decided to change a class name and it instantly refactored the code to update all references. I clicked another button and it compiled and launched the app, with the debugger in the background so I could look at the code, peer into objects, fiddle with variables and even make code changes while it was still running. And finally, when I come to package up the final product, it will automate the whole process.

Again, I had a vague notion that this stuff was possible but I’d never really come into contact with it before and certainly wasn’t aware of how slick it had become. I feel like a kid in a candy store. No, scratch that: I feel like a country bumpkin who’s just visited the big city for the first time. In the (less than) two weeks since first downloading the software, I’ve caught up with all the work I’d done in AutoIt over several months (this is a spare-time project, mostly evenings) and then some.

It’s not all roses, of course. For a start, although I have succeeded in building a very solid and professional-looking bit of software, for the most part I have little idea how it works: the vast majority of the underlying code was automatically generated and I’ve only looked at it in passing. You might think that’s an advantage — why would I need to know how it works, if it’s all done for me? — which is fair enough, but I don’t feel like I know much more about C# than I did when I started. When the project is completed I might be able to say that I’m competent in Visual Studio, but I won’t by any means be a C# programmer.

Also, the app I’ve been working on is really little more than a glorified database front-end, so it plays to the strengths of the framework. Clearly if the demands of the task were more complex, I’d need to be spending a lot more time and effort digging around in the guts of C# and the whole .Net platform. And while the reference documentation for the language is nigh-on perfect, I’ve yet to come across the sort of tight-knit, responsive community that surrounds AutoIt: somewhere I can go and be sure either to find my question already answered, or someone willing to work through it with me. That said, I’ve yet to come up against a problem that a Google search didn’t answer within the first page or two.

So I’m not sure I’d want to do this sort of thing for a living: while my productivity is relatively high for this project I don’t think I’ll have the same sense of achievement when it’s finished as I would if I’d built it from the ground up. Where, on a good day, writing a good piece of software can feel like craftsmanship (pretentious, moi?) this feels more like assembling flat-pack furniture. And, having been an Open Source devotee for years, I can’t help feeling the odd pang of guilt for succumbing to the lure of the Dark Side. But it’s just so effortless

Right, now to get back to the real world: hacking out PHP. By hand. Hmm…”Visual Studio PHP“, maybe?

UPDATE: I had a response to this article from Microsoft.

UPDATE #2: Looks like there’s more than one contender in the ‘Visual PHP’ market: check out the upcoming Delphi for PHP from CodeGear (Borland). Interesting…

Get a Trackback link

2 Trackbacks/Pingbacks

  1. Pingback: Response from the Dark Side » StickBlog on February 22, 2007
  2. Pingback: Tempted by Ubuntu » StickBlog on June 8, 2007


  1. jonx on May 16, 2007

    delphi for PHP IS quadram’s visual PHP… they bought it…

Leave a comment

Comment Policy: First time comments are moderated. Please be patient.