Refactoring
- Refactoring is an idea that has had several books written about it, but the gist is: when you visit a piece of code, instead of just making expedient changes, make the whole piece of code better.
- As an example, I needed to add a feature to our browser-detection class. With the way the class was implemented, that required adding to the API of the class - which should mean a compatibility-breaking version number change.
- So I rewrote it so that features could be added without changing the API. Now, we can update the browser class, and update code to use new features, without worrying about breaking compatibility.
|