mrichmon said:When that happens it is time to refactor.
In any moderately complex software your understanding of the problem domain changes over the development life of the code. This almost always means that some of your early assumptions are invalidated as time goes on.
The primary reference for refactoring is: http://martinfowler.com/books/refactoring.html
This quote in another thread got me thinking. What's the best way to refactor PHP? It's near impossible to detect errors from an IDE, as PHP isn't strongly typed, and returning an integer is just as valid as a string or an object.
How do you do it?