I've been working on this huge application that was written years ago and is
full of hard coding of server/database names, email addresses, etc. These
databases also usually have many script libraries that contain no functions,
only sub-routines. These sub-routines do not return any values and mostly
modify the values in a document somewhere. I really don't like this technique,
I prefer to use functions that return a value, this way at least the function
is kind-of reusable, even if it is only reusable within the specific
application that it resides.
Now, to get around all the hard-coding I use a profile document whose sole
purpose is for recording the path to the required application(s). I then
developed a class with a few sub-classes which can be used within each of the
applications to ease the maintenance burden of maintaining this application
across multiple sites. This seems to be working fairly well it's just that
there is a learning curve for using the classes. But this is kind-of off topic.
So, how do you prefer to use a script library, are they full of sub-routines
which modify documents here and there or do you prefer to use functions which
return a value? I understand that each has it's place, but to have 10 script
libraries with 20 sub-routines within each library that is only called once
seems like a waste of time, energy and space. What are your thoughts?