Refactor, refactor, refactor!
Posted by brian under Uncategorized | Permalink | | Leave A Comment
It seems every time I need to add some functionality to my app, I end up refactoring other code in the app so the new functionality can use it. This is a GOOD thing. Especially when one is not yet an expert in iPhone app development.
It takes a fair amount of experimenting to learn how to write for the iPhone. This experimentation yields pretty messy code, but code nonetheless. In an ideal world I would throw away this experimental code and rewrite it once I learned the “right way”. However, I fear no app would ever get finished that way.
Instead, go ahead and use the experimental code, realizing that it isn’t perfect. Fix and clean it when you either need to reuse it somewhere else (and refactor mercilessly), or when you find that your code doesn’t really work as well as you thought, e.g. it won’t rotate worth a darn.
