This question sprung from a web application, although it should be valid for other types of applications too. I am using MVC.
I have both application code (modeles, views, controllers, forms, helpers, etc.) and library code (external libraries and an internal library with self-written database mappers, json converters etc.).
I wonder where you usually draw the line between application and library code (when both is internally written)?
Some of the library code gets rather project specific, but is still a bit abstracted.
Library’s code is intended to be reusable, application’s code usually not. Keep code in a library when it is not tied specifically to the application.
When in doubt try to answer this question: