Saturday, September 30, 2006

Blow hot, Blow cool

One thing I never understood about the Americans is their obsession with the two adjectives hot and cool. From what I know, 'hot' means being beautiful/attractive, and 'cool' means being with the times. Physics be damned, most American lives circulate around making themselves both hot and cool, and at the same time! It starts in childhood when every girl has to become a 'hot' cheerleader and every boy a 'hot' football player. At the same time, every child has to be cool - which essentially means they should have a position at the popular table in school. Anyone who is warm is essentially consigned to the dustbin as a geek, dork, nerd, or a whatchyagonnacallit.
And the trend continues throughout. That you have to be both cool and hot to get dates is a given. What is funny is how parents (some of them at least) try to be cool with their kids. Trying to pickup teen-lingo, trying to 'hangout' with them, trying to be with the times in letting them do as they like...the scene would be hilarious if it wasn't so tragic.
That really is the tragedy of the US. If President Bush is really serious about 'reforming' the education system, the first thing he'd have to do is to get the US rid of this temperature obsession. That is the reason many US kids don't do well in maths and science. There are few problems with US public schools - if Indian schools had half the infrastructure, facilities and teaches that US public schools have, there would have been no software industry in the US. What is required is a little perspective.

Sunday, September 17, 2006

Christopher Alexander

Most folks in the software field know about Design Patterns - the timeless way of designing software first elucidated by the Gang of Four. But not many know that the original inspiration for these patterns came from Christopher Alexander - who in his all-time classics "The timeless way of building" and "A pattern language", captured patterns in architectural design for posterity. I've been trying to buy these books for some time now, without success, but today, I saw on Eric Raymond's site, a lot of information about the same.

Bangalore International Marathon 2006

Today I completed the half-marathon organized as part of the Bangalore International Marathon event. All 21.097 kms of it. It was fun!

Sunday, September 10, 2006

Technology notes - Vol I, Ed I, Sept 06

For some time, I've been thinking that I need to have a regular spot on my blog for anything I want to write about technology. So, in the spirit of the times, I'm calling it "Technology notes" - random jottings about my tecxperiences. ;)

* Why hotmail sucks

I've been using hotmail since the time it was the only free, web-based, e-mail service provider, way back in the mid-1990s. Even when I got my Yahoo and Gmail accounts, I continued to use my hotmail account for some of my e-mail. Of late, Microsoft has paid more attention to Hotmail, and I now have like 2GB of free storage, and a whole new interface that looks just like Outlook. While the extra storage is welcome, and is a marked improvement over the 2MB I had earlier, the new interface, simply sucks.

First, it takes a long while to load. Then, I still need to click on "Inbox" to access my e-mail. Why can't Hotmail (and Yahoo) simply take me to my Inbox? Do I login to check my Junk e-mails, or do I login to check my Inbox!?
My next peeve is the usage of screen real-estate. The "Windows Live" banner takes away 25% of screen space, and there is a lot of additional white space surrounding it, which makes my e-mail pane really small and forces me to do a lot of scrolling. This is another illustration of forgetting user needs over self-aggrandization. It doesn't look like the product has seen a lot of usability testing.
Finally, there is the point about Junk e-mail filters. Hotmail's is probably the worst in the business. There is hardly any filtering done and all the junk simply lands up in my Inbox totally reducing my effectiveness in processing my e-mail.


* Unicks rocks

Heh heh. Did I just hear a "I told you so" from somewhere in Sahakaranagar, Kansas City, LA and Singapore? All I can say in response is that I believe in the "horses for courses" theory. There are things about Windows that are nice, and the same holds for Unix. But anyway, coming to the point of this post - the problem with WYSIWYG (What You See Is What You Get) is WYSIWAG (What You See Is All You Get). No designer can design a GUI for doing everything a user may want - but a group of well written tools that confirm to an interface can rock your world.

How did I realize this? Well, recently, I had to create a password file for a project I'm working on. The file stored a triple - username, password and a user directory for users enrolled in the system. For bootstrapping, I already had a directory tree with a lot of user directories listed, so I wanted to write a script that'll run through the tree, and dump each folder name into a text file in the format X, , X, where X is the directory name and passwd is a number that gets incremented for each directory.
Question was, how can I do it easily on Windows? Well, a small C program might do the trick, but then I need to check for file handles, and stuff like that which is clearly not an option. DOS shell scripting is too primitive - for example, the for loop can only execute one command! So, if you want to execute multiple commands, you need to put them into a separate batch file! And I don't know anything in VB, so there was no way I was going to write my 'program' in VB script.
I was in a quandary, cursing myself for not having a Unix shell somewhere, when cygwin came to my rescue. One install and two lines of shell script later, my password file was ready!

So there. While GUI's have played a very important role in making computers more accessible, a shell prompt is indispensable if you are doing serious programming, as I realised after this experience.

On an aside: Eric S Raymond has these fun Unix Koans, with the one about GUI's being the best. Read them here.

Sunday, September 03, 2006

What in h*ll is wrong with Rahul Dravid?

What in h*ll is wrong with Rahul Dravid!? I mean, when he became captain, I thought he was probably the best choice for the post. Unfortunately, he has proven me wrong repeatedly. Here are a few instances:

- Handling Sehwag: Clearly, Sehwag's performance is nothing to write anywhere about. But still, he continues to be in the team, at the expense of younger talent like Robin Uthappa who had like a dream start to his career. Now if you want to groom young talent, why keep Sehwag? And what impact will this have on Uthappa's confidence!?
- Handling Kumble: This is most shameful. How can you drop India's best bowler for the Champion's trophy? If you want to select him for the next world cup - which everyone mostly thinks will happen - you have to give him match practice. If you don't want to select him - which is disastrous - tell him straight and ask him to retire. Is this the way to treat one of the best bowlers in the world!? Instead of issuing platitudes like "Kumble is the best bowler we have", why not say openly, yes, we want Kumble, and this is how we want him!?
- Handling Saurav: I wrote about this earlier too. But what is really poignant was Saurav stating in a recent interview that neither Greg Chappell nor Rahul Dravid had spoken to him about why he was kept out. While I don't disagree with the decision to keep Saurav out, is it that difficult to simply walk up to him and tell him why he was kept out? Isn't it incumbent upon the captain to tell players why they're kept out? At least, for courtesy's sake!?
- Dhimmitude: This has happened many times. See this post for an instance.
Sorry, Dravid. India expects better from you.

Yet another change of name

For sometime, my posts haven't been justifying the title my blog had - "Why life sucks". So, I've changed it again. It is now 42. The answer to the ultimate question. So, in a way, I am pompously suggesting that my blog is the answer to the many questions I pose for myself. :D

Saturday, September 02, 2006

The average curse 2: Not having a niche

Earlier on this channel, you read about the average curse and how it has impacted my life. Recently, I changed companies, and the average curse has comeback to hit me with a vengeance. But this time, it has more than one dimension. While earlier I only cribbed about having friends who could do things better than me, I now face an entire battalion of more-capable people, that too in my favourite areas of CS.
I was having lunch with some of them, and was simply amazed at the depth of their knowledge and the sparkle of their intelligence. There were many topics being discussed - from the organization of files in Unix to the way malloc works, to database queries, and database-object oriented round-tripping. Each of those persons held their own in their topic, and that was when it struck me.
I have no niche of my own.
Now, that, my dear readers, is the real disaster of the average curse. Not knowing what you're good at. Not having a niche. Not being able to hold forth in any area of your choice. And how much time has it taken for me to realize it!!!
Anyway, another 'get it off the chest' post.

What makes a good programming language?

Have you (if you are a computer software geek) ever wondered why some programming languages suck? I mean, for example, you have languages like C and C++ that are extremely powerful for system-level programming, languages like Pascal that are easy to learn, languages like ML that make things like writing a compiler a matter of a few hundred lines of code, and yet, there exist half-dead languages like Ada, that no one uses? Why do languages suck? Or, more importantly, what makes a good programming language?
Well, here are my criteria:
1. A good language is designed for the designer to code in.
i.e. The language has not been designed for 'them' - who ever they are. So, this automatically puts languages like Ada (which was designed by a committee (a defence committee, no less)), C#, (which was designed with one single motive) and Java, (which was designed for those poor object-oriented programmers who couldn't figure out multiple inheritance) in the trash can. Languages like C, PERL, Pascal, Fortran, C++, on the other hand, shine in this category. Note, I'm ignoring Python because I haven't programmed enough with it.
2. A good language tries to do as much as possible at compile time
Good languages try to find as many defects at compile-time as possible. They are usually statically typed, and enforce type-safety in varying degrees.
3. A good language is never created with corporate interests in mind
I don't need to expand on this.
4. A good language does not underestimate the programmer
Why doesn't Java have multiple inheritance, or enums? Because, ostensibly, they "confuse" users. Well, Einstein's theory of relativity is confusing. So, should we ban it!?
5. A good language respects the programmer's application domain
My favourite recent peev is the way C# handles structs. Now, user-defined structs cannot have default constructors. So, the compiler will provide one, initializing all members to zero. Normally, this is OK, except if the zero-state is an invalid state for your application domain. Let's say it is - then what do you do? A famous book on .NET framework design suggests that you make it valid! So, the language will not serve your purpose, you'll serve the language!
6. Beyond these, a good language gives you good expressive power, excellent libraries and run-time support, and great documentation.
Well, obviously.
I know this post is incomplete, and there are many other criteria for a good language. If you feel strongly about any, post it below :)