Saturday, March 17, 2007

reply to start choppin

My last post got two comments! So far, that's the best ever. (Pity one was deleted.)

But I'm not sure that I didn't cause confusion. Sorry.

To clarify, I was talking about programming languages. Not written languages.

If you read Start Choppin's comment you'll see what can happen without capitalisation in English. (Superb example, by the way.)

Careful, I've entered rant mode now...

I cannot think of a good reason to have case sensitivity in any programming language. If you have a good reason, then please let me know.

Rant mode off.

One reason I was given today was that the developer wanted to name the variable the same as the class, but only differ in case. For example (in C# syntax):

Link link;

Where Link was the class name and link is the name of the variable.

OK, seems a sensible reason. Except that it's bad form to name your variable the same as the class. Why, let's just say one word. Confusion. Much Better to name it something appropriate:

Link nextPageLink;

We can't have descriptive programming! No, that's toooo sensible.

But if this is your only argument for case sensitivity and you must call your variables the same as the class, then why can't the compiler know what you're referring to based upon it's context. Even VB6 could handle this.

And, the real point of my post was that we do things in software development that make it harder than it needs to be. Case sensitivity is just one example.

Another would be choosing to use an Object Orientated database instead of a relational database. (Can't wait to see the comments about that statement!)

No comments: