Tuesday, October 05, 2010

On Reality, Truth & levels of Abstractions

Much of the philosophy literature is full of the notion of identity, consciousness and perception. Table is a table and not a chair kind of stuff. What actually exists and what is just our perception.

Chair is a chair. It is made of wood. But no chair is also made of plastic and metals. Even wooden chair has metal nails and may be some glue and polish. Sofa is also a chair. It could have leather or cloth. The wood itself is made of molecules and molecules are made of atoms and then atoms are made of electrons and protons and neutrons, which themselves are made of sub atomic particles.

Technically the reality is based on sub-atomic particles which we can't see.

This brings us to the core conjecture of this post: the Reality & Truth is just a comfortable level of abstraction.

It will be useless to talk about recipe of fried chicken at the level of sub atomic particles or molecules. Or discussing the design of a building in terms of atoms. If you are making a atomic reactor, yes that is the level at which you need to think. May be sub atomic particles are made of further small units and if someone making a atomic reactor cannot explain his truths on current theory, he will further invent a better level of abstraction to deal with those things.

Things are grey, but it is efficient/simple to talk using black and white. Company distinguishes  between the people based on their roles  - manager, developer, QA, architect, etc. Political parties distinguish between people based on voting units or religion or caste or gender or education etc. Banks distinguish the same set of people based on their net worth or ability to repay loan etc. Police looks at them as criminals or non criminals. Doctors would have a different way of people classification. If we don't do such kind of classification to abstract out what is important and what is not, it will be impossible to get anything done in the world. For every one, this is the reality and at the same time it is a comfortable level of abstraction.

Every calculation in the world which uses pi is incomplete and yet we use it because it simplifies life. You can choose as many digits as you like, whatever you are comfortable with. Reality & Truth is just a comfortable level of abstraction, as long as they work, all abstractions are good enough substitute for reality. The only problem is we get so comfortable with these abstractions that we cease to think beyond them which by the way was the very reason for creating them in the first place.  All we need to do is to be aware of these abstractions, so that instead of beating our head on why things are not making sense, just think beyond the abstractions and invent new ones which make sense, until they also break.  The bigger problem is that we share these abstractions with other people in the world and unless they too feel the need, it is very hard to make them adjust/agree to a new "uncomfortable" abstractions (They are comfortable with the current setup).

Newton did a great job at describing motion and then Einstein questioned how do you measure it. Both theories are currently in use depending upon which suites the given problem. Before google all search engines looked at each page as a collection of words and then google defined each page using the link structure around it.  When Zynga copied from other games on facebook, they had figured out that it was not about the quality of the game, but about how do you use the facebook platform to grow the user base. When IBM was thinking PC is the business, Microsoft figured out that OS is what makes the difference and is the strategic point of control.

Well the point is that many innovations in business or science are simply the result of looking at the problem differently, using different level of abstraction. The same is true for any form of knowledge we have ever encountered. Yet the world continues to struggle with what is reality, this is reality and this is not, fighting wars, writing blogs, doing marketing and propaganda. I guess if we could knock off the word reality/truth and simply use abstraction, world would be much much peaceful.
 

Sunday, October 03, 2010

Developers Out There - API 101

 Developers out there:

  • are building their own companies to make money
  • are writing open source software, because they enjoy the respect they get from the community and can make money later by consulting or writing books about their software
  • are making iphone & android apps because people pay for them
  • are making facebook apps, because they get this huge user base of 500 million users. If successful their app can bring huge amount of money from adds, or if they are making games then from virtual goods.
It was and it is about the money honey.

Zynga for all practical purposes is a developer for facebook. If Zynga makes a billion dollars out of virtual goods using facebook, they do bring 300 millions to facebook. Facebook gets a huge screen real estate they can use for advertisements which is exclusively created by Zynga.  May be facebook makes more money from Zynga than what Zynga makes from facebook.  This is called partnership.

The most stupid thing companies do after opening up their API's is to wait for developers to build applications and give no meaningful monetization model to developers. That leaves no other choice except advertisements for developers. Companies like twitter are even worse, who copy the innovation of their API developers and kill them. 

Developers are out their to make money.

1) First figure out how you will make money.
2) Second figure out how you will make money if developers use your API. 
3) Third share your profits with the developers based on how much business developer brings to you.

Let developers make the choice if they want $10 per booking vs $0.001 per add view and how do they optimize their app for their choice.  Developers are not super excited by Facebook, Iphone, Android or Google. They are excited by the opportunity to make it big. 500 million * $ 0. 001 is a big number. But so is $10 * 50K or $100 * 5K or $1K * 500 or $10K * 50.

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.