Perspectives from the *other side* on Software, Management and Life

Saturday, December 25, 2010

To Write or to Rewrite

Anyone who has ever managed engineers would know how most love a clean slate. Its natural to want and yearn for a clean canvas where the engineer can let loose their 'creativity' and 'architecture' sense.

That stated, most real world problems require adding to an existing structure. For software engineers, that means working with an existing and typically significant codebase that may crumble if not handled correctly when adding functionality.

I've seen software engineers attempt whole re-writes just to avoid reviewing existing codebase and its associated delicate handling. The question being when is a rewrite justified, and my rule of thumb is:

Do Rewrite: Existing code is in a technology that is outdated, or is written in spagetti code, or has Systemic issues (security, scalability, performance etc). All of these stated classifications must also meet the criteria that any enhancement or fix done on top of the existing code will require more time than the rewrite. The enhancement can be the specific task or group of tasks in the roadmap.

Dont Rewrite: Existing code is more or less feature complete with possibly a few glitches.

The reason to avoid a rewrite as much as possible is that code generally evolves from its original specifications, and while attempting a rewrite a lot of unwritten specifications are overlooked thereby arriving at a rewrite that is functionally less mature as well as possibly suffering the same issues that exist in the older code.

An interesting experience I had recently around this subject was with my ATS (Auto Transfer Switch). The picture of which is above. The Magnetic Connector got worn down and I asked a electrician to replace the specific component. He stared at the circuit for 15 minutes and then prescribed that he needed to completely rewire everything (and will obviously charge me for it!). On my insistance that only one component is broken, and he just needs to make sure the replaced component is installed correctly, he refused to take on the project since he had no idea of the circuit. It was obvious to me the electrician was more a creature of habit and preferred to work on circuits created by him so as to avoid having to use diagnostic tools to determine where the '0's and '1's are. I knew he'd create a similar layout and then I'd have the same problem if I ever called in a different electrician with similar traits. So I stared at the circuit for about 60 minutes after he left and it finally made enough sense for me to do the replacement (which was a 10 minute task!)

Wednesday, October 06, 2010

Empowering Employees



Great companies have empowered employees, and they're trusted to make the right decisions. However often we come across cases where really smart employees make the dumbest of mistakes. It shakes up the whole notion of delegation and if indeed micromanagement is the way to go (not!).

I recently came across a three letter acronym that tied up a lot of loose ends of such thoughts. The magic acronym being FAE (Fundamental Attribution Error). In summary this means that when we observe the behavior of an individual, we overly attribute it to his/her personality traits rather than the environment or context.

As an example, software engineers might be writing extremely poor code not because they're bad engineers but because:
1. Timelines - the team manager might overly emphasize timelines and not enough on quality. This will cause many good engineers to unlearn their good practices for ones that get the job done in the eyes of their manager, and at least in the short term keeps things running.
2. Precedence - if a new engineer is added to a team where best practices are not implemented, but rather the only form of measurement is getting the task checked off in the project plan, then they'll do as 'When in Rome, do as the Romans!'
3. Extreme Pressure - too much pressure (such as regularly being threatened on loosing pay/job if ...) makes things worse then good. Under extreme pressure, the 'thinking' part of the brain for most individual stops working and the primitive one takes over. The goal is to just make it to the next day without concern for making the best decision, which relates to something that lasts, scales and all the other goodies!
4. Context - Logical decisions require understanding the context. If a developer does not understand the bigger picture, he/she is likely to make mistakes since the context does not exist for evaluation of the trade offs for the design decision. So each and everyone in the team should understand what the end goal for the team is.

So next time round, when dealing with a generally smart employee having made a poor judgement call, do think if it relates to the context/environment. And if it does, how to go about changing the environment to ensure it doesnt happen again to other employees.


Labels:

Monday, September 13, 2010

Operation Flood Relief - Swat, Pakistan

Picture 1: Thumb prints along with names and id card numbers of those who were identified by a survey team and then received the rations
Picture 2: This river flowed on the far left corner, while a road and houses existed where the river is now. All points beyond where we were standing were now cut off with no access to food supplies. The river was originally 50 m across, now its 230 m!

Picture 3: This is a blurry picture of a US army helicopter participating in the relief effort.
Picture 4: Just one of the many bridges washed away by the floods.

A few weeks ago I got the opportunity to participate in a flood relief effort that a friend of mine had organized. Knowing my friend to be a good planner and executioner, I took it on to accompany him during one of the many trips he'd carried out for the relief effort. Here is a narrative on my experience.

Purpose: The specific relief effort that I was part of consisted of approx USD 16-20K of food items (with due thanks to a lot of individuals that my friend had been able to reach out to). Each assigned person was to receive 2 bags of food. Which was:
a. 20 KG of Wheat
b. 20 KG of misc items including: Rice, Cooking Oil, Sugar, Tea, Onion, Potatoes and Pulses

Scale: 500 families were targeted ie 500 x 2 bags = 1000 bags = 40,000 KG's of food.

Strategy: A local NGO was picked to provide administrative support. The benefit of local on-ground NGO's with active presence during the pre-flood days being they have good awareness of the ground situation as well as crowd management, a major issue which I'll refer to later. The particular NGO picked during my trip was MuslimAid, a UK based charity organization.
Our original goal was to target Mianwali, a city in Punjab submerged by water, but thanks to the feedback from the NGO, it was made clear that this particular town had now started receiving flood relief and aid. Swat, an area in the north western area of Pakistan (now known as Khyber Pakhtoon Khwa) however was not receiving much aid and the situation there was quickly becoming catastrophic. So Swat became our target area. Specifically Bahrain, Kalam and Uther town residents (there is no road link to any of these towns at the moment)

Execution: Three trucks loaded with relief goods were prepared with the help of MuslimAid, and directed to move towards Swat. In parallel, an on ground team started the survey of affected families and handed them coupons for collecting the ration items at a pre-stated distribution point and time. Most of the families sent an adult member or two to hike to the collection point to bring back the ration.

The trucks reached the point of distribution in the morning while we (NGO rep, my friend and I) headed off to the area separately. At the pre-determined time of distribution, the NGO rep first gave a run down of the distribution strategy to those who had gathered. Only those who were in the list were to receive it, so others need not wait. And being orderly was a requirement since everyone on the list would receive the rations, and it may take some time but at least no one would be hurt in the process.

Most of the folks had come after a day or ever 2 days of trek. Swat is unique in the type of flood devastation since it was not devastated by the water coming into the towns as its a mountainous area, but because of massive landslides. The landslides had cut off major towns of the area that were known to be dependent on the lower areas since vegetation and food items were not grown in abundance at high altitudes.
Most of the rivers had carved out 2x areas for themselves. An analogy would be to assume the grand canyon was populated by thousands of people and the road network to be around the cliffs of the Colorado river. And the river suddenly swelling up and eating away all the bridges and most of the road network by carving out double or even triple area for itself leaving people stranded on cliffs and mountains (those who were not washed away) with no food.

As the folks came by one by one on their name being called, they lifted two bags weighing 40 KG on their backs; an immense sense of sympathy struck me on what still remained for them to return back to their families. A trek of a day or two with two bags weighing 40 KG must be back breaking. I do hope all of them reached their loved ones and they were able to have a decent meal to eat for a few weeks (our estimation was the ration would last a family of 5 around a month).

Conclusion: Relief effort is not for the faint of heart, although I believe we should all make an effort to participate with on site presence, since it helps ensure minimization of wastage since food is not dumped in the wrong areas or distributing of wrong items is fixed by enabling quick feedback to the stakeholders.
And by using on ground NGO's or other individuals well versed with the locals, who have done their homework in terms of identification of needy families and individuals, the distribution can be extremely gratifying knowing its going to the needy who may not be strong enough to stand random food throws from the sky or fast moving trucks. The planned effort also ensures:

a. Fairness - Relief goods that get thrown from trucks or helicopters in crowds typically lead to the toughest men receiving it. It truly is the law of the jungle since every man and women are up for themselves in trying the snatch whatever they can grab for sustenance. The worst affected individuals suffer since they're typically too weak or hurt to be in the crowd.
b. Civilness - Random distribution leads to reinforcement of unruly behavior during relief distributions. We observed a distribution of water bottles during our trip (claimed by someone to be from Jazz/Mobilink), where two individuals were throwing away bottles and two were using sticks to fend off the crowd from climbing into the truck. Once they left, it could be seen that a few folks had a few packs of bottles while most had nothing. The sad part was that this area had ample clean water since Swat is an area of natural water springs! It was food that was scarce.
c. Measurable benefit - All individuals who collected the relief items were checked against their national ID card number to be residents of the affected area in addition to having the coupon and listed in the survey list. The ID card numbers were then to be submitted to the local administration to ensure they know which families have received rations to facilitate other ongoing reliefs. Of course, I think its obvious the lists would not be used by local administration since they're not known for their competence, however that shouldnt be a reason for not following through on this practice.

Miscellaneous: A number of helicopters could be seen flying, both Pakistan and US army. It was heartening to see US army active in the humanitarian relief effort since the only way to get food to the worst affected areas is to ask the folks to do the 1-2 day trek (like we did), or use helicopters.

Wednesday, June 30, 2010

Want a root canal with that?

You must have heard "want french fries with that", if you didnt then you must have been living under the rock! I think it was McDonnalds who introduced this famous quote thats used as the defacto lingo for cross-selling products. In simple terms, just through a simple statement a salesperson can increase a company's revenue by selling additional items related to the primary sale.

Since this blog is about me and my experiences, here's whats gotten me all worked up. Recently I had the opposite experience of being sold something. I am a LinkDotNet ISP subscriber. It has the ugliest looking website for one, but hey the internet was fairly decent for the past year. It had its hiccups every now and then but I was fairly satisfied.

Then came the odd event, my phone line tone goes dead (those who live in Pakistan and have DSL know this to be a common occurrence). For some reason, some moron engineer in the exchange swaps out the phone line/configuration which causes the data/DSL to continue to work, but causes the voice service to go dead. FYI - Pakistan's phone lines are run by a monopoly called PTCL. It went through "privatization" a few years ago, which was marred by under hand deals and was sold to Etisalat, a UAE based telco. Lets just say, ME based firms arent really known for good governance, and selling a white elephant to a firm with weak governance background is a disaster recipe. Thank you Musharraf, you continue to haunt us!



Back to my story, I called up PTCL (the land line provider) and asked that they fix the dead tone, which they did pretty promptly. However my DSL stopped working as soon as they "fixed" my voice service. I then called up LinkDotNet assuming these guys would be able to get my DSL working even faster, after all they're a private company with lots of competition........ I was wrong. After a few days of following up, I was told to "go to the exchange, and get a written statement that your line needs to be shifted to our (LinkDotNet) switch". Hello? Are you in the 21st century. Me going to a telephone exchange, wasting my day trying to figure out who to speak to (PTCL probably has the highest ratio of employees to consumers - which happens when brain dead politicians rule and state owned monopolies exist).
I politely stated that hell would have to turn cold before I go to an exchange just for getting my Internet to work, after all I didnt have to go to an exchange when I signed up for LinkDotNet. They said its a PTA (regulatory body) regulation, to which I responded that the regulation (similar to how its in the US) is to ensure consumer rights. And its so that the DSL providers cannot be changed without getting the consumers consent. Since I've been on LinkDotNet for over a year, why should I be required to submit this paperwork - to the contrary they ought to complain to PTA about PTCL not providing them access to their consumer's telephone line.
I even went to the extent of emailing a C level officer at LinkDotNet, but havent heard back. I've tried my best to "educate" the CSR's at LinkDotNet about how they should facilitate their consumers by working with the telephone exchange directly and if any paperwork is needed, they should do so on their consumers behalf. All to no avail.

The subject of this post may make sense now, if McDonnalds introduced a great cross selling technique, LinkDotNet knows all about loosing consumers. I've decided to move on ...... to PTCL DSL! Yes, its bad of me to go to a monopoly, but hey they dont require me to visit any exchange. Just call 0800 80800 and you're done! Let this be a lesson to LinkDotNet, dont act like a monopoly if you're not!

Tuesday, May 11, 2010

Management Meetings


I have a meeting with my direct reports once a week (managers and architects). Its a tradition I've been following for a number of years. Only recently have I had to think about its usefulness or possibly lack there of, given some interesting questions on its value raised by my business partner.

Since most businesses, specially mid to large size firms in the US, are guilty of having too many meetings, its a very important question one needs to ask and continue asking over time. Most firms did not start out with having half the working day wasted on meetings, they became that way because bit by bit the working sanity was lost and the environment evolved that way.

A number of executives and processes try to counter the culture of having too many meetings due to their impact on productivity. Some notable ones being:
  • A ticker in a meeting room showing the cost to the firm of having the individuals in one room and not doing "work". All attendants enter their calculated hourly salary as they enter the meeting and as soon as the figure hits a large threshold, the meeting needs to be disbanded.
  • People to remain standing ie the stand-up meeting. The reason being that people will get tiered quickly and would not want to extend the meeting any more than its actual usefulness.
  • Having a few days in the week as "no-meeting" days.
  • Getting employees to work from home on some days, goes to the previous point.
  • Resorting to asynchronous forms as primary modes of communication ie getting people to use IM, email or SaaS based sites like yammer.com since it does not break the thought momentum that someone may have when interrupted

That said, what are the positives of a meeting, specially that of a group that shares a common manager and little else (my current headache). So here goes:

  1. Enables an agile organization capable of quick turnarounds to larger threats. Its important for individuals who are in mid management to have a context as to the challenges being faced across the firm. An agile organization is better driven in an environment where major problems relating to organizational opportunities and threats are known at most organizational levels. It allows for interesting and unique solutions to be thought out even before executives realize its a major problem.
  2. Helps job satisfaction. Knowing you're part of the larger decision making, not only in your own team and department, but across the board helps increase employee morale.
  3. Ensures a snapshot of the organization progress is known every week, which may be difficult to reach with one-to-one meetings with all reports. Broad meetings typically take precedence over a lot of other work which isnt the case with one-to-one meetings as they may frequently get cancelled or delayed due to impeding priority work.
That said, the pinch of salt being to keep such meetings under an hour. In the worst case if they do start getting boring, its not a huge burden. Another is to change the environment of the meetings every now and then, take the team out for a working lunch!

Monday, February 22, 2010

The Green Future

For those of you who follow the venture capitalist, this may not come as news to you - the world needs an eco friendly energy source ASAP! I am pleasantly surprised as to the number of efforts involved in bringing this to fruition. The good news being they will make economic sense and will not just be sold to the environmentalist in us. Anything short of economic sense is just not viable at a mass scale, so I'm glad the industry is aware of this. Some of the interesting initiatives are given below:

1. Green revolution - Agriculture productivity is important, but agriculture based ethanol seems to be doomed since a significant portion of the world is still under the famine line.

2. Wind Turbines - Intermittent energy, and they occupy a lot of space and are known to produce sound pollution, which is an issue that can lead to extinction of certain breeds of animals from their habitat

3. Solar Panels - Intermittent energy, and just haven't delivered to date. And God knows the pollution they're causing somewhere in China where they're being manufactured on a mass scale!

4. Nuclear Power - The traditional nuclear power plant uses an extremely rare isotope, which makes waste disposal extremely complicated and political. The big jump in this industry will come from using the common isotope and thereby turn the waste of existing plants as its fuel! Check out Bill Gates talk at TED on the subject.

5. Energy Cells - check out the Bloom Box, as covered by 60 minutes.

In summary, a major (r)evolution in energy awaits us (it must, as there is little hope of a bright future in its absence). I get a warm and comfy feeling thinking about how cheap energy will convert our lives and make this a better place for us to live!

Sunday, January 31, 2010

Children Growing up


A major milestone for any parent. First day of school for their child!
I've just had mine start a few weeks ago, and its a life changer. From waking up early in the morning (I own up to pressing the snooze button on a daily basis and hence the reason for being late to office) to getting the child to do their homework.

But contrary to my expectations of "miserable school days", I'm actually loving it! Nothing beats seeing a child take up on learning and be excited about it. The only unfortunate taint to all this is the rat race that we set for ourselves. I need to keep reminding myself that I will NOT put a "parent of honor child" sticker on my car or push the child to "excel" in sports that I like rather than what he/she likes. Or so I will try!