30 ms·
>I associate Perl with inscrutable cat-walked-on-the-keyboard programs and little else. That's because Perl had a lot of "convenient" shorthand and quirks in t
by oftenwrong 12y ago
>I associate Perl with inscrutable cat-walked-on-the-keyboard programs and little else.
That's because Perl had a lot of "convenient" shorthand and quirks in the language that could be abused, leading to unreadable, "cat-walked-on-keyboard" code. However, that is just a stereotype. One could also force Perl to straighten its posture with a strict pragma, making much of the eccentricity disappear. I have worked on several large Perl 5 codebases that were/are clean and easy to understand and maintain.
- bane 12y agoYeah, the default Perl is more of a slang dialect. Lots of implicit assumptions made about you, the language and your job. Once you turn on strict and use some common sense your code reads more like an school essay, but strangely is just about as easy to work in. Just like real languages have different modes to communicate in, Perl has it's own modes. I've worked on a couple large-ish Perl codebases too and with some decent code standard found them really easy to work on and extend.
- raiph 12y agoPerl 6 claims saner defaults. For the strict pragma, it's off by default for one liners and on by default for everything else. A much bigger relevant change is Perl 6's support for hygienic lexically scoped "slangs". These can be used to relatively cleanly package composable dialects, DSLs, language tweaks etc. Slangs make it practical for a group to establish a default local policy (policies include anything from switching some language tweak on or off to switching to another language entirely) and for an individual programmer to extend or alter that policy in a cooperative manner. Slangs aren't yet nearly as easy as they supposed to be, but they're getting there. A couple examples are v5 (which switches to another lang entirely) and Tuxic (a tiny idiosyncratic tweak to standard Perl 6): https://github.com/rakudo-p5/v5/blob/master/README.md https://github.com/rakudo-p5/v5/blob/master/README.md https://github.com/FROGGS/p6-Slang-Tuxic/blob/master/README.md https://github.com/FROGGS/p6-Slang-Tuxic/blob/master/README....