I run into a task now and then in which the effort of manually doing something is more than writing a script to do the task for me.
However, at the same time, this task may be a one off, so I don’t want to spend a lot of time worrying about:
- How elegant the design is
- How the program handles its memory
- How readable the code is
- How generic and reusable it is
- … and the other many things that you often worry about …
When I was hacking a lot of Perl, I would not think twice… and would open up a doFoo.pl and get going. As soon as it worked, I was done.
When in the Java world though, I often found myself spending more time thinking about things, and how I could make it generic etc etc. I had a suddent oversion to writing code that I would maybe rm after it was used.
Now, I can still use Perl (and do), but now with Groovy I am getting the best of both worlds.
- I feel that I can throw away code again
- I can utilize my large set of Java libraries from with my “script”
- I am having fun :)
It is refreshing to have my mind back in the mode of throwing away code. Be-gone!