Practice differs in this area, but I would suggest the following guidelines:
- If you use it all over the place, it should probably
be in a package or some other shared place so if you
enchance or bugfix it one place, you don't need to
hunt down all other copies
- If you want to share it, it's easier for people to
take your code as a package/module than to cut'n'paste
it, and it makes version tracking easier
- Of course, if you're doing objects, it's best to put
them into packages :)
In short, packages/modules are usually a good thing, provided the borders between them are sensible, and provided
you have time to structure your code that way. It doesn't
hurt if you start new coding projects programming entirely
in that fashion. That way, you'll develop nice templates
and tools to help you, and once you get used to it, any
moderately big application (or set of small ones) will be
just as quick to implement that way as the flat way.