Re: solutions to scripting addition terminology confilicts [goi
Re: solutions to scripting addition terminology confilicts [goi
- Subject: Re: solutions to scripting addition terminology confilicts [goi
- From: Nigel Garvey <email@hidden>
- Date: Mon, 28 Jan 2002 05:38:37 +0000
has wrote on Sun, 27 Jan 2002 17:19:01 +0000:
>
Writing modular code is simply good programming practice. TID-based find
>
and replaces, file read/write routines; these sorts of things can be spun
>
off - not just into separate handlers, but even into reusable modules that
>
can be called on an as-needed basis. Less duplication = smaller code =
... that is, theoretically fewer lines in the visible script. Handlers
that only execute one line introduce at least three more lines and
several handler calls more than is necessary. Modules that are loaded as
libraries into script properties bloat the script with invisible junk
that most often isn't used.
>
easier development and maintenance. These are Good Things, whether your
>
script is ten lines or a thousand. Abstract those small, common details
>
away wherever and whenever you can; your code will be the better for it.
>
>
Date-formatting, url/html/cgi encoding and decoding, math operations, list
>
manipulations... the list goes on. When some newbie comes on the list and
>
asks "How do I do... [something common]?", it ought to be a simple case of
>
replying "use doSomething() from library so-and-so".
Rubbish. If a newbie asks how to do something, you lighten their
darkness. If it's obvious they're only looking for a quick fix for a
one-off project, *then* you refer them to a library or to a complete
script.
>
[Note: this is not weakness or laziness as some might think; this is good
>
programming.
This is indoctrinated thinking. Libraries and prewritten routines are
usually necessary when writing large projects in a low-level language.
For small jobs in a high-level one, they're harder to justify and are
unlikely to provide the most efficient or economical code for the task in
hand.
Basically, it boils down to your circumstances. If you just need
something that will get the job off your back quickly, downloaded
libraries are convenient (although you have to spend time learning what's
in them). If you have the time, the ability, and the will to write the
best script for the task (from the point-of-view of the user's computer)
then you won't bother with them. My guess is that most professionals of
your persuasion write and maintain their own libraries in order to keep
control over what's going into their scripts.
>
(hon. member of the Anti-Wheel Reinvention Society)
Yeah, I used to enjoy those cars in the Flintstones too! ;-)
NG