Monday, October 18, 2010

Refactoring

A wonderful technique for people who wish to write beautiful code. It is not always possible to write good code, forget beautiful code, the first time. Every programmer writes code in a hurry and try as hard as they may it is difficult to write good and beautiful code.
Writing under constrained circumstances means that one needs to go back and correct the code that has been written and here is where refactoring comes into picture.

Many a programmers may have been doing it without realizing that they are refactoring (as the term has started existing only after Martin Fowler has made it a formal declaration).

The book "Refactoring - Improving the design of existing code" gives a set of wonderful techniques that can be applied to make code more readable, more efficient, more maintainable and more beautiful.
For every technique that it suggests it also suggests the reverse as another refactoring method and also illustrates as to when it should be used.

Extremely important book for every programmer. Although the examples in the book are based in Java they can be applied to programs in any Object Oriented Language.














Along the same lines there is a book on Refactoring Databases. Again a wonderful book.














And another book called Refactoring to patterns. Although the name of the book reads refactoring to patterns, it clearly warns against overuse of patterns and gives examples as to why force fitting patterns will cause the programs to become ugly and unmaintainable.














All three wonderful books and should be in the repository in anybody who wishes to write BEAUTIFUL CODE and BEAUTIFUL APPLICATIONS.

No comments: