Category: society

  • a bit of refactoring

    In software engineering, “refactoring” a source code module often means modifying without changing its external behavior, and is sometimes informally referred to as “cleaning it up”.

    In particular, adding new behavior to a program might be difficult with the program’s given structure, so a developer might refactor it first to make it easier, and then add the new behavior. Refactoring is also a tool for removing bad code smells that exist in code.

    ~ Refactoring

    what is refactoring?

    Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior. Its heart is a series of small behavior preserving transformations. Each transformation (called a ‘refactoring’) does little, but a sequence of transformations can produce a significant restructuring. Since each refactoring is small, it’s less likely to go wrong. The system is also kept fully working after each small refactoring, reducing the chances that a system can get seriously broken during the restructuring.

    ~ Martin Fowler’s site on Refactoring

    Sometimes code gets messy over time, and investing some time not developing something new, but simply refactoring what already is there, really reduces a lot of time in maintenance results in a significant boost to productivity.

    But the most common obstacle for refactoring is “I’m too busy to do it!

    And so, given a programming task on some old complicated source code, there are two options. One is to straightaway start with the task – wrangling with timelines, struggling to debug and decrypt the code in order to complete a given task. An other is to spend time in refactoring and sorting things out first (with test cases) and then actually start with the given task. Of course there’s no ‘best’ solution but it depends on the situation.

    The first one seems to be the easiest. The second option may require some courage – because there seems to be the somewhat overwhelming risk that it might affect the entire system, introduce new bugs, end up as a dead investment if the refactoring cannot be completed succesfully… all kinds of difficulties!

    Socrates had said…

    An unexamined life is not worth living.

    Not sure exactly what he might’ve meant, but one guess is that he could be talking about refactoring one’s life.

    I’ve actually done that gradually over the past year or so, and have found that it has tremendously improved the quality of my life.

    For example, a lot of time was being occupied in driving around in traffic. I took up a new job (not the only reason of course) and moved to a new house to live in. Now my new workplace is just 15 minutes drive from home. This is not a single drastic event but happened gradually over time.

    One more thing is I gave up ambitions of climbing the corporate ladder gaining a better and better position, to lead other people and so on (and earn higher and higher salary of course!). Instead, I decided my priority was simply to become a “good developer”. Btw this is below the dignity of a lot of software engineers, because compared to a construction industry, programming is like the basic cementing job which freshers from college do. At first this seemed to be a total lack of ambition. But this makes me happy, and I have any interest in impressing anyone with a sophisticated designation 😉 And my new job respects this attitude.

    Another idea is that 4 to 7 PM is the most beautiful time in the evening, best spent roaming around in a park or on the terrace watching the sunset with my son, instead of sitting in front of a computer. Since I have an option to work from home (depending on the project team situation), I often leave for home around 4 PM and really have a nice outdoor evening either on the terrace. continue working from home when it gets dark. This balances working with the rest of the team in the office, and has an added advantage that it also gives me some extra overlap time with my American colleagues.

    The above ideas worked well for me. There are some other things I tried which didn’t work out. But I’m glad I did give them a try, and experimented with life.

    Maybe you may not have the same opportunity (to work from home, for example) but you may have other even better possibilities, if only you would examine with a fresh perspective. I would love to hear your experience if you’ve want to try/have tried out anything new.

    One thing that this speaker he himself is a world traveller travelling all over the place meeting so many people all over the world… had said “I pity you, you meet the same people – same family members – same colleagues – day after day” But I disagree (and also possibly disagreement was a reaction the speaker hoped to provoke). As long as one manages to avoid getting caught in a mechanical daily routine, one can see the newness in every day and in every person around them! 😎

    It made a lot more sense to begin with whatever I have, instead of wishing for something else. I started becoming more sincere about whatever I was doing, including my job. So rather than begin by changing external circumstances, I looked at how I could change the way I was handling them. The external changes happened as a natural consequence, without too much effort.

  • open the door to new possibilities!

    Many times I find it quite hard to get out of a cocoon of what is well-known, and look at something new. I want to cling tightly to whatever I know as safety and security, without ever wanting to LET GO!! 😈

    I hope this photo serves as a reminder that only a very few courageous people attain to Happiness, because only a few people risk all for it.

  • the ultimate treatise on psychology

    Someone asked about a book on psychology, and I thought of posting my reply here as a post. Here is a good simple book that I’d come across around a decade ago… Games People Play by Eric Berne

    (more…)

  • words and their limitations

    Sometimes misunderstandings happen because words don’t always convey what we want to convey.

    “For thought is a bird of space, that in a cage of words many indeed unfold
    its wings but cannot fly.”

    ~ Kahlil Gibran

    Sometimes when a person misunderstands something, instead of seeking clarification, he may (had he interpreted it offensively) actually retaliate with harsh words.

    (more…)

  • cellotaped to a cellphone?

    Prasanna was talking about the cellphone being used in public places to which I’d penned down some thoughts and putting them here as another entry.

    These days cell phone is a big nuisance in such arranged events.. very annoying

    If we really look at the problem… why would a person keep his cell on during a concert…?

    (more…)

  • why respect women

    Part of a forwarded email that was quite nice…

    (more…)

  • Malleswaram Railway Station

    Its all here…

    …Teenager’s Hangout, Philosophers’s Bench-stone, Friends’ Adda,
    Lover’s Rendevous, Pensioner’s Club, Walker’s Fitness Center,
    Family Gettogether Spot. And sometimes… trains come here too 😉

    (more…)

  • Kalam's Song of India

    As a young citizen of India, armed with technology, knowledge and love for my nation, I realise, small aim is a crime.

    I will work and sweat for a great vision, the vision of transforming India into a developed nation, powered by economic strength with value system.

    I am one of the citizens of billion; Only the vision will ignite the billion souls.

    It has entered into me; The ignited soul compared to any resource is the most powerful resource on the earth, above the earth under the earth.

    I will keep the lamp of knowledge burning to achieve the vision – Developed India.

    If we work and sweat for the great vision with ignited minds, the transformation leading to birth of vibrant developed India will happen.

    This song, when sung in our own beautiful languages will unite our minds for action.

    – Abdul Kalam

  • on the streets

    ————————————————–

    This is from my diary, the entries are just as I later remembered how things happened… and I don’t think even I can stand by now for everything I thought/said/did then 🙂

    _________________________________________

    2-July-2003

    Bristol, UK

    ———–

    I went to a public toilet near the city center the other day. It was in the basement, and as I entered it, I was hit by the unbearable stench of an uncleaned loo. It was very strong, and for a few moments I felt some difficulty in breathing. I thought let me finish and get out as soon as possible.

    Imagine my shock when I saw a guy lying down and sleeping there. I could not imagine why he chose this this place of all places!! At first glance, one might think he has fainted. But just when I entered, he had looked up and glanced at me. There was nobody else in the bathroom except for one person using one of the closed toilets [I could see the shoes]. I quickly finished my business… feeling acutely uncomfortable if he was some criminal or some low down guy… he might suddenly come behind me and slit my throat and flee with my wallet.

    I hurried outside without looking back. As soon as I reached the fresh air outside… I found myself feeling sorry for him. I wondered what kind of situation would have made him get into such a circumstance that he had to find accomodation in a bathroom like that. Even the poorest people in India are better off. How many diseases he will be getting breathing in such air!

    I half wondered whether I should go and just give him some money and say “I am taking a gamble with my money… that you will use this to get yourself out of this situation that you are in”. But a moment later I dismissed this thought, if he were to have the insight to use the money, he would not have got himself into such a situation in the first place??

    —————–

    [no date… somewhere around Apr-2000]
    Dusseldorf
    Germany
    ————

    I had been to Berlin Saturday and Sunday, and returned to Duesseldorf Haupt Bahn Hof (main railway station) on Monday morning at 1 AM. Went out of the railway station to catch a tram to go home. Bad news. There were no trams during the night, last one was at around 11:30 PM, and the first one in the day was around 4:30 AM. After some looking around, I found that the only alternative was to take a taxi home, though I had no idea how expensive it would be. It was summer, and the night was cool and comfortable with just a light breeze. I had only around 3 hours I thought I might as well sleep on a bench in the station. But when I tried to go back into the station, I was very surprised to see the security wouldn’t let me in. I tried to convince him that there was no way I could go back to my hotel and I just wanted to stay till the trams started, but I couldn’t convince him, particularly unhelpful was the fact that I was trying to do the convincing in English!

    So mostly out of miserliness to take a taxi, and partly out of a sheer curiosity, I decided to spend the next few hours outside the station. There was a big open space in front of the station criscrossed with tram tracks and dotted with tram stops. And these stops had benches one might barely manage to sleep on. The place was mostly desolate except for some sparsely distributed people, some squatting on the floor apparently on a high smoking
    something, and some lying on a bench. The lighting was a mixture of some well illuminated areas closer to the station, getting dimmer and dimmer dissolving into murky shadowy areas away from it. I picked an unoccupied bench somewhere in the middle, put my backpack as a pillow and my jacket as a sheet and tried to get some sleep.

    Turned out to be impossible. Occasionally the eerie silence was broken by the sound of somebody laughing, or some drunkard swearing and smashing a bottle on the floor. And some bizaare sounds that had no explanation. Hmmm… this is how it was to be a tramp in Germany. Sometimes there would be some kind of streetfight in the distance, and I got tempted to get up and leave… but just a few hours more….

    One chap unsteadily walked up to me as I watched warily through almost closed eyes, pretending to be asleep, hoping that he would just pass by. Then he made me jump out of my skin by extending his hand and asking something totally incomprehensible in German. I gave him the safest reply (by statistical evidence): “Nein, bitte” (no, please/sorry) and after he made a few more queries, that universal answer finally satisfied him and he staggered off.

    Just a couple of hours more…

    Finally after another angry scream from somewhere in the distance, I decided I had enough and took the taxi, which was probably a good idea as I could catch some sleep in my cosy 3 star hotel.

    Later if I happen to stay over in somebodys place and the host asks me “I hope this is comfortable enough for you?” …I can only laugh… “comfortable? its luxury!”

    —————
    Con-woman on Cunningham Road
    April 2002
    Bangalore
    ———-

    I’ve seen her a few times. The first time she approached me I was a bit impressed by her story & acting: she was with a torn medical bill saying that her husband is bed-ridden and she does not have money for medicines.

    Then said I’d buy her the medicines, and conveniently she said there was no medical store on Cunningham Road – I said there’s Wockhard Hospital (for one) and she replied that they didnt have stock 🙂 My theory at that time (around 1.5 years ago) was that she’s probably conning me, but let me take a gamble anyway in the remote chance that her story might be true.

    Later on I saw her doing her act in front of someone else and I knew for certain I had got conned. I went and confronted her “oh the poor chap is still in hospital is it?” And she had the guts to face me cooly saying now it was for someone else!! And the thing is she speaks very well in different languages – depending upon her potential victim, she speaks Kannada, Tamil, Telegu, etc (who knows what else), as fluently as a native speaker, and also speaks pretty good English. And to add to that, shes a really good actress (probably because she’s rehearsed the same scene enough number of times!)

    While its entertaining from one perspective, from another, its unfortunate that people like her make life very difficult for those who are genuinely in trouble. They create a very cynical attitude in the mindset of us city dwellers. It ends up with an attitude of mistrust, where we percieve any person who approaches as likely to “want something from us”.

    I wonder if its really possible to evaluate each person independently rather than think theyre all conmen.

    Hopefully one day we will live in a civilisation where any stranger is trusted by default, unless he/she proves to be unworthy of it.

    —————
    “Hope, it is the quintessential human delusion, simultaneously the source of your greatest strength, and your greatest weakness. ” – Matrix
    —————