Thursday, May 3, 2012

Modularity.. the beauty of coding


Whether you write a novel or write a news item, you intend to write in such a manner or a style so that the reader appreciates the content. The same applies to when you program. Imagine you are solving a problem which involves few different states for a particular variable and depending on the state, certain actions need to be performed. If you tackle the problem by coding a lot of if-else constructs with lot of functionality stuck in all those if-else sections, its going to be a nightmare to the reader and the maintainer.  Life gives us opportunities always to improve ourselves. It teaches us to be more effective, more efficient day in and day out. The same principle applies to programming as well. Luckily, in programming you can go back to the source code and modify it by modularizing it and make it look beautiful and efficient at the same time. In life, you cannot time travel, but still Life allows you to face the same situation and now it is in your hand to solve it with beautiful efficiency.   One of the effective means in coding is modularity. Modularity enables to keep meaningful chunk of code together. The next time, you find yourself seeing some piece of code running through many pages, break it into modules. You will get peace of mind. You might see the beauty. If you are interested, you may browse through the following link which contains collections of facts every programmer should know in the following link:
http://programmer.97things.oreilly.com/wiki/index.php/Contributions_Appearing_in_the_Book

No comments: