Friday, February 29, 2008

Patterns of Software

Before I begin, I’d like to tell you that Neil Gaiman’s American Gods is available for a limited time free reading here. Gaiman had hosted a voting on his site before making this book available for free. The voters chose this one from among many of his books to be made available for download in this way. Please spread the link to as many as possible because a) as many as possible should read this absolutely awesome book and b) Gaiman seems to think that if this gets popular, more of his books may be made available for free which is a good thing.

Next on, read this article on the farce of reality shows by Pradip Somasundaran, the winner of India’s first music reality show Meri Awaaz Suno in which he won the Lata Mangeshkar award for the best singer along with none other than Sunidhi Chauhan.

Right, to get on with the actual subject matter of this post.

Today, after a long, long time, I started reading a book that got my brain machine running a like a factory. The book is called Patterns of Software and is written by Richard P. Gabriel. You can download the book here.

The book is essentially a collection of essays by Gabriel when he was the editor of the Journal of Object Oriented Programming from 1991 to 1993. They examine the issues involved with the philosophy of object oriented design in software. But the most remarkable thing about this book is that it examines object oriented design in the light of the ideas developed by the architect Christopher Alexander. Yes, you read it right, an architect.

The fundamental principle of Alexanders views is that building are inhabited by people – they are alive. He studied architecture from around the world and noticed that the most beautiful buildings were found in the countryside in Europe. He said that these buildings were beautiful because people inhabited them. What he meant was, that people owned these buildings, over time they made small alterations or changes to these buildings, they felt responsible for these buildings. Hence, a sort of harmony emerged out of this confluence of men and buildings that created beauty.

This, he said, is contrary to modern design principles in which buildings are constructed according to a master plan – something that someone sits down and decides once and for all - and the actual users of the building have little or no say in modifying the building to their own needs.

There are various aspects to this design philosophy of Alexander’s and the end result are design patterns – underlying process patterns that create beauty within a design.

Gabriel, in one stroke of genius takes up these principles and applies them to software design, and object-oriented design in particular. Gabriel is not unique in having ported Alexander’s ideas to software, many had already done by the time he wrote his essay. (And indeed other fields of design had freely borrowed from Alexander.) What is unique about Gabriel’s analysis is that instead of the end user, he defines the programmer as the ‘inhabitant’ of software.

This approach is clearly different from the wide spread view. Traditional and even contemporary (if indeed these terms can be used for a barely 40 year old industry) software design puts the end user to the fore. User’s needs are analysed and a master plan is drawn out. The programmer is then charged with the job of merely constructing this master plan – often with little or no freedom to modify the plan according to his needs. But, Gabriel argues, it is the programmer who is the real ‘inhabitant’ of software. Software development can often take years and it is the programmer who spends time with the actual code. The user merely sees the outer finish, the facade. Hence, programming practices should be programmer centric.

He then goes on to mesh, in steps, Alexander’s theory, with his own rich experience with software development and critiques practices that tend to alienate the programmer. The ideas are refreshingly new and to some might come as a surprise. For example, there is an old adage in programming – there is not problem that cannot be solved with another level of abstraction. Gabriel is against this kind of over-abstraction.

The book is making for a fascinating read. Gabriel doesn’t analyse open source development practices possibly because open source wasn’t a big thing back in the 1990s. But today I can see how open source people have knowingly or unknowingly picked up some of Alexander’s and Gabriel’s ideas and are therefore producing more programmer centric and hence better code. After all, the programmer is trying to produce code that does what the user wants – his needs are not any different that the user’s needs. However, unlike the user, it is the programmer who has to actually write all that code. Hence, software development should definitely be programmer centric.

This is precisely what open source does. They start off without a ‘master plan’ as such and keep modifying their program according to user demands as and when they arise. Besides, the user is allowed to inhabit the code too. The user can report bugs, write howto’s and contribute to the wiki. He is part of the software development process!

The ideas are rich and I might elaborate upon them one by one in subsequent posts. And whether I do or do not, you must definitely go and read this book.

Wednesday, February 27, 2008

Some Tech News

This isn’t really a post about anything. Just a general page filler post with some news around the tech world that I found interesting.


First off, Microsoft has been sued by EC for most antitrust operations. Considering that Microsoft has been harping about interoperability and open standards lately, this news puts another dent in their already heavily dented reputation. Over time Microsoft has not only shown that their products suck, they’ve also proven to be a company that will do anything to expand their business.


Second, the number of lawsuits over Yahoo rejecting Microsoft’s hostile bid has risen to seven. While Yahoo continues to believe that it is on the right side of law over this rejection the rising number of lawsuits seems to indicate otherwise.


Third, and this one is my personal favourite – Google has changed the look and feel of Google Documents to match that of pre-2007 Microsoft Office. I’ve $written before$ about how MS Office’ popularity has lead to it becoming the defacto standard for look and feel in word processing software. All other softwares, including its major competitor (if at all it can be called a competitor) OpenOffice are trying to imitate MS Office. Now Google has followed suit. This indicates that as far as user interfaces are concerned things tend to gravitate towards one particular standard. While users like to switch between technologies they don’t want to waste too much time re-learning how to interact with that technology.


A chaos of user interface techniques exists in the mobile world too. I do wonder what technology will come out to the fore.


So that’s it for today. Have a good day!

Saturday, February 23, 2008

Compaq Presario B1200


Yeah, why not? Why can’t I review my own laptop. It is new, it is stylish and I love it. :)

So, this one is called Compaq Presario B1200 and I’ve bought it less than a month ago. When it comes to computers and/or related software, there is so much choice available in the market that what you buy depends largely on your needs. So here were my needs – I needed a laptop to mostly read and write. I write a lot – blogs and fiction and have a huge collection of ebooks and comics that I like to read on my loptop. I was therefore looking for something really nifty and light that I could really keep in my lap and read like a book. But also, my budget was limited. None of those high end notebooks for me. MacBook Air? Completely out of question.

I was not disappointed with this cute little Compaq laptop that I bought. B1200 comes with a 12” screen which has a resolution of upto 1280 x 800. If you’re used to working on a 19” TFT then a 12” screen might come as a shock to you. But once you get used to it, the benefits of going small start surfacing.

The laptop is fast featuring a 1.5 GHz x 2 Intel Core 2 Duo Processor. It has 1 GB RAM and a 160 GB HDD. It has built in BlueTooth and WebCam capabilities. But the best thing is the weight. It is light! Light as light can be. I can actually hold it in one hand like a folder and carry it about. (Of course, not a great idea, one slip and there it goes ... ) And all this has cost me only a few rupees less than 45, 000. Not a bad deal at all.

I’ve been having great fun with this one, snuggled in my bed reading up all sorts of stuff online and offline. And writing on this thing is almost as non-intrusive as writing on paper.

But enough good words. There are downsides too. It has a slight heating problem. The underside heats up a bit too much under heavy load. Now this might have to do with the fact that I’m currently living in an apartment that doesn’t even have a ceiling fan but nevertheless. I guess, if you’re working in air conditioned environments then you don’t really have to worry. Second is the right shift key. In order to make space for the arrow keys on a tiny little keyboard, they’ve made the size of the shift key as small as any regular alphabet key. This may not affect those of you who type with a finger or two but for the ten-fingered ones like me, a slight slippage of the little one means leaving out the caps and going up up up.

Actually what happens is that because of the small size of the right shift key, I keep missing it while typing and pressing he ‘up’ arrow key besides it instead. Quite a disaster as you can imagine.

But overall it’s a good machine. The looks are cool. I somehow like the way Compaq makes its laptops look really sleek. It’s clearly not a Mac like sleekness but is good enough for those of us who haven’t yet made a fortune. :) I’d rate this one a 7.5 out of 10.

Wednesday, February 20, 2008

Crossing Roads in Hyderabad


Crossing roads in any big city is an art. The denizens of each city usually become experts at this art. They teach it to their children along with the nuances of negotiating the long distance to school everyday and being wary of the strangers along the way. But this art takes a different form in every city. Having been in Hyderabad for about a month now, I think I’ve picked up a few such nuances myself.

First off, you must be good at mathematics. You must know your maxima and minima. Like all big cities, the traffic in Hyderabad never stops. There is a continuous barrage of motorized vehicles on the road. But unlike other cities, there are no subways or overbridges anywhere in Hyderabad. The average Hyderabadi doesn’t believe in them. He believes more in his knowledge of mathematics and maxima and minima.

What you have to do to cross the road is anticipate a local minimum in the traffic density. Understand that the traffic density will NEVER become zero. That is an impossibility. Even late night on a Saturday. Minima is the best you can do. So when you do encounter this minima, just cross the road. Don’t think. The people driving those fast and furious cars have eyes too. They can see you, they will avoid you. Have faith. Just walk across.

But the real challenge lies when you have crossed over one side of the road and are now standing on the divider. Because, of course, you only located the minima on this side of the road. There was now way to do it for the other side too. Unless you’re a mathematical geek or something, you cannot simultaneously locate a minima for both sides of the road! So now you’re stuck on the divider, the traffic in front of your so dense that the proverbial chicken will not be able to cross it even in nine lifetimes.

Now you just do the Matrix thingy. You walk onto the road confidently, raise one hand in the ‘stop’ gesture and walk across. God, in his infinite wisdom, put a little bit of Neo in all of us. Therefore, when you raise your hand and think stop, matrix of this world pauses for a while to wonder at your reckless suicidal spirit. And that momentary pause is enough to take you across the road!

Great! You’ve just learnt the secret to crossing roads in Hyderabad which I had to learn the hard way.

A 'Newsy' Blog

Mostly to fill the blogosphere with useless junk.

Yahoo has recently announced that it is changing its search technology to match Google’s. It is moving to Hadoop, which is an Open Source implementation of Google’s MapReduce algorithm. One can see this move as part of Yahoo’s desperate attempt to ward off Microsoft’s hostile bid. On the other hand, it might also mean that the technology invented by Google has finally won over the existing search technologies and has become the defacto standard for internet search. With Yahoo and Google both using the same search algorithms, almost 90% of the search traffic over the internet will be using the map-reduce algorithm. This might cause the minor search players (like MSN) to follow suit and move on to similar technologies.

The difference will still lie in the amount of data each service is processing. Google by far still outdoes Yahoo by several times. However, Yahoo’s move to an Open Source implementation means not only another triumph for the Open Source software development mode but also that their search engine might become more sensitive to user needs and expectations. However, given Google’s excellent track record in giving the users what they want, it seems unlikely that this poses any threat to Google.

Meanwhile, the hostile bid for Yahoo is getting more and more expensive for Microsoft. As if loosing stock value wasn’t enough, Yahoo is not changing its laying-off policy in such a way that Microsoft will lose and additional billion or two if the deal goes through. And it isn’t going to go through all the easily. This looks like a long drawn battle now.

To completely switch streams, read about this giant frog, Beezlebufo, that was 16 inches long and used to devour dinos for dinner. Besides it kicks some continents from being where they used to be in history too!

Mozilla Messaging

If there is one Open Source success story that shines out like a star, it is Mozilla Firefox. Not only has this Open Source browser delivered the best in terms of browsing experience it has also convincingly destroyed the hegemony of Internet Explorer as the industry standard for browsing. But there is another Mozilla product that has missed the spotlight because of the success of Firefox and this product is Thunderbird – Mozilla’s email suite.

And now, the Mozilla foundation has announced the launch of Mozilla Messaging with aim of doing something new and radical with email.

But What?
That is the crucial question. What are they going to do with email? Are they fundamentally going to redefine how email works? Are they going to set up new protocols for email exchange? The newly launched website doesn’t really say. What it does is make some very vague claims about making email great. The only concrete thing that it gives us is that they are going to work on Thunderbird 3. But wait, they were going to do that anyway. We already have Thunderbird 2 and it is logical to assume that Thunderbird 3 will be on its way. So what new are they going to do? Again, no one knows.

Why No-one Knows about Thunderbird
The reason no one knows about Thunderbird, despite it sharing the same design philosophy, being around for the same amount of time, and even sharing the same codebase as Firefox is because Thunderbird is just an email /client/. That too, desktop based. Obviously its user base is limited. I used Thunderbird regularly in college because my institute provided me with IMAP email service. But now that I’m a free bird, I have to rely on web based email for most of my needs. I do have an office email service but they use Microsoft’s Exchange Server and hence gave me Outlook preconfigured on my machine. Don’t know if Thunderbird can interact with Exchange Server or not, by why should I take the trouble.

Outlook is Much More Popular
I won’t say better. It is just popular. Mostly because of the early bugs that caused huge email virus scares. But that gave Outlook publicity. If you ask anyone what software they can use to read mail, they’ll say Outlook. Only geeks like me would say Thunderbird.

There is a huge market out there for Thunderbird still untapped. If they do manage to do those revolutionary things that they are claiming to do, they might actually turn the tables in the email market too.

But What?
That is the question that I keep coming back to. What are they going to do? With Mozilla foundations’ terrific track record, I’d expect them to do something terrific. I would love it if they redefined email as we know it. You know, provide something like ‘unsend’ which brings back my email if the recipient hasn’t read it yet. :)

What they’ll do, only future will tell.

Sunday, February 10, 2008

Thank You for Smoking

There are some films that start off rather unpretentiously but hit you real hard by the time they are over. Thank You for Smoking is just such a movie. The movie narrates the story of Nick Naylor, who is a lobbyist for the tobacco companies and tells people that smoking cigarettes isn’t harmless. Trouble occurs when an attractive looking reporter manages to get his secrets out during passionate sessions of lovemaking. The world already hates Nick Naylor and now he also loses his job.

The movie can be interpreted in two ways. In one way it is a satire about how people can turn any argument in any which way. Take Nicks argument for example. He constantly claims that there is no conclusive evidence that tobacco smoking is injurious to health. He also maintains that his lobbying is not really about whether people smoke or don’t. It is about whether people are allowed to smoke or not. It is about freedom of choice. Put that way, his argument has weight. But everyone knows that cigarettes are harmful, don’t they? Why let them have it then?

That is what Nick concedes to in the climactic scene of the movie. Yes, he says, cigarettes are harmful. There is no one in the world who really believes that they aren’t. But hey, can’t people decide themselves? Should they not be allowed the freedom to smoke cigarettes and die if they want to? Why should the government control smoking?

Having said this, Nick is faced with a deeply personal question. Would he allow his own son, who is sitting right behind him at the congressional hearing, to smoke once he turns eighteen? Nick pauses at this question. It makes him think. And then he answers – Yes, if he really wants it, I’ll buy him his first pack.

This confession shows huge moral courage on the part of Nick. Not only does it show absolute conviction in his belief in personal freedom, it also shows his trust and faith in his son to choose the right thing. It shows tremendous sense of responsibility as a parent – that he’d be able to instil the required sense of right and wrong in his son. No wonder then that his son thinks that he’s a god.

His son is shown to be writing a school essay at one point in the movie. The title of the essay is – Why is the American government the best government in the world? Nick ridicules this essay topic. To him it is ridiculous because the topic makes certain assumptions. It assumes that a) the American government is the best government in the world and b) it is actually possible to prove so. Nick asks his son to question these assumptions. He asks him to ask questions – what constitutes ‘best’?

The movie is about asking questions. Even about the ‘right’ or the desirable things. And just because we’re questioning the right things doesn’t mean that we’re opposing them. It is like giving affair trial to criminals. Everyone may know that they’re criminals, but they’re entitled to a fair trial. After all, how can we be so sure that we’re not at error and the criminal is a criminal? Similarly, how can we be so sure that smoking is bad? And even if it is, should we not be on a constant vigilance about whether we are at error or not?

It isn’t really about smoking at all. It is about at attitude, about a way of living. It is about self examination and self betterment. It is about change and comes through criticism and questioning. Nick doesn’t do what he does because he wants people to smoke. He does it because he wants to do it. He wants to question the establishment, no matter how ‘righteous’ is may seem.

This post is also available on TastySamosas

Discworld 04 Mort

I’ve just finished reading Terry Pratchetts Mort which is the fourth book in his Discworld series. With this book, Pratchett’s writing can be seen to be getting more mature, and more meaningful. In the previous three novels of the series, Pratchett was concentrating on being funny and spoofing existing fantasy literature. With Mort and to some extent even with the previous one Equal Rites he is starting to construct literature of his own.

One of the defining factors of his earlier two books was that he was locally meaningful. What I mean by that is that the novel on the whole didn’t really have an allegorical meaning. But scene by scene you could see the allegory and individual incidents had meaning that went beyond the surface.

With Mort, however, that changes. The novel on the whole is better structured, and there is meaning to the entire plot line. The main character of Mort is Death, who , in his own words, is the ANTHROPOMORPHIC PERSONIFICATION of death. Pratchett maintains throughout his novel that only death is real, because he is everywhere and everything dies, in the end. But death is also lack of change and life is embracing change.

Funny things start happening when Death tried to understand life and goes out into the shady city of Ankh-Morpork exploring the so called pleasures of life – wine, gambling, drinking and dance. And when he doesn’t find any pleasure in those he takes up a job as a butcher where he finally finds peace and solitude, the pleasures of a ‘settled’ life that he had never known. But things begin getting awry in his realm and his new apprentice, Mort, takes it upon himself to keep performing his duties. As Mort takes Death’s horse, Binky, and sets out to deliver souls to the other world, he is unable to stop the Event Horizon of history from collapsing around the damsel who he should have killed but didn’t, out of love, and who is now not dead but should be.

As you can see, the narrative is fast and full of twists and turns and this one is actually a page turner. And like all of Pratchett’s writing, it is infused with subtle humour that is the hallmark of his writing. I think out of the four Discworld novels that I’ve read till now, this one was the best.

This post is also available on Tastysamosas.com