When technical debt gets so large that you go bankrupt ( quit the project ). I did this with an actionscript game. Then an html editor. I did not know what I was doing. I looked back at the code and decided that starting from scratch would be much faster than refactoring what existed there.