If there's a bug, and you have to wade through 10K+ lines of utter shit to fix it, WITHOUT causing a regression, you're screwed. The "black box" mentality works fine for prototyping, but once you've got a working prototype, you should throw out the prototype and write a clean, MAINTAINABLE system from scratch.