Refactoring code - big deal !

what is it really?
Just to simplify code so that its easy to understand and maintain.

But why its required any way?
I think, i am writing code which is easy to maintain and understand. So is it a myth? Ans is NO...
you write a code as per well designed abstractions and objects, but change to existing code makes software design to decay. Once that starts happening, you need to start to refactor code in small bursts. that way you will save code, design and most importantly time of any coder who will work on it.

Whats most visible difference that makes?
You would become more efficient developer as you would do things quickly over period of time and Your code will be less buggy. But that sounds counterproductive, since you have to devote time to refactor other than dev time. Yes, All good things take sometime to work, so it is.

When should i do it?
when i am
# add/changing new method
# fixing a defect
# dont understand some code

Are there any troubles?
# watch while changing interfaces methods, if its public or published its not easy to refactor
# watch for thrown exceptions

how can i quickly locate places in code that needs refactoring?
Those pointers will be in next post...

Until then...Jai ho..

No comments:

Post a Comment