Monday, October 26, 2009

Patience Vs Speed

Today, I felt rather calm and as I sat down and relaxed for a few minutes, some questions came to my mind. I don't remember them all now, but one question stood out - it was the question of patience vs speed.

Society recognizes both of these as virtuous qualities, but they seem to be conflicting. How do you differentiate the one from the other.

I did an online search. I came across one article that captures the difference very eloquently. I will quote it here:
It’s important to realize that patience isn’t the same thing as being slow. It’s a mindset thing, not a factor of how fast you are moving.
I could not agree more. Just reading it, it made a lot of sense. I think this is something I should make a part of who I am. Patience is a state of mind. Speed is a state of action. You can be patient, but you can act fast when the time is right.

The author was Sarah Lacy at TechCrunch and this was the article: "China: Where Patience Meets Speed".

Labels: , ,

Friday, November 7, 2008

Object Overkill

I wanted to create an address-book/contact-management type app in PHP yesterday. I started off with a Contact class (which is based off of the contact table) and typed up the private members, then wrote the get and set accessors.

Now, I had to focus on other things that make the class usable - CRUD (Creation, Read, Update and Deletion of records). I coded the constructor, which would take care of the creation; after an instance is selected, the get accessors can be used to do the reading - but a function for instance selection was needed - I coded this as getContactById where id is the unique key; I also needed functions for multi-record (subset) selection; updates would be taken care by the set Accessors; I coded a deletion function deleteById ... at this point, I got really frustrated! Thinking about it, the task I want to do is something really simple, but the amount of work/coding I was doing was disproportionately large.

I was very sure I could have coded the whole thing using procedural programming much faster. I felt very confused for an instant, this whole idea of object oriented programming did not make sense! of course, object oriented programming aligns more naturally with the way we think and all, but the amount of work was unacceptable!

Deep Breadth....Sigh....

Ok...ok...so what went wrong? and where? Doing some introspection and reading on the basics of OOP, I realized, I got carried away in my amazement of object oriented, the "clean"ness, the coolness...the ideas and concepts (like design patterns etc)...and what it made possible.

Here is what I have concluded, OOP is not a swiss army knife, its rather a complex instrument - something like a drill machine. Its powerful, it can do a lot of thing, but it is heavy and needs electricity.

Say I needed to screw one screw in, if I insisted and forced my self to use a drill machine each time, I end up doing a lot of work...when it was not necessary. I might have as well used a screw driver...and saved my energy and some power...and get the job done faster. On the other hand, if I am working on making a model of something which requires a lot of drilling, the drill machine would make more sense.

Simple, I know! But sometimes we just carried away, that we forget the simple things. We forget to think before we act, since we have trained to look at something/and act on it in a specific way.

Moral: Before attacking a problem, clear your mind, keep your mind open, think out your options and figure our what makes sense? what is the best way to do it? Do not blindly follow a general approach!

Labels: , ,

Saturday, September 20, 2008

Thought: Food and Weight

Today, I had some home made desert made of fruits and condensed and evaporated milk. I believe that the amount of fat in these milks is really high. But the amount of the milk we added to it was little (2 teaspoons I think).

I started thinking - if I eat something thats 20 grams, how can it result in me gaining more that 20 grams of weight. Then this is how I figured it probably is like: a 100kb file in 1 file system when moved to a different file system may take up 110kb in the 2nd file system - because of the file system's structure and layout I am guessing. Similarly, the 20 grams of food is processed and converted to our body's file system, which may result in us putting more weight.

Thinking about it some more, I figured the above would be a violation of conservation of mass; this is what probably happens when we eat high fat things like the condensed milk, and later drink water or other fluids, the body starts retaining it to match the fat level. Thus we put on weight. The key to our weight would then be the amount of water in our body (which - the water retention - would depend on the other things we eat).

Labels: , , ,