Tuesday, February 20, 2007

Some thoughts on programming

In the last several months I've had the "pleasure" of working with several different programming languages for the software I'm developing for my thesis. In a given day I may spend time working with Java, Visual Basic (and VBA), SQL, and XSLT (for XML manipulation).

Sometimes I need to call a Java program from a Visual Basic program, or use Visual Basic to perform XSLT functions. In the near future I'm also going to be working with CLIPS, which rounds out the 5 programming "languages" I've used in my thesis. In past projects I've also worked with SWI-Prolog, LISP, Python, and of course C. The different languages all have their utility, some moreso than others.

A language like Java is great because it makes building off other people's code a snap (assuming it's well documented), and using abstraction and interfaces makes things so much better when trying to manage a complex system (why they don't stress this stuff in CS here at Windsor blows my mind...it was all crammed into the last 2-3 lectures, when it deserves it own course).

A language like XSLT is great at doing XML transformations, but not much else. Having to write all of your code in XML format is really annoying, but it does its job and does it well.

To me, these are the two ways that programming languages should exist. A language should either be general purpose enough to do most things rather well, or specific enough to do a couple of things very well. Bridges between languages are getting better and better, so working in a multiple language framework is becoming less of an issue. This way we can use the broad languages (Java, C, etc.) for most things, then make use of specific technologies like SQL and XSLT when we have a task that suits them.

So what's my point in all of this? Well, it's a roundabout way of me saying this:

Visual Basic 6 sucks, and it sucks hard.

VB is a broad language, designed to be able to do everything. And granted, it does do pretty much anything you ask it to do, but it does it in a way that lends itself to bad code. Everything from the smallest details to big obvious things fail me on a daily basis. And the thing that annoys me is that these things happen by design.

Here are some examples:

You can't comment out multiple lines at once using a block comment (like /* ... */ in C/Java), you can only comment out individual lines at a time...this is insanely annoying while trying to debug your code or do any major documentation

The Visual Studio editor is the worst IDE I've ever used. Notepad is more useful as a programming tool. It does so many little things that bother me. For example, if you're in the middle of typing a line of code, and you try to move the cursor off of that line before the line is done, it gives you a warning message that you have to dismiss before you can continue. It happens all the time where I'll be writing a line, then realize I can just cut and paste a long variable name, or I notice a mistake in another part of the code that I want to go and fix. And invariably the damn thing will bark at me.

Brackets? Who needs brackets? Look through some VB code and the first thing you'll notice (especially if you're used to Java/C style code) is the lack of brackets used in the code. They're used in method signatures, and are sometimes used when you call functions. There is nothing worse in a programming language than having it behave differently in situations that are seemingly the same. When you call a function in VB, you generally don't need to include brackets around the arguments, unless you want to do something like have access to the function's return value. If you want to call a function you can just ignore the return value by not using brackets, even though the function explicitly returns a value.

And of course, Visual Basic does not include any ability to do abstraction or interfaces. Pretty much the most powerful feature of object-oriented programming is left out of visual basic. This is just plain obnoxious.

I think the idea is that VB is designed to be more of an entry-level programming environment, and I tend to get annoyed because I know there are a bunch of way better alternatives out there that I'd prefer to use. But since I'm working with a system that was built on Visual Basic, I'm forced to toil away in it.

Damn, that felt good to moan about :)

Wednesday, February 07, 2007

Music, Music, and more Music!

I just came across another web-based music service that's Pandora-esque, the difference being this one lets you build playlists from songs that you choose. Check it out:

FineTune

The only restrictions are that there must be at least 45 songs on your playlist, and there can be no more than 3 songs from a given artist.

Check out my first playlist on the right. It's good listening.

Monday, February 05, 2007

Prince + Foo Fighters = Wrong

Did anyone else watch Prince butcher a Foo Fighters song at the Super Bowl halftime show? That was freaking ridiculous. Who does a cover at the freaking Super Bowl halftime show?

It's not that I'm a Prince fan by any means, I'm completely indifferent to him and his music. It's just that when a "guy" has a chance to sing four songs to a gigantic audience (170+ countries), I think he should sing four of his own songs. Instead, he sings two of his own songs (at least I think so, I've never heard that last song he did before) bookended around a Foo Fighters cover and a Tina Turner cover (seriously).

On the other hand, we were provided with these: