![]() |
|
Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks, sundialsvc4, for a thought-provoking post. It got me thinking again about the general problem of documenting code, which is something I’ve been grappling with for a long time. We all know the necessity of writing useful comments in one’s code, and the difficulty of keeping them up-to-date as the code develops. I suppose we’ve all experienced that syncing feeling that comes from reading comments that contradict the code they “clarify”. For example, I recently downloaded the perl-5.14.2 source code, just to have a look. Being a top-down kind of thinker, I began by looking for the main() function, and found the file perl.c which contains the following comment:
Great ... except that there is no file of that name in the distribution! I eventually tracked the main() I want down to perl-5.14.2/win32/runperl.c (at least, I think that’s the main() I want? :-/ ), so no major drama, but this does illustrate the syncing problem nicely. Perhaps a dynamic cross-referencing mechanism in POD could reduce this problem in Perl programmes? (Or does this already exist? I’ve only recently “discovered” POD, I don’t know it very well yet...) A related, and, to my mind, far greater problem relates to documentation of design. As a rule, even a moderately-sized project begins with a design of some sort, and, if more than one programmer is going to be involved, this design must naturally be documented in some form so that it can be communicated from the designer(s) to the other programmer(s). Yet how often does this design documentation make its way into the code base repository? Perhaps management omit it from the code base to safeguard confidentiality? Or perhaps the design document(s), because they are stand-alone files and not part of the code, are omitted because they just don’t seem to “fit”? Whatever the reason, the result is too often a code base in which the (to my mind) most-important-documentation-of-all is missing. Sure, the design is implicit in the code; but, the whole point of documentation is to make the implicit explicit, right? So, to answer the question: what ought we have done, when writing the code the first time, to expedite the process of re-preparing ourselves to make proper changes to it, some (months|years) later? I suggest:
Just my 2¢. Regards, Athanasius <°(((>< contra mundum In reply to Re: "The Work of a Stranger ..."
by Athanasius
|
|