Saturday, July 05, 2008

The art of Microsoft (R) Windows (TM) programming

Eric S Raymond has an amazing set of Unix Zen koans here. His book, The Art of Unix Programming summarizes the Unix philosophy extremely well. I've wondered for a while if there was an equivalent for the Microsoft way. The closest I came to was an article by Joel Spolsky called Biculturalism. There were other posts I found on philosophy of specific windows features, but I failed to find anything that describes the Microsoft way of programming.

Recently, we had a talk by Dr. Sundar Sarukkai from NIAS on the "Philosophy of Science". Suggesting that despite it's attempts, science wasn't independent of the observer, and that it had a belief system not very unlike religion, and with its language, mathematics being incomplete, science too was incomplete, Dr. Sarukkai raised a few hackles amongst the listeners. Personally, while I thought that they were all interesting observations I didn't agree with the conclusions he drew from them, but that is a story for another day.

What this talk did though is to force my train of thought towards the station of philosophy - specifically, programming philosophy for Windows. Now, Eric Raymond and Joel Spolsky make the point about the GUI being part of the application instead of being an afterthought (as in Unix), and I agree with that. But a fundamental principle of every Microsoft API is to get programmers hooked with rapid development of basic applications. As early as MFC, you could create a fully functional Notepad application without writing a single line of code. Then there was COM that attempted to hide the complexity of developing distributed applications from you. Today, we have .NET, with LINQ, giving you hidden code generators and attributes for everything from RPC to serialization to workflow management. The underlying principle of all these APIs and platforms is to give users a helping hand when they start, by hiding complexity. In short, a large part of the new Microsoft APIs are tailor-made for the novice-intermediate programmer, who wants to develop a mashup or a cool Forms picture viewer for his grandmom.

This approach has a serious drawback. Because programmers don't have to invest upfront in learning these APIs (instead relying on code generators and other tools/constructs), there is no incentive to learn the basics well. So, when something breaks, or if a programmer wants to do something that the API designer didn't anticipate, he is left high and dry, because he hasn't made the investment in knowing what is happening underneath.

In addition, many crucial features are provided as random attributes or "facts you need to know". Therefore, the transition from a novice programmer to an intermediate one is accomplished by increasing your vocabulary, something developers aren't comfortable doing (I mean, if you could remember things instead of having to learn them, why would you take up computer science instead of history?) Of course, you can turn to your favourite search engine for help, but many times, that isn't sufficient.

The other aspect I've recognized is the preference given to large, monolithic APIs and heavy integration. Of course, it serves Microsoft well to have its tools and APIs jell with each other, but the heavy levels of integration (think for instance, an ASP.NET grid view) and monolithic APIs end up leading to an all-or-none approach that developers are forced to choose between. Customization is next to impossible, and important aspects of the code get hidden from the developers leading to performance headaches and again, maintenance nightmares as the codebase evolves.

I'll update this post as I think of others.

API headaches

As a programmer, you sure have your favourite API-thrashing story. You know, the one where a destructor fails to release memory held by the object, causing an innocuous leak that is only caught when a million-dollar contract is at stake. The one where you need to call a function twice to use it once. And the one where you sacrifice your types at the altar of someone who thought it would be fun to use void pointers in a public interface.

API design is notoriously difficult. This paper says why. Suffice to say that the task of balancing conflicting requirements, for instance, of power v/s ease-of-use, along with constraints imposed by the target language, by the large (unknown) user base, and of issues like maintainability, extensibility, and performance - you have hell on your hands.

Still, I can't help but wonder why the APIs I use on a daily basis have the flaws they have. Why, for instance, does the Linq Aggregate function throw an InvalidOperationException when I pass an empty list to it. Why, for instance, the DateTime class does not comment what its MinValue is, beyond saying that it is public, static, readonly, and is the minimum possible date. Why, for instance, should the Enumerator be modified to check for end-of-container.

I have similar problems with some language features. The illogical distinction between structs and classes in C#. The whole mess created when operator overloading (specifically, op ==) meets reference equality.

I'm just venting. The C# language and the .NET runtime have amazing utility for programmers and have replaced native C++ as my choice of programming language.

Saturday, June 28, 2008

The nuclear deal

So, what do you need to know about the nuclear deal (I won't call it the Indo-US n-deal), to support or oppose it? Very little, actually. All you need to know is that three parties are opposing it - Pakistan, China and the Indian Communists. If these three oppose the deal, you know it is good for the country. You know you should support it, and support the PM, who finally has got a spine, after four pointless years in power.

Beyond the legalese and all the wrangling, what are the commies worried about? Well, as one worthy said: "The deal will make India a US outpost against China." Now, is that necessarily bad? Wouldn't you sup with your enemy's enemy, just as China has done with Pakistan, Bangladesh, Burma, and is now trying to do with Nepal? Why shouldn't we be a thorn in the flesh of the country that invaded us, still holds on to large tracts of our territory, refuses to acknowledge international borders it shares with us, and let's face it, is our competititor in every field of activity?

Incidentally, when was the last time you heard a left leader or that bastion of leftist writing, The Hindu condemn Chinese intrusions into our territory, or Chinese support for Pakistan's missile and nuclear programs, or even their attempts at encircling India with military outposts? What you've heard, I'm sure, is opposition to India's friendship with the US, opposition to India's relationship with Taiwan (which we still don't recognize, btw), or with India's friendship with Israel. In recent times, the communal nature of the Indian communist was also revealed when one of their general secretaries commented that the Indian Muslims were against the nuclear deal. What better example of ghettoising, generalizing, and internationalising an already targetted community?

However, the biggest farce in the whole drama is the one enacted by the BJP. In sacrificing national interest for petty bragging rights, L K Advani has shown that he's learnt nothing from being Vajpayee's right-hand in the government for six years. Shame on you, BJP, for calling yourself a nationalist party.
It is not Hindu fundamentalism or Islamic that pose India's biggest threat. That 'honour' goes to the commies and the pinkos of the country.


Saturday, June 21, 2008

Teen pregnancies. Updated

Read a Rediff article on the same topic:
http://www.rediff.com/money/2008/jun/23mrv.htm
Recently, there was this item in the news, where a group of seventeen "yet-to-turn-16" high school students made a pregnancy pact in the US, and succeeded. The reason? Well, the insidious effect of the coverage that celebrity pregnancies got in recent times. If you keep glorifying unmarried, under-aged pregnancies like that of Britney Spears' sister, and you keep pointing cameras at celebrity pregnancy bumps - what would you expect kids to learn?

A friend of mine who's into fashion, once told me how new fashions were invented. According to him, there weren't many avenues left for creative expression in clothing. So, designers had a choice - either they could drag themes back from the past, or they could shorten or lengthen existing clothes. He gave a very insightful description of how thongs were invented, but in the interest of your stomach, I'll let it pass. Anyway, what was even more interesting was their promotion strategy, which was two-fold: get celebrities to endorse the design, and demean those who stick with existing ones. For instance, to popularize women's pants, they'd associate it with feminism, so that anyone who didn't wear them, wasn't with the times, and was therefore, a supporter of male chauvinism. Similarly, to sell over-sized clothes, you glorify pregnancy, make motherhood the in thing for the times, get celebrities to advertise their pregnancies, and make a quick buck.

Now you know where I'm going with this line of argument. The loonies who control the fashion world, the loonier celebrities who model for them, and the still loonier media that covers these like there is no tomorrow - these are flooding adolescent minds with a steady supply of utter crap. Add to it, declining family cohesion, and the obsession with adultifying our kids to the point that 10-year olds start dictating their parents, and you have situations like the ones Massachusetts is trying to grapple with. With an underdeveloped pre-frontal cortex, adolescents who are not in a position to make sound judgements, are ruining their lives and the lives of others, causing serious harm to the health of a society.

Scroll your favourite maps to India. We have a similar recipe brewing in our midst. Will this soup turn as sour as that of the Americans?

Money v/s Work

Folks who are in the IT field are lucky, in the sense that we are paid well to do something we(hopefully) love. At least, me and many of the people I know in the industry enjoy our work - and some of us do "dream in code". Choices we've made in life would reflect this - we've picked quality of work over money or other considerations, we've always strived, maybe imperfectly, to reach perfection in our work, and we've put team goals above individual monetary gain. However, a question has been bothering me for a few months now: is there a time in life when you should give in, and start looking at the other side of the equation seriously?

It's not that I'm underpaid, or that I feel I don't make enough to sustain a good standard of living in today's Bangalore. But, as you grow older, and hopefully become more mature, you start asking yourself the tough questions, and that is when money comes into the picture.

When I joined my current organization, I took a big hits both in terms of salary and in terms of promotions and 'career growth', all for intellectual and academic growth. Recent developments have made me realize that the compromise on conventional 'career growth' is not a one-time affair, but is something that I'd have to accept as being a long-term phenomenon. As my senior in the org pointed out, I'm now trying to straddle two different boats, and with both pulling in different directions, there is a definite threat of me falling in between. Since one of the boats, that of academic growth is not a very viable option, maybe it is time that I bit the ಕಬ್ಬಿಣದ ಕಡಲೆ and made the switch.

What do you think? Let me know :)

Monday, June 16, 2008

The limits of freedom of speech and expression

Time and again, I've argued on my blog that free speech is absolute, and that the state or "society" has no business setting limits to the right of freedom of speech and expression. However, I must admit today, that there are limits to those rights.


The first limit is accountability. If you are making a statement, you should be willing to be held accountable for its consequences. Anonymous character assasinations are not covered under free speech. Nor is "hit and run" - false accusations, and change-of-topic when someone responds to a point you made.


Second, is preaching violence. Asking someone to kill, rape or maim someone in the name of religion, caste, ideology or any other fault-line.


The reason I'm pointing it out is because I've been reading some anonymous blog posts about a wing of my organization (search for "minimsft" on your favourite search engine), and the shameless way in which, without responsibility, people have proceeded to character-assasinate senior execs in the company. I'm not saying that the senior execs are all dyed in white (which they might be), but if you are making personal, imbecilic, and crude attacks on someone, the least you can do is identify yourself, so that the victim can respond with appropriate action.

Saturday, May 31, 2008

Yeddy, Reddy, Chaddi, and Gaddi.

So, Yeddy has finally gotten his Gaddi with the help of Reddy and Chaddi. While it means a lot for the BJP and for Yeddy himself, I'm not sure that the message is totally positive for Karnataka. Yes, it is a landmark verdict, and the Karnataka voters have largely done the right thing, ridding ourselves of the Devegowda clan's shenanigans, albeit only temporarily. And while this blog welcomes the new government and hopes that it delivers, it remains unconvinced that the rule of the BJP will actually make a difference for the state or for Bangalore.


Yeddyurappa's own shenanigans at the Vidhana Soudha today - conducting a 6 hour Hindu ritual in what should be a secular seat of power, doesn't give us much hope.


Earlier, Yeddyurappa agreeing to break away from the BJP and begging the Gowda's to give him chief ministership, doesn't give much hope either.


Nor does infighting in the BJP over ministries, nor the fact that the Mining Reddys who spent over 60 crores in this election will demand their pound of flesh.


In today's "ವಿಜಯ ಕರ್ನಾಟಕ", ಪ್ರತಾಪ್ ಸಿಂಹ (who is fast becoming my favourite columnist) wrote about the the damage that Yeddy's 'dream budget' has caused to the Karnataka finances. Now, I'm one who says that there is no reason for governments to turn in surplus budgets when farmers are committing suicide, or when large parts of the populace still remains illiterate. However, hand outs are not the answer to the problems facing the electorate. Yeddy doesn't seem to have the mindset required to really bring in the required change. For Bangalore, it is doubtful if Yeddy will override his partymen and restore the BATF.


However, the government hasn't even started functioning, so visit this space in a year for a proper review!



Postscript: This election has really been a mixed bag. While I'm glad that the Gowda family is not in a position to influence the government, and am glad that people like Dharam Singh, the Bangarappa family, and Bangalore's very own Vatal Nagaraj were shown the door, I can't help being sad that an excellent MLA and corporator like K. Chandrashekar (Congress, from Basavanagudi) lost. It is also tragic that the fascist Congress high command overruled its MLAs to deny Siddaramiah the opposition leader's post, instead giving it to a spineless Kharge.

Saturday, May 24, 2008

Racism, pigmentism, communalism

Racism: Why is there such a controversy over the racism (it is really pigmentism* - discrimination on the basis of skin colour) issue in picking cheerleaders (or in asking some of them to leave)? There is already discrimination (let's call it sizeism) in cheerleader selection - why is it that you don't find a fat cheerleader? If your sales item is a body - let's be frank about this - then you have to accommodate the fact that a majority of the people have a certain taste there. In the west, people think thin is sexy. In India, we think white is sexy. Why is one necessarily worse than the other? 'Equal opportunity' does not work everywhere.

I'm not saying that pigmentism or racism is OK in any domain. I'm only making the point that when you are selling beauty, you can't blame people for having a particular taste and for your marketers to cater to it. I've seen casteism and pigmentism at work in my previous company, and believe me, it sucks, even if you are not at the receiving end of it.

Communalism: You may recall how Manmoron lost his sleep when he came to know Indians were involved in the Glasgow blasts, and how (correctly) his 'secular' government fought tooth and nail to get him acquitted. Now, Indian cab drivers are being attacked in Australia, and these are racist attacks, why is the moron silent? Which cat has got his tongue? Why isn't there at least a demarche issued to the Australian mission in India? Well, if you didn't guess it already, it is because the victims are Hindus. If Muslim Indians were targetted, our secular government would have jumped into the fray - now, if a few dozen Hindus are killed out of the 850 million or so around the world, why bother?


* Thanks to a journalist friend for coining the word.

Sunday, May 18, 2008

Blatant International Airport Loot Ltd.

For nearly three months now, lunch discussions in my organization have revolved around the new airport. Last week, I got a chance to preview it first hand - BIAL has a "scheme" to allow MNCs to take teams of employees for a visit, and I signed on. So, what is my conclusion?

As passengers take the first flight out of BIAL, the taxpayer will be taken for a ride.
(Disclaimer: I don't know anything about running an airport, so things may be radically different once the airport actually opens.)

The reason is simple: the airport, particularly the terminal, is not designed to handle anything more than the traffic that HAL airport used to get in the early 2000s. It is tiny, particularly in comparison to what was expected of it. Terminal size of 71,000 square metres is dwarfed even by the Hyderabad airport at 105,300 square metres. And the PR folks at BIAL have the nerve to claim that they can handle 11 million passengers every year, while HIAL with nearly 50% more area claims a modest 12 million. HIAL beats BIAL in aerobridges: 12 to 8, and even in terms of runway width, which our host at BIAL acknowledged is insufficient to handle A380s. The person in question even claimed that no airline was ordering A380s in the near future, saying "why dedicate capacity to something that won't happen in the near future" (paraphrased). Apparently, he hadn't seen this: http://www.livemint.com/2008/01/13235805/Kingfisher-doubles-A380-orders.html, or a million other news items easily accessible from your favourite search engine.

We continued discussions about the airport, and he said that in Phase 2, an identical terminal would be built, taking the total capacity to 50million passengers. Now pray, according to BIAL numbers (which I completely reject), their terminal can handle 11million passengers. If you double of the area, what pot must you be smoking to let you quintuple the capacity!? When we entered the departure area, we were told that the seating could accommodate 1200 passengers, which was definitely a stretch of the imagination. Still, assuming that it can, let's examine the reality. A quick look at the departures from Bangalore between 8:00 and 9:00 PM reveals that there are around 20 flights taking off between those times. Taking a simple number of 70 passengers per flight, we have 1400 passengers. Similarly, peak hour international traffic happens between 00:30 and 2:30 hrs. Anyone who's taken an international flight during those times will testify that the cramped HAL airport had over 1000 passengers during those hours. So, we've already exceeded capacity! How will the airport handle traffic growth, which currently is at 20% per annum?

Now, this is not an accident. Ever since its inception, BIAL has refused to acknowledge the need for higher capacity in the airport, quoting dubious studies, while ignoring the ground reality - 10 million passengers took off last year - and the new airport is claiming to accommodate only 11 million (which, I'll bet is a total lie).

Let's now take a look at its finances. Are the user charges of BIAL, currently at Rs.675/- for a domestic passenger and Rs.975/- for an international passenger are too steep?

Here's a back-of-the envelope calculation. Taking an average charge of Rs. 700 per passenger, and with today's passenger numbers of 10 million per year - we get a figure of 7 billion rupees, or 700 crores as revenue from the measure. The total investment made by the partners is:
  • Rs 375 crore from Karnataka Govt (32.6%)
  • Rs 379.5 crore from Indian financial institutions as debt (33%), and
  • Rs 51.42 crore from the three member international consortium of Siemens Project Ventures, Larsen & Turbo and Unique Zurich Airport
Which means at nearly 900 crores expenditure, the airport venture will break even in the first two years of operating! And without _any_ increase in passenger traffic! OK, they have to pay salaries, there are running costs and utilities, but I haven't considered the revenue they will make out of the airport city, the planned "five-star" hotel, and from all the retail outlets that will be setup in the airport.

In addition, the airport will not allow KSTDC taxies to operate in the airport - what'll become of the livelihoods of those drivers?

These are the issues that Kiran Mazumdar Shaw, Mohandas Pai, and the rest of the rabble rousers must raise. Not travel time to the new airport.
On a final note: we went when there was less than two weeks for the airport to open, and finishing work was still on at the airport. Think about it, this is an airport that the company claimed was ready to open on March 31st! Looks like Mr. Brunner has learnt some Indian habits during his long stay here!


Postscript: It is a shame that none of the channels or the newspapers that covered the airport controversy bothered to present a statistical analysis of the airport, instead relying on sound-bites and "feelings". This points to a drastic reduction in the quality of journalism caused by the increasing numbers of those who come in for the "cool"ness of the job, not its rigor. Few journalists today are trained, or are willing to train, to achieve the analytical rigor that a Sainath, a Shourie or a Gurumurthy have achieved.

Wednesday, April 30, 2008

Freak-o-name-ics

I was trying to clean up my e-mail a few days ago, when I came across a bunch of e-mails sent by my friends who had just named their children. Now, each generation goes through a different trend of "name choosing". For instance, around the time I was born (will keep both the decade and the year a secret :)), one fad was to name kids after communist leaders. So, many kids were named after Stalin, Lenin, Marx, Che Guevera, and similar leaders. Another was to name kids simple, non-godly names. So, out went the Gopals, the Krishnas, and the Ramachandras, and in came Anils, Sandeeps, and the like. My good friend, (who shall remain unnamed) once told me that in the 70s, there was a movement, not just a fad, amongst Indian Christian families to give their kids Indian names. So, out went the Johns and Michaels, and in came Ajits, Ajays, and the like.

Freakonomics writer Steven Levitt talks about how so many people decide to name their kids using similar "principles". He shows that educational levels are a factor. As are income and upward mobility. (I would go on about this, but you should simply read his book. It is AWESOME.)

A trend I observed in the recent times, particularly amongst my friends, relatives, and distant relatives, is one where they name their kids names starting with the letter "A". Anwesha, Anahita, Anagha, Arya, Ankita, Anandita, Anusha, Apoorva, Ananya, Ayush, to enumerate a few. I wondered, Freako-style, why this was the case?

One answer seems to be that there is a trend, particularly amongst the IT folks, to use Sanskritized names. Maybe, it gives an impression of being in touch with Hindu tradition - imagine, someone asks your kid's name, and you say "Anwesha", you can be sure that the next question will be, "oh, what does that mean?", giving you an opportunity to show off your knowledge of ancient Hindu names. :) Or maybe, just maybe, people tried reading Maneka Gandhi's book of Hindu names from cover to cover, and couldn't get past the letter A! :)

Well, I pitched this idea to a couple of colleagues, and one of them responded: "Maybe the names start with A because they want their kids to become accomplished researchers, and become first authors of every collaborative paper they write!". [Editor's note: If a paper has nearly equal contribution from all its authors, the accepted "policy" is to put author names in ascending order of either their first names or last names.]

So much for working in a research lab! Well, what do you think?

Sunday, April 27, 2008

How to become a hero?

So, you are a politician and this is election year. You've done nothing towards solving big ticket problems in your constituency, or ministry (if you are a minister) for the last four, and now people want to know why they should elect you.

What do you do? Well, simple. You find a trivial issue, sensationalize it, and pretend to solve it by victimizing someone.

Let's see some examples. Our health system maybe in shambles, we may have 74 children out of 1000 dying below the age of five (27 in China), 0.8 beds for 1000 people (2.38 in China), 47% of our children are underweight (10% in China), only 42% of births are attended to by qualified personnel (70% in China), and...well, you get the picture. But our do-good minister of health affairs is not interested in these numbers. After all, how can you explain to the electorate that the number of hospital beds is now 0.82 per 1000 - how will they understand? Instead, you can wage a jihad on something visible - cigarettes, for instance. Not satisfied with banning smoking in movies, and not satisfied with having large skull-and-bones pictures put on packs, our worthy minister even tried to edit old movies to remove cigarettes from them! Luckily, saner minds prevailed. Next, the minister targetted alcohol - the no.1 cause for malnutrition deaths, high infant mortality, and maternity deaths. Now, he is targetting junk food - your next meal at Mc Donalds might actually come with a lecture on good eating habits! Or, the next time you buy a can of saturated fat, you could be made to attend a refresher course on the evils of cholesterol.

Anyhoo, another candidate in this space is the most cultured home minister of Maharashtra. Now, I don't know much about Marathi culture, but if you believed the minister, it would mean antagonism towards bargirls, towards cheerleaders, and towards "modern" clothing, while turning a blind eye to the violence perpetrated by goons supporting one political family. It would mean supporting weird notions of Marathi pride, including burning books written on Shivaji - who in his time, established a kingdom of tolerance and respect. It means targetting the innocent, and letting the vile go scot-free.

India, my friends - the latest "super-power".

Tuesday, March 25, 2008

National mess

I was watching "Chak de India" yesterday, with the book "Billions of Entrepreneurs" by Tarun Khanna in my hand, while simultaneously flipping channels to get a glimpse of a debate of sorts about Indian hockey. The movie is awesome, and is right up there with the classic "Remember the Titans", but that is not the subject of this post.

It just struck me that in the same month as the national animal is found to have suffered it's greatest loss of numbers, the national bird lost two dozen individuals and the national sport faced its worst defeat ever.

The conclusion is clear. Anything that gets tagged as "national" in our country goes to ruins. Readers that are old enough might recall the obsession with the electronics industry in the 80s. It was given "national importance" - which led to its suffocation. Programmes like Garibi Hatao that grabbed national attention were a disaster, as were attempts at "nationalization", banks, for instance, forgetting the customer completely. No one watches the national channel (DD-1) unless they are forced to, the national games are a sleight of hand, and our national interest is discarded at the bidding of opportunistic politicians, the nuclear deal being a good instance.

Similarly, our national song is submerged in controversy, our national flag represents how shamefully we allow differential treatment of our citizens, and those who give up their lives for their national cause are treated shabbily.

Is there a silver lining in the national cloud? Probably. Why don't we nationalize garbage? That may cause it to disappear. Or make corruption our national pastime? We could also try making our politicians national animals - they might go extinct then!

Any other ideas?

Sunday, January 27, 2008

The case for India

This is the title of Will Durant's awesome book on India. As I mentioned in my earlier posts, I've been reading a lot of India books lately, and this one is probably the last on the list. Written in 1930, the book, banned by the British government, and God knows why, never resurrected by the Indian governments, is an excellent account of how the country was raped, with the connivance of our own people, for over 200 years by the British.

The figures are amazing. Robert Clive, the resident governor of Bengal, getting an annual tribute of US $140,000, in 1930s money. The national debt of India, which was really caused by twisted pricing of goods, rising to a whopping 3.5 billion dollars by 1929, the cost of maintaining the British army in India was paid by Indians, to the tune of 200 million dollars a year, wars, in which Indian troops fought for the British were paid by taxes on Indians, to the tune of 1.2 billion dollars in the late 1800s, all of these reducing India from the second largest economy in the world in the 1820s to a basket case by 1947.

The book talks of how Indian industry was broken and how farmers were driven to penury in supporting the opulent lifestyles of company and British officials. What is more shocking is the kind of torture inflicted upon the common men by the British:

"A troop of English soldiers had reached the spot, and without warning, began firing into a crowd that had women and children. [...] Some people got as many as twenty-one bullet wounds in their bodies. [...] A young Sikh boy stood in front of a soldier and asked him to fire at him, which the soldier unhesitatingly did. Similarly, an old woman [...] came forward, was shot, and fell down wounded. [...] The police snatch off the men's garments, twist and squeeze the testicles, and even batter them until the victims foam at the mouth and become unconscious."

Madeline Slade, an eyewitness, says: "And so we went on from this house to another. [...] 1.Lathi blows on head chest, stomach and joints, thrusts with lathis in private parts, tearing off loin cloths and thrusting of sticks into anus, dragging of wounded by legs and arms, beating them, throwing of wounded men into thorn hedges or salt water, thrusting of pins and thorns into men's bodies..."

What stands out in the book are these:
- The extent of torture and exploitation of the British
- Active connivance of Indians in the British services, including the police force
- The bravery and determination with which "ordinary" Indians fought for freedom.

After reading this though, I started to wonder. As a country, we have such a poor sense of history. Our Moronic PM, intoxicated by a doctoral degree, praises British rule. Common people have no clue about how we won our freedom. Even educated people think the positives of India are the grace of the British.

Read this book. Buy this book. At 140 pages, it is not a long read. And let me know, if like me, you kept wondering whether we have simply replaced a white brute with a brown one after Independence.

Happy Republic Day folks!

Saturday, January 26, 2008

Can't dynamic languages scale?

See this: http://www.manageability.org/blog/stuff/chandler-failure

BTW, if you don't know what Chandler is, ask for my copy of "Dreaming in Code", by Scott Rosenberg. It is an amazing read, and a must for any software engineer.

If cabin crew were replaced by autodrivers.

Last Tuesday, I flew to Hyderabad to attend an "Advanced C#" course. My flight from Bangalore was scheduled during the evening rush hour, and we spent nearly 20 minutes at the edge of the runway, waiting for planes to land before we took off.

As I saw the planes land in a single file in front of us, a sinister thought entered my mind: "What if we removed all cabin crew and replaced them with Bangalore auto drivers?"

Well, at first, my plane would have made a mad dash to get on the runway before the last plane landed. We'd have the sight of two planes rushing in a V to get to the lone aerobridge (domestic) in the airport. Cabin crew would snort and turn their heads if you asked them which flight flew to your destination. Your onscreen monitor that shows remaining distance and time would be tampered, and your credit card deducted by amounts much more than the advertised "fare" when you flew.

Oh, in mid-air, pilots would refuse to continue to your destination unless you paid extra.

What else do you think would happen? Use the comments field below.
Postscript: Kingfisher airlines now has a fuselage mounted camera whose footage shows up in one of the inflight channels. Guess what the camera caught on the Hyderabad runway, just as we were about to take off? A couple of dogs taking a break from their rounds of the airport! And the AAI Hyderabad employees have the nerve to protest against the closure of the airport, stating it is against public interest! What do these worthies know about the public?!

Thursday, January 17, 2008

Star gazing on a cool January night

If you didn't know, winter is the best time for star gazers in India. The nights are cool, the sky is cloudless, and throw in a new moon night and a power cut - you have a star gazer's paradise. Turn to the north, and just above the horizon, you see the pole star - our own Dhruva taare. A little away, the Saptarshi mandala or the Big Dipper. Turn your head 90 degrees and you see the brightest object in the sky, Venus, and as you reach the perpendicular, the belt of Orion.

When I was eight (or maybe seven), the science club in my locality got hold of a telescope. Boy, were we addicted!? Every night in winter, we would go up the stairs of my friend's place, position the telescope and keep watching. Of course, the telescope was a manual one, which meant that if you didn't look through the lens in 30 seconds your star was gone (due to the rotation of the earth). We had a pair of binoculars that we could look through, star charts for reference, and even a powerful torch to point at a particular star. To add to our viewing pleasure, the Karnataka Electricity Board (as it was known then) turned off power for half-an-hour at night everyday.

Today, I spent most of the late evening gazing at the stars, and trying to recollect names for them. The pleasure of lying down on your back gazing at the sky has to be experienced to be believed. No wonder early men thought stars were night-time landmarks created by God. Just seeing the stars twinkle away as newer and newer ones grace the skies every minute is simply overwhelming.

Unfortunately, the city has grown so much (particularly towards the north) that many stars that graced the horizon are no longer visible. Maybe one can get a better view from a place like Nandi Hills...hey, I can drive!

Sunday, January 13, 2008

What is so great about Python?

No, I'm not making a statement. I'm asking a question. What is so great about Python? I made some faltering attempts at learning it, mostly through reading the O'Reily book, "Learning Python" and experimenting with some trivial programs.

So, what makes Python so great? Of all the answers I've heard, the most irrelevant and pointless answer seems to be the significance attached to indentation. Apparently, unlike other block-structured languages like C, Python has no delimiter to demarcate the start and end of a block. So, a program that looks like:

if ( x == 0 )
{
    printf ("This is crazy\n");
}

would be transformed into:

if ( x == 0 ):
   printf ("This is crazy\n");

Apparently, the founder of Python was so frustrated with the poor indentation that many C programmers use that he decided to make indentation a significant aspect of the language. So, why should I, someone who always cribs about other people's poor indentation styles, have a problem with it?

Well, simply because this is a fascist solution to a simple problem that can be solved by a keystroke or a command (depending on your environment). We don't need a language to force us to do this, in the process causing more problems than it solves. Think for instance, you are looking at a 1000-line Python file, and accidentally you hit a tab or a space. A 'worthless', 'invisible' token like whitespace will now give you logical nightmares!

Any other features that are useful?

Saturday, January 12, 2008

The GOD delusion

Update See Dawkins at TED: http://www.ted.com/index.php/talks/view/id/113


"The God of the Old Testament is arguably the most unpleasant character in all fiction: jealous and proud of it; a petty, unjust, unforgiving control-freak; a vindictive, bloodthirsty ethnic cleanser; a misogynistic, homophobic, racist, infanticidal, genocidal, filicidal, pestilential, megalomaniacal, sadomasochistic, capriciously malevolent bully.”


These are words of Richard Dawkins - author of the "best-selling" The God Delusion. I've mentioned previously about my appreciation for Dr. Dawkins' work - notably, The Selfish Gene. The God Delusion is another classic from his pen. An extremely provocative book, The God Delusion continuously challenges believers of all kinds to justify to themselves their religious values. Why, for instance, do we accept a God that asks for human sacrifice? Why do we accept a God that tells us not to seek the truth?


Richard Dawkins was a good friend of another great author: Douglas Adams of the Hitchhiker's guide fame. Both read each others' books many times, and Richard Dawkins gave Douglas Adams' eulogy. Both were(are) atheists. For instance, do you remember this line from the Guide?


"And god disappeared in a puff of logic."

Unfortunately, in the real world, there doesn't seem to be an end to people who would go on believing in the falsehood that there was a God that created us. Some would still believe that the Earth was created in six days, some others may believe that the Earth is only 6000 years old. Well, this is a book worth reading, irrespective of whether you believe or you don't. Dawkins tends to rant a little bit every now and then, but he has kind words for India's founding fathers, believes that the creation of Pakistan is a classic example of the trouble religion has caused, and most importantly, presents a very convincing argument for why we don't need religion.

Read it.

Sunday, January 06, 2008

Who is racist?

http://www.smh.com.au/news/cricket/a-class-act-opinions-differ/2008/01/04/1198950076545.html?page=3 : A piece from the 'secular' Australian media.

And a good riposte: http://content-ind.cricinfo.com/magazine/content/current/story/329291.html

Harbhajan is banned on no evidence, every Australian is let off - Sharad Pawar, if you have an iota of shame, bring the Indian team back home.

Disaster at Sydney

I'm writing this post even as the Sydney disaster is unfolding on my television.

We've all seen how eight to ten crucial decisions have gone against the Indians. We've seen how the 14-member Australian team (Bucknor, Benson and the third umpire forming the new 'tail') has taken gamesmanship to new levels. We've also seen how unsportsmanly Ricky Ponting and his men have behaved, particularly in the fourth innings of the test.

Those interested in cricket history will know that this isn't a first for the Indians. Repeatedly, repeatedly, the Indian team has been at the receiving end of umpires, match referees and other officials.

What is most shameful, however, is the reaction of the Indians, in particular, Kumble. Every time things have gone against India, the players and the BCCI haven't protested. Other than the Mike Dennis incident, umpires, match referees and other officials that have been unfair towards India have gone scot-free. Like in this match. There hasn't been a single word or protest. This match should have been nullified. It should not go into the record books, for the sheer lack of any cricketing law being in operation. But who is taking cudgels on the Indian team's behalf?

This is a test that a rising India will face repeatedly. Questions will be asked of India's determination, not just in cricket, but in politics, defence, economics - to do the right thing. Questions will be asked that will require firm, hard answers. Every nation that aspires to become a sporting, economic or political power faces these: China, on the question of Tibet, Sri Lanka, on the question of Muralitharan's bowling, or the US, on the question of terrorism. Nations that succeed give the right answers, remembering that there is a thin line between churlish protests, and just, effective ones.

India, unfortunately, isn't one such nation. We will burn Mike Dennis effigies, maybe shout from the rooftops about trade barriers, and put our collective heads into the ground when China sets up military encampments in our territory. However, we'll refuse to lodge protests against unfair umpiring, we'll refuse to use our clout in the ICC to get rid of referees and umpires that are against us, while not thinking for a moment in manipulating the system to get a Dalmiya or Sharad Pawar into the ICC chairman's post. We'll let countries like Bangladesh walk all over us, not just in World cups, but also on the borders.

Dhimmitude: something India has honed into a fine art.

(On an aside: There is a small distinction between cribbing and complaining. Kumble did the right thing by not cribbing about lack of match practice after the Melbourne debacle. But not complaining about third-rate umpiring? That too after 8-10 abysmal decisions?)


(Aside 2: I wonder how the Dhoni/Yuvraj/Deepika thing is working out. First, Dhoni walks the ramp with her, is impressed, and invites her to watch him play. Then, the lady in question arrives, rejects Dhoni and 'elopes' with Yuvraj. Now, Yuvraj and Deepika are an item, and with them setting off the 'snoops' in all Sydney restaurants, what is the state of the relationship between Dhoni and Yuvraj?)