AS3 :: Refactoring while programming
Refactoring is also known as iterating. This is an easy concept to understand but, harder to realize until your programming skills reach an intuitive level.
As am a writting 1000’s and 1000’s of lines dealing with my TEODoc app, one thing is apparent; I refactor every time I type on the key board. I think refactoring actually boils down to a way of thinking, understanding and finally molding your code from a lump to a sculpture.
There have been many books written on this, I just finished two great ones:
Refactoring to Patterns by; Joshua Kerievsky
and
Refactoring, Improving the design of existing code by; Martin Fowler
One thing I have noticed with my programming style is refactoring is actually a part of my programming. I think where programmers get stuck is thinking it’s a stop and go process. It really comes down to an intuitive measure of the stability of your own understanding reletive to the code you are writting in the moment.
My advice is, if you are having a hard time deciding “when” to refactor a class, method or even a property, you are thinking about refactoring to much.
This thought comes down to riding a bike for the first month or so. Your mind is conciously thinking about balance, keeping your hands on the handle bars, the pressure of your feet on the pedals so you know that when you need to stop, your feet are in the right place.
After awhile, your mind adjusts to all these new feelings and intuition kicks in. You then can focus on your trip, whats going on around you and where your destination is without worring about actaully HOW to ride the bike.
So here is the advice, keep up the programming and it WILL come to you. Know that if you even have an incling to understand what refactoring is and how to do it, you will! It’s only a matter of time, patients and practice.
Peace, Mike