Good ways to overcomplicate your code and slow down development
J. Landman Gay
jacque at hyperactivesw.com
Fri Sep 15 13:31:04 EDT 2006
Ken Ray wrote:
> On 9/15/06 11:54 AM, "Mark Wieder" <mwieder at ahsoftware.net> wrote:
>
>>> If anyone else has common timewasters and app bloating techniques,
>>> let's hear 'em!
>> Comments. Don't put in comment lines - they only slow down trying to
>> read the actual code. Code, especially xtalk, should be readable by
>> itself. If your code needs comments then it isn't well written.
>
> Although I agree with you to some degree, I feel that comments are necessary
> to identify certain "blocks" of functionality; not necessarily individual
> lines, or for certain exceptions for the next programmer, like:
>
> -- Had to do this workaround due to a bug in Rev
>
> or
>
> -- Put this here because Scott told me he wants it here (don't move it!)
>
> You get the idea...
That's what I do too, and I'd be lost without those comments. I don't
necessarily comment what a line of script does per se, but I do comment
why I put it there.
Another good reason to comment blocks of functionality is that it allows
you to scan through the scripts without reading each line of code in
order to get a feel for how the overall operation works. I do this all
the time. I don't always want to decipher every line, sometimes I just
want to know what the purpose of the script is and how it is put
together. I find this invaluable.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list