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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Perl v. Python (Score:2)
My first impression, after reading each in the browser for about a second each:
Re:Perl v. Python (Score:2)
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
--
DO NOT LEAVE IT IS NOT REAL.
Re:Perl v. Python (Score:2)
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 to see where the doc/comment ends and where the code begins. #-style and //-style comments don't have that issue.
You can sling similar arrows at Pod, but there are ways to structure programs so that Pod and code are separate. Docstrings, however, force these docs to be smushed in front of code (something remarkably similar visual structure).
And while this Python program could start with #-comments, there's a big pressure to make this a docstring.
Reply to This
Parent