In this keynotes talk of the Golden Gate Ruby Conference, Yehuda Katz, a member of the Ruby on Rails and jQuery Core Teams; covers some of his principles for building friendly, usable frameworks. He explains about how you can apply them to your application codebase as it grows in complexity over time.
Framework development comes with a whole different set of tradeoffs than application development. While code in applications is usually in service of a consumer-facing feature, framework code is by definition used by other developers writing unknown code. That means a heightened focus on architecture, code reuse and developer usability. That said, as applications grow in complexity, parts of the codebase end up looking a lot like frameworks, mostly servicing code written by the application developers.
Video Producer: Golden Gate Ruby Conference