in reply to Rules of Proper Perl Style

Keeping in tune with the Mythical Man-Month (a terrific book, might I add)...

japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
(dws)Re: Re: Rules of Proper Perl Style
by dws (Chancellor) on Feb 18, 2001 at 03:43 UTC
    Much as I like Mythical Man Month, I think Brook's admonition on the necessity of code documentation is dated, and should be read as a statement about coding practices of that bygone era, when it was much more difficult to write code that could stand on its own without additional documentation than it is today.

    At the time the book was written, most compilers (with the exception of COBOL) limited variable names to six or eight characters. It was hard to write code that clearly expresses its intent given that constraint. A reader needed additional commentary and documentation to help untangle cryptic fragments.

    Contemporary methodologies (the Extreme Programming folks in particular) eschew commentary, and use the need for commentary as a hint that a piece of code needs to be refactored or rewritten. I don't agree with them entirely on this, but they do have a good point.

    I'm not arguing that code needs no documentation. High-level overviews are always welcome. But we now have better tools than Brooks did when he was working on OS/360, and can use those tools to write more descriptive code than those in Brooks's era could. The trick, of course, is to do so.