Monday, September 26, 2011

Optimization is Fun, but ...


The first rule is to avoid premature optimization at all costs. I have literally been at companies that I've seen destroyed by premature optimizations. I can't name names, but just know that doing premature optimization can massively destroy your design and create such a complicated system that when you actually come to your performance and profiling phase, you don't know where to start. The most important thing is to build the right system. Don't take short cuts based on what you believe will affect its performance; build a system that is maintainable, that satisfies getting your functionality out the door, that satisfies getting your system built quickly, whatever your important things are, but don't do premature optimization.
Grabbed this from a coder's blog. A sentiment that I find echoed in so many places. I can think of many situations where people have indulged themselves in premature optimization. I'm using the word indulged because performance optimization is a very interesting intellectual activity and programmers typically love  to say that they're working on optimization. But I am very skeptical of all the imaginary use-cases and performance optimizations that people are forever carrying on before even implementing features and products.

This doesn't mean that we should purposely implement our applications in a shoddy way - we must follow best practices of whatever platform we are working in, we must create a design and architecture that makes sense - but what we shouldn't do is to bend over backwards to optimize something that barely even exists.

I want to round this off with an unrelated but nice quote about Test Driven Development that I found yesterday. It is from a book by Kent Beck; he says - Tests are a Programmer's Stone, transmuting fear into boredom. I hope I remember this the next time I am feeling bored writing tests.

Monday, July 4, 2011

pulse

it is easy to grab a hold of the pulse of the american media and really take your pick in which representation you are more comfortable with consuming every day and what level of balance you desire.

india is a (somewhat) different story. it is easy to pick up two very disparate sources of news (hindu vs indian express). but the spectrum of voices everywhere in between that leads to a better mix of left and right, happiness and sadness, fix-it and let-it-be, is not easy to find.

here is an evolving list of things i can read to widen my perspective. suggestions are very welcome.

thehoot.org
thebetterindia.com
indiatogether.com
caravanmagazine.in

Saturday, March 5, 2011

All in a day's work


There is definitely something therapeutic about Origami. I spent all of yesterday making Origami boxes. I made atleast 9 of them. Square ones, rectangular ones, one with a lid, couple with one divider, one with five divider. Several false-starts and calculations later, I got the perfect box for my earings - check out the one in the center.

One of the most amazing things about Origami seems to be the math around it. The next thing I want to try is modular Origami.

Posted by Picasa

Wednesday, January 26, 2011

बोल कि लब आज़ाद हैं तेरे

On Republic Day, this day, Ilina Sen reminds us to speak up when constitutional freedoms are violated in our country and to hold our democracy responsible for the crimes it commits against its own citizens. She exhorts to no longer stand by the wayside and watch when people are "killed, tortured, humiliated, disappeared, threatened, arbitrarily detained and arrested, falsely charged and under surveillance because of their legitimate work in upholding democratic rights and fundamental freedoms." Her letter can be found in its entirety at http://www.binayaksen.net/2011/01/ilina-sen-writes-to-all-supporters-of-dr-binayak-sen/.

बोल कि लब आज़ाद हैं तेरे
बोल ज़बां अब तक तेरी है
तेरी सुतवां ज़िस्म है तेरा
बोल कि जां अब तक तेरी है

देख कि आहंगर कि दुकां में
तुन्द हैं शोले सुर्ख है आहन
खुलने लगे कुफ़लों के दहाने
फैला हर ज़ंजीर का दामन

बोल कि थोड़ा वक्त बहुत है
जिस्म ओ ज़बां की मौत से पहले
बोल कि सच ज़िंदा है अब तक
बोल जो कुछ कहना वो कह ले