Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I took a brief gander at the Perl [torkington.com] and Python [blosxom.com] versions in that order.

    My first impression, after reading each in the browser for about a second each:

    • The Perl version starts with a nice long comment that describes WTF this script does.
    • The Python version starts out with gobs of plaintext
    • Oh, wait, it's not python code
    • Oh, wait, it starts out with """
    • Oh, wait, that's a triple-quoted strong. Where does it end?
    • Oh, wait, the python program starts out with pretty much the same commentary as the Perl program
      • The Perl version starts with a nice long comment that describes WTF this script does.
      • The Python version starts out with gobs of plaintext.

      Then the files aren't really equivalent. Python's """ foo """ multiline comment construct is more equivalent to Perl's POD, not to heredocs.

      Now if you want to complain about the readability of POD, that's one thing, but it's not fair to criticise the Python script for using the language's documentation mechanism when the equivalent comment in the Perl script would have been using POD to accomblish the same thing.

      Otherwise, the Python could have been written as normal pound-sign delimted single-line comments, at which point the two versions are both semantically and syntactically equivalent and your objectsions dissolve in a puff of smoke... :-)

      --


      --
      DO NOT LEAVE IT IS NOT REAL.

      • it's not fair to criticise the Python script for using the language's documentation mechanism when the equivalent comment in the Perl script would have been using POD to accomblish the same thing.

        I'm not criticizing the script, I'm criticizing the language.

        This isn't about docstrings vs. comments, or Pod vs. triple-quoted strings. It's about making different things look different. The combination of triple-quoted strings and their use as docstrings hurts readability because you have to parse them t