Sunday, October 03, 2010

Ayn Rand

I liked Ayn Rand when I first read her in 1999 but something about her writing kept disturbing me for a long time.  Their was something inhuman about the characters.  

I believe Ayn Rand characters are automata, finite state machines. They don't wonder, or get surprised,  or grow or evolve. Every decision they need to take in their life is decidable without an iota of doubt. They are able to model every situation, are dead sure about their model and can find their optimal response.

This, I believe is not quite true for humans.

Friday, October 01, 2010

The Idiot Religion

  • All follower of this religion are idiots.
  • They are open, acceptable and proud of the fact that they are idiots
  • Every one who doesn't follows the idiot religion is intelligent and hence all idiots are expected to be very respectful to everyone who is not an idiot.
  • Idiots don't have any God of their own and they don't care about who started the world or what will happen after they die.
  • Idiots value human life and everything created, invented, believed by humans including all possible Gods, languages, roads, buildings, property, schools, etc.  
  • Idiots forgive. As idiots they are expected to make mistakes.
  • Idiots always question their own beliefs. They are idiots and hence could be wrong all the time.
  • Idiots understand that world is neither fair not perfect because it is run by idiots. Hence for their own goodwill and for the goodwill of the world, it is important for them to always try to improve their understanding of the world and use it to create a better world. 
  • Idiots use consensus or probabilistic voting to take collective decisions. As idiots their decisions are anyway idiotic which is by definition acceptable behavior. They can always revise their decisions if they don't work as expected.   

Tuesday, September 28, 2010

Writing High Performance Software

After working for five years on http proxy, caching, high speed file logging, distributed quota, I believe the following summarizes the results of my experience.

1) Make sure you use all the CPU
2) Reduce your CPU usage

As innocent as they look, they are by no means simple to achieve.  Locks, system calls, network settings, kernel, number of threads, contention, context switches, memory allocation, etc will make it difficult to saturate the CPU.  Reducing your CPU usage is comparatively easy, just use the profiler. This itself is a bit tricky because some profilers will use global locks when collecting data points and we get a perfect example of Heisenberg Uncertainty Principle in action. 


I think of software in three dimensions. Speed, Simplicity and Power. 
Speed       - How fast it runs 
Simplicity - How simple is it to use / maintain 
Power      - The range of problems that can be solved using it 


Think iphone. Think SQL. Memcache has speed and simplicity, but not powerful enough. 


Writing high performance software is fun, but don't forget the simplicity and power aspects of it. If it is not simple and not powerful, most likely no one will care about how fast it runs. If you make it simple and speedy, your target customer set becomes small. Not everyone is solving the exact same problem. Make it speedy and powerful and customers will have tough time using it. They will probably claim it is not powerful, because that power is hidden, not simple enough to use. Make it simple and powerful and not speedy,  customers will compare it with some other product which has high TPS and won't buy. Not that they need the speed, but only to future proof their investment. Every customer feels they will grow and need more and more. 


Overdoing speed, simplicity or power will have some impact on the rest two. Make sure to choose the right combination. 

Sunday, September 26, 2010

Apples and Oranges

Rs 12 is more than Rs 10.
20% growth is better than 18%.
140bhp is more than 120bhp.

It is easy to compare apples to apples. Any one who went to school can understand it. Doing something better than something you have already done is of course  easy to figure out. Study harder and get more marks. Put in more hours and try to get another feature in the release.  Hire more people to get the work done faster. This is natural usage of high school math.

Science or Arts, Medical or Non-Medical, MBA or MS, Job or Business, India or US, stocks or cash. Most questions of life which are worth their salt will force you to compare apples to oranges. Some people tend to be believe they can compare anything using their monitory value.  Well ask them to choose between accelerator, brake and steering.

1  +  1 =  2

1 electron   + 1 proton    = 1 neutron
1 cannibal  + 1 cannibal = 1 cannibal

1 manager  + 2 developers = some work done
2 managers + 1 developer  = don't know
0 manager + 1000's of developers = linux kernel

Math abstracts. It makes us blind to details.  It is good to be blind to details and then it is also bad to be blind to details.  May be you are not dealing with all apples. May be you have few oranges and bananas.
Prerequisite to comparing apples to oranges is realizing you are dealing with not just apples.

Saturday, September 25, 2010