http://qs321.pair.com?node_id=235735


in reply to Confused.... question on code scalability (reusing functions, etc)

Good rules of thumb:
  1. If you're going to do something more than twice, make it a function
  2. If you're going to use it in more than two programs, make it a module
  3. If doing it even once made your head hurt, throw it in a module
  4. If it has data you don't want to change yourself, make it work from template files
  5. If the code is could be generated from some sort of parameters, use a templating code generator for it
  6. If it feels like a monkey could do it, check the above list to see what you missed