Search This Blog

Wednesday, March 28, 2012

30 Day Challenge

Many times, I have found that it is easy to come up with an idea, but a lot harder to put it in practice. Think about the New Year resolutions that have come and gone - we feel guilty, think of a bunch of things to do in the new year, and forget about it in the first or second week. According to Wikipedia, 52% are confident of keeping up their resolutions, but 80% fail.

Obviously there is a disconnect between what we want to do and what we actually end up doing. So, why is there a disconnect? Why are we not able to keep up such commitments? I believe the issue is primarily that of scope - either we make the issue so broad that it is not actionable, and along related lines, we have the duration so long that we lose momentum quickly.

For the first one, there are numerous ideas and concepts such as Getting Things Done model by David Allen that describes how to break down and organize your to-do items so that they can be acted upon.

New Year resolutions fall more into the second category, where 1 year is just too long to keep track of and complete something. In many cases, it is so long that we don't even wait till 6 or 7 months - we give up in a couple of weeks in most cases. So, what can be done to make it stick?

Recently, I came across this video from TED, where Matt Cutts talks about the 30-Day Challenge and I think it addresses both the roadblocks to commitment nicely.



What's nice about the 30-Day Challenge is that it is simple - you just pick ONE single topic and stick to it for 30 days. Picking a single topic makes it easy to remember and the 30-day is a reasonable time frame to make a reasonable attempt (Scrum methodology is based on 30-days sprints for example).

I can think of a number of things - both work and personal - where I can apply this. Here are some examples I could think of:
  1. Take a picture each day
  2. Listen to a song by a new singer or a new genre that you would otherwise not listen to (to me - listen to one new carnatic raga each day)
  3. Write a blog entry each day (although this can go beyond 30 days and hence may not apply)
  4. On the more technical side, review one code package each day
  5. Complete a certification within 30 days
The list can go on in a variety of ways. In fact, here's a website where a bunch of people have posted different challenges already.

http://30daychallenges.net/challenges

You can also read about Matt's personal 30-day challenges in his blog to get some inspiration.

http://www.mattcutts.com/blog/type/30-days/

Something like this also lends itself nicely to an app - you can have a countdown/reminder for your challenge for the month for example.

So, what are you waiting for? What's your 30-day challenge going to be? Give it a shot - I am going to and will update on this blog.

Monday, November 07, 2011

Coupling and Cohesion in Software and Business

One of the important topics in Object Oriented Programming that is often overlooked or not even considered is that of Coupling and Cohesion. A sound understanding of these concepts can make a huge difference in how you package functionality within your program and how flexible your program can become for enhancements.

When performing source code review, keep coupling and cohesion in mind and ensure that the classes within a package all perform same or closely related activities (high cohesion) and that classes within different packages don't refer each other too much or at least in a well-defined manner (low coupling).

Definitions


Coupling is how inter-dependent two functional components are within your program. High coupling is bad, because if you change one function, you might end up affecting all the dependent functions as well.

Cohesion is how closely the parts within a function work together to make the function as one single, well-defined unit. High cohesion is good, since you can treat the whole function as a black box, thereby abstracting your system for better clarity.

Coupling Types

Type (worst to best) Description
Content/Pathological Coupling When a module uses/alters data in another
Control Coupling 2 modules communicating with a control flag (first tells second what to do via flag)
Common/Global-data Coupling 2 modules communicating via global data
Stamp/Data-structure Coupling Communicating via a data structure passed as a parameter. The data structure holds more information than the recipient needs.
Data Coupling Communicating via parameter passing. The parameters passed are only those that the recipient needs. No data coupling : independent modules.

Cohesion Types

Type (worst to best) Description
Coincidental Cohesion Module elements are unrelated
Logical Cohesion Elements perform similar activities as selected from outside module, i.e. by a flag that selects operation to perform. That is, body of function is one huge if-else/ switch on operation flag
Temporal Cohesion Operations related only by general time performed
Procedural Cohesion Elements involved in different but sequential activities, each on different data (usually could be trivially split into multiple modules along linear sequence boundaries)
Communicational Cohesion Unrelated operations except need same data or input
Sequential Cohesion Operations on same data in significant order; output from one function is input to next (pipeline)
Informational Cohesion A module performs a number of actions, each with its own entry point, with independent code for each action, all performed on the same data structure. Essentially an implementation of an abstract data type
Functional Cohesion All elements contribute to a single, well-defined task, i.e. a function that performs exactly one operation

Sunday, October 23, 2011

Goodbye World!

I am glad to have seen him in person even if in passing - he was a great inspiration to a C of developers.

#include <stdio.h> 

int main()
{
   /** Author: Dennis Ritchie */ 
   /** You are expected to understand this */
   printf("Goodbye World\n");
   return 0;
}
RIP Dennis Ritchie!


Wednesday, October 05, 2011

Rest In Peace Steve Jobs!

Almost everything--all external expectations, all pride, all fear of embarrassment or failure--these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart. 
Steve Jobs


It's a sad day for American innovation and the Tech World - an icon has passed away - an icon who was a phoenix in the Tech world, who rose out of the ashes to become more powerful than what he was before.

Much as I am not an iFan, I admire the creative genius and charisma that is Steve Jobs. It is rare to see charisma and genius combined into one package, and Steve Jobs was one of them. He was the man with the Midas touch over the last couple of decades with both Pixar and Apple - creating products and films that were blockbusters every single time.

We salute you, Steve!

Monday, September 19, 2011

Curse of Knowledge

It's been a while since the last post - unfortunately blog updates is the first victim in a busy schedule.

A few years back, I read the book Made to Stick by Chip and Dan Heath. It's a very interesting book and the authors talk about how to make ideas stick in people's minds. The crux of the book is that in order for an idea to stick, it must have 6 elements - Simplicity, Unexpectedness, Concreteness, Credibility, Emotions, and Stories. More on that at a later date. In the course of the book, the authors also make a reference to something called the "Curse of Knowledge". While the idea has been around a while, this name stuck in my head.



You might wonder - why is knowledge a curse? Isn't knowledge what every person and every organization trying to achieve? Wouldn't having more knowledge make one wiser and more blessed? Why would it be a curse then? Does it even make sense in a knowledge-oriented world?

In this case, the reason why knowledge is a curse because once you learn something, it is difficult and in many cases, impossible to unlearn it, thereby making it harder for a knowledgeable person to explain how he/she gained the knowledge to a layman.

If you think about it, this is a very profound issue and happens everyday in our lives. Once you know how to do something it's harder to explain it to others who have not yet been enlightened by the knowledge.

Imagine trying to explain how a particular piece of code you've developed works to another developer, or how you came up with a specific design to a manager in non-technical terms. Remember the crappy documentation you've complained about time and again. Some cane be traced to laziness, but others can indeed be traced to the curse. It's very difficult for us to let go of the knowledge gain and revert back to a previous position - there is no "undo" button in life.

Apart from making it difficult to communicate to others, the curse of knowledge has a number of other side effects as well. It fosters preconceived notions and sometimes makes it harder to see the facts as they are. As Sherlock Holmes said, "It is a capital mistake to theorize before one has facts. Inevitably, one tends to twist facts to suit theories instead of theories to suit facts" and sometimes having too much knowledge can make one do just that.

Every curse typically has a remedy in stories. So, is there a remedy to break this curse? Not really because of the above mentioned lack of "undo" button! However, I feel there are a few ways in which the curse can be relaxed a bit - enough to carry on with our lives. Here's my quick list.

Put yourself in a child's shoes
One of my favorite comic strips is Calvin and Hobbes - a true American classic. While each piece is a gem, my favorite is when Calvin's dad explains science to him. Before you create a presentation or a document especially to a manager or a non-technical person, imagine how it would read from a child's perspective. In most cases, out will go all the acronyms, jargon, and assumptions you've made. This can be a great way to help simplify the message. This works even better on simpler things like email as well.

Imagine you are making a move out of it
When directing a movie, you have to make sure it reaches all forms of audience - both elite and the non-elite (if you want to make big money, at least). That means your story has to be simple, crisp, and easy to digest. It can have a complex story as long as you are able to explain in a way the viewer can comprehend. Imagining that you are directing a movie on the message you want to tell can help you simplify your message and remove a lot of fluff that you'd have otherwise added because you just don't want to miss out on any detail and want to say anything and everything.

Develop an analogy from a completely different domain
I have found this to be helpful in many places - try equating what you are trying to convey in a completely different field like say, music, or arts, or something seemingly unrelated. This is something that can come closest to the reversal of the curse. By trying to translate your known knowledge into an unknown domain, you are essentially putting yourself in the layman's shoe - in essence, reliving your lack of knowledge, which can be a great way to understand how the other person might perceive your information.

One very pronounced area where the curse of knowledge is prevalent is in the blogosphere. After all, blogs are about sharing knowledge one has gained - be it a tip on a software, a book you've read, or a issue you faced. Providing enough context before conveying the message and easing the viewer into the message can go a long way in them empathizing with your view.

PS: A personal appeal
I have seen this especially pronounced in blogs on Sanskrit or Hinduism, where in many cases, it's not a curse of knowledge but rather a 'brag' of knowledge. Eager viewers are turned off by generously sprinkled Sanskrit with no explanation whatsoever, breaking the flow of the message and distracting readers. It only takes a few more minutes to add an explanation - even in a footnote - on what the phrases mean to demystify the message. If you go through all the trouble to write a post, why not go just that extra mile to add some additional detail? After all, these messages are intended to last beyond the time when it's written - might as well make it stand-alone! I hope they break or at least relax the clutches of the curse and shed some more light.