Three Kinds of Code
agilefocus.com
agilefocus.com
Name an example of code of that kind?
And then there are libraries like Prototype and Scriptaculous.
I'm a bit tired of the notion that all code needs to be ready for a mission to the moon, or needs to be reusable. It doesn't -- it just needs to do the job. If part of the job is to be the foundation of years of work to come, then yes, it needs to be brilliant.
If the code you are writing is a quick hack to generate some images or to present some data on a single web page, time matters more than that is can be extended ad infinitum. Write something quick -- and maybe you can have the time to write some tests as well.