Thursday, May 8, 2008

Lazy Programmer

They say a lazy programmer is a good programmer. Because such programmers use their minds to minimize their work that to just do rigorous hard work. Most of the software problems can be solved by either of two methods. One is to try a lot of permutations and combinations. The other is to first sit down and analyse the different possible solutions and then go for the most optimal one. Each has it's own positive and negative traits. The good and lazy programmers know exactly what to choose or rather what combinations to choose depending on the time and technical constraints.

Lazy programmers really hate to do repetitive stuff. So here's what they will do. Whenever there is a problem, try to find already existing solutions to that problem and solve it. If the solutions do not exist, they break the problem into many smaller problems and try to find if solutions exist for the smaller ones. Lazy programming does not mean not doing work but it means doing smart work and concentrating on stuff which will enable them to learn something new rather than repeat the same work which they already know. This helps them to concentrate on finding solutions to newer problems than going into a monotonous loop of doing that which is already done.

One example can be provided with STL in C++. Suppose we have a task of maintaining a dynamic list of entries of the employees in an organization and processing that list. A programmer who does not know about STL will start writing his own logic, probably linked list implementation. After he spends time in that, he will have to test and debug the errors from that. Still it might contain bugs. A lazy smart programmer will use STL, probably vectors or linked lists. He saves his time of implementation of linked lists by using existing code. And there will be no major bugs in it since it is provided by the ANSI standard and already tested. So he saves additional time. Now he can concentrate on processing that list and complete his work in a fraction of a time than the first programmer. This helps him to finish his work on time with good quality and provides him time to perform the tasks he enjoys.

So be a programmer but be lazy and be smart.

1 comment:

  1. That was very interesting dude.Very thoughtful.Laziness gives you freedom too. Look at the wild animals.look at the african savanna .they are all lazy but extremely creative in their own sense.
    keep on readind and writing.
    Since you like philosophy do visit my surreal blog MAN IN PAINTING SEES THE WORLD.THANKS for sharing your thoughts.

    ReplyDelete