shakedown.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community for live music fans with roots in the jam scene. Shakedown Social is run by a team of volunteers (led by @clifff and @sethadam1) and funded by donations.

Administered by:

Server stats:

285
active users

#perlcritic

0 posts0 participants0 posts today
Mark Gardner<p><span class="h-card" translate="no"><a href="https://mastodon.social/@Pyrrhlin" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>Pyrrhlin</span></a></span> I like to see the test first when reading from left to right.</p><p>Per <a href="https://social.sdf.org/tags/perlcritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>perlcritic</span></a> I reserve postfix controls for program flow control functions like return, last, next, etc. <a href="https://metacpan.org/pod/Perl::Critic::Policy::ControlStructures::ProhibitPostfixControls" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::ControlStructures::ProhibitPostfixControls</span></a></p>
Mark Gardner<p><span class="h-card" translate="no"><a href="https://fosstodon.org/@tripleo" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>tripleo</span></a></span> <a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a>’s “sharp edges” are mainly early syntax and features that later experience with large and networked <a href="https://social.sdf.org/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> found dangerous, but are preserved for backward (and we do mean “backward”) compatibility.</p><p>See the details of the `strict` and `warnings` pragmas, and successively missing items in `feature` bundles:</p><p>• <a href="https://perldoc.perl.org/strict" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">perldoc.perl.org/strict</span><span class="invisible"></span></a><br>• <a href="https://perldoc.perl.org/warnings" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">perldoc.perl.org/warnings</span><span class="invisible"></span></a><br>• <a href="https://perldoc.perl.org/feature#FEATURE-BUNDLES" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">perldoc.perl.org/feature#FEATU</span><span class="invisible">RE-BUNDLES</span></a></p><p>And the summary of policies included in <a href="https://social.sdf.org/tags/PerlCritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlCritic</span></a>: <a href="https://MetaCPAN.org/pod/Perl::Critic::PolicySummary" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">MetaCPAN.org/pod/Perl::Critic:</span><span class="invisible">:PolicySummary</span></a></p>
Mark Gardner<p><span class="h-card"><a href="https://fosstodon.org/@nobodyinperson" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>nobodyinperson</span></a></span> Bliss to write but not to read as tortuous double-negatives pile up with maintenance. The ProhibitUnlessBlocks <a href="https://social.sdf.org/tags/PerlCritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlCritic</span></a> policy exists for a reason: <a href="https://metacpan.org/pod/Perl::Critic::Policy::ControlStructures::ProhibitUnlessBlocks" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::ControlStructures::ProhibitUnlessBlocks</span></a></p><p>This applies to both `unless` and `until`. Congratulations if you've used them in the past: you contributed to <a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a>'s reputation as a write-only language in the eyes of the person who had to revise your code to deal with more complicated conditions.</p>
Mark Gardner<p><span class="h-card"><a href="https://mastodon.social/@eliasp" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>eliasp</span></a></span> <span class="h-card"><a href="https://mathstodon.xyz/@ColinTheMathmo" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>ColinTheMathmo</span></a></span> BTW <a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> has two well-known tools to encourage and enforce <a href="https://social.sdf.org/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> style and best practices, respectively:<br>• <a href="https://social.sdf.org/tags/PerlTidy" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlTidy</span></a>: <a href="https://perltidy.github.io/perltidy" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="">perltidy.github.io/perltidy</span><span class="invisible"></span></a><br>• <a href="https://social.sdf.org/tags/PerlCritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlCritic</span></a>: <a href="http://perlcritic.com" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">http://</span><span class="">perlcritic.com</span><span class="invisible"></span></a></p><p>Your project or team can use their reasonable defaults or further configure them to reflect and maintain the consistent application of your preferences. They also integrate with editors/IDEs, source control management, and author <a href="https://social.sdf.org/tags/testing" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>testing</span></a>.</p>
Mark Gardner<p><span class="h-card"><a href="https://mastodon.social/@regehr" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>regehr</span></a></span> <span class="h-card"><a href="https://discuss.systems/@commodore" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>commodore</span></a></span> <span class="h-card"><a href="https://discuss.systems/@dev" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>dev</span></a></span> There is even a (low-severity, a/k/a “cruel”) <a href="https://social.sdf.org/tags/PerlCritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlCritic</span></a> policy to discourage everything but $_, @_, $], and numbered <a href="https://social.sdf.org/tags/RegularExpression" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpression</span></a> capture variables: <a href="https://metacpan.org/pod/Perl::Critic::Policy::Variables::ProhibitPunctuationVars" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::Variables::ProhibitPunctuationVars</span></a></p><p><a href="https://metacpan.org/pod/Perl::Critic::Policy::Variables::ProhibitMatchVars" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::Variables::ProhibitMatchVars</span></a> already protects you against the performance-sapping $`, $&amp;, and $' match variables</p><p>And you can configure your own prohibited list with <a href="https://metacpan.org/pod/Perl::Critic::Policy::Variables::ProhibitEvilVariables" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::Variables::ProhibitEvilVariables</span></a></p><p><a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> <a href="https://social.sdf.org/tags/RegEx" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegEx</span></a> <a href="https://social.sdf.org/tags/RegExp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExp</span></a> <a href="https://social.sdf.org/tags/RegExes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExes</span></a> <a href="https://social.sdf.org/tags/RegExps" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExps</span></a></p>
Mark Gardner<p><span class="h-card"><a href="https://mastodon.org.uk/@rbairwell" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>rbairwell</span></a></span> <span class="h-card"><a href="https://infosec.exchange/@barubary" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>barubary</span></a></span> Conway notes some problems with <a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> AUTOLOAD in “Perl Best Practices” (2005) and there is a severity 3 policy against it provided with <a href="https://social.sdf.org/tags/PerlCritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlCritic</span></a>: <a href="https://metacpan.org/pod/Perl::Critic::Policy::ClassHierarchies::ProhibitAutoloading" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::ClassHierarchies::ProhibitAutoloading</span></a></p><p>Basic problems are: first AUTOLOAD wins in a class hierarchy; your AUTOLOAD has to handle/reject everything cleanly and is therefore an infinitely complex interface; AUTOLOAD gets called on object destruction if the class is missing an explicit DESTROY method</p>
Mark Gardner<p><span class="h-card"><a href="https://fosstodon.org/@RL_Dane" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>RL_Dane</span></a></span> <span class="h-card"><a href="https://social.finkhaeuser.de/@jens" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>jens</span></a></span> <span class="h-card"><a href="https://metalhead.club/@stoerdebegga" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>stoerdebegga</span></a></span> Opinions vary on how, but you should always check the return value of `open`. <a href="https://metacpan.org/pod/Perl::Critic::Policy::InputOutput::RequireCheckedOpen" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::InputOutput::RequireCheckedOpen</span></a> enforces that.</p><p>I like autodie: <a href="https://perldoc.perl.org/autodie" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="">perldoc.perl.org/autodie</span><span class="invisible"></span></a></p><p>General consensus is that `unless` is confusing and postfix conditionals are too, except when used in flow control. <a href="https://metacpan.org/pod/Perl::Critic::Policy::ControlStructures::ProhibitUnlessBlocks" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::ControlStructures::ProhibitUnlessBlocks</span></a> and <a href="https://metacpan.org/pod/Perl::Critic::Policy::ControlStructures::ProhibitPostfixControls" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::ControlStructures::ProhibitPostfixControls</span></a> enforce that.</p><p>Since opinions vary, codify your projects’ standards in <a href="https://social.sdf.org/tags/PerlCritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlCritic</span></a>’s configuration to settle arguments: <a href="https://metacpan.org/pod/Perl::Critic#CONFIGURATION" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic#</span><span class="invisible">CONFIGURATION</span></a></p>
Mark Gardner<p><span class="h-card"><a href="https://chaos.social/@sjn" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>sjn</span></a></span> <span class="h-card"><a href="https://planet.chrisbeckstrom.com/users/cb" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>cb</span></a></span> 99% of the “<a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> is line noise” complaints are because of unformatted <a href="https://social.sdf.org/tags/RegularExpressions" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpressions</span></a>. Every language worth anything eventually supports them, but only <span class="h-card"><a href="https://chirp.social/@Perl" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>Perl</span></a></span> (and <a href="https://social.sdf.org/tags/awk" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>awk</span></a>, earlier) makes them first-class citizens. And with Perl you can format and comment them for readability: <a href="https://perldoc.perl.org/perlretut#Embedding-comments-and-modifiers-in-a-regular-expression" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">perldoc.perl.org/perlretut#Emb</span><span class="invisible">edding-comments-and-modifiers-in-a-regular-expression</span></a></p><p>We format the rest of our code for humans. Why not <a href="https://social.sdf.org/tags/regexps" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexps</span></a>?</p><p><a href="https://social.sdf.org/tags/PerlCritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlCritic</span></a> can warn against bad regexps: <a href="https://metacpan.org/search?size=200&amp;q=module%3APerl%3A%3ACritic%3A%3APolicy%3A%3ARegularExpressions" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/search?size=200&amp;q</span><span class="invisible">=module%3APerl%3A%3ACritic%3A%3APolicy%3A%3ARegularExpressions</span></a></p><p><a href="https://social.sdf.org/tags/regex" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regex</span></a> <a href="https://social.sdf.org/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a> <a href="https://social.sdf.org/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://social.sdf.org/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a> <a href="https://social.sdf.org/tags/SoftwareDevelopment" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SoftwareDevelopment</span></a></p>
Mark Gardner<p><span class="h-card"><a href="https://mstdn.science/@ChristosArgyrop" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>ChristosArgyrop</span></a></span> <span class="h-card"><a href="https://chirp.social/@Perl" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>Perl</span></a></span> In answer to your question about <a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> symbolic references on the Twitter community (<a href="https://twitter.com/ChristosArgyrop/status/1612637569426280448" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">twitter.com/ChristosArgyrop/st</span><span class="invisible">atus/1612637569426280448</span></a>), I still find them useful when you want to dynamically define things in the symbol table like functions/methods. Though Package::Stash provides a nice API for that so you don’t have to litter your code with `no strict 'refs'` and attendant <a href="https://social.sdf.org/tags/PerlCritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlCritic</span></a> annotations. <a href="https://metacpan.org/pod/Package::Stash" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Package::Stas</span><span class="invisible">h</span></a></p>