15/04/06

Whose bright idea was Visual Basic?

Permalink 10:09:25 pm, Categories: Programming, 544 words  

Many many years ago (sometime around September 2004 according to the time stamp on the zip of the source code, but I suspect it was earlier) I took over development of the Rollcall Army Builder. It was first written in 1997 by someone called John L. Martin, and then a guy I knew only as MudiPaws looked after it for a little while and updated it to be compatible with Warhammer 6th Edition.

Anyway, following some recent attempts to get the various sites of the Warvault.Net Toplist to contribute to new files, it turned out that Games Workshop have added extra complications to some armies since MudiPaws' updates. Time for more work from me! Progress is being logged in a thread on the HWT Forums.

The application itself is great - writing it from scratch would be much bigger project than I'd normally undertake on my own (or at least bigger than I'd undertake and complete) but modifying it isn't so bad. The worst part is what it's written in - Visual Basic! Why? What on earth convinced anyone that Visual Basic was a good language to program in?

OK, so it isn't too difficult, and I can cope with not having to put semicolons at the end of lines etc. but I try doing an IF with "a or b" and it complains when I put in "||" for the OR symbol. An equivalent to a 'continue' statement in loops seems out of the question (one exists, but it doesn't want to recognise it for me in VB6), so I'm botching it with GoTo statements. ElseIf has to be one word, while End If is two. Concatenation using "string"&var&"string" errors, but "string" & var & "string" is fine because the & isn't trying to do anything strange to the variable.

There are only two good things I've found so far. First is that it is more direct about syntax errors - you have a syntax error on a line (like an IF without a comparison) and it won't let you do anything until you fix it. The counter side to that is if you start an IF and want to copy the statement from elsewhere, you've got to comment the line out, copy, paste and uncomment. There's a lot errors it won't catch, though. Loose typing means you can get away with a lot in valid syntax but invalid types, and it won't say anything until you run that exact line of code or enter the function that contains it.

The other good thing, something that I'm not sure whether it was re-introduced in .Net 2.0 or not, is editing on-the-fly. Hit an error, it tells you, you can edit the code and continue without having to restart. It's a great help if you're part way through a long-ish set of actions when you hit some mismatch that a C# compiler would have picked up, but that's one of the minus sides - a C# compiler would normally have picked it up before then!

Oh well, I guess updating the code is easier than writing the thing from scratch. I just don't have a clue who would ever want to call themselves a programmer and voluntarily work in VB. Maybe it was something about the 90s?

Comments, Trackbacks:

No Comments/Trackbacks for this post.

Navigation