Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
no strict 'refs'; ## no critic (strict)

Wow. I mean... Wow.

Clearly, what we need now is a Perl::Critic rule that warns you when you turn off Perl::Critic checking in a way that isn't wise.</sarcasm>

I'm actually a fan of tools that can point out my mistakes. There is a reason I choose the word "mistakes" there and not "misdeeds".

In programming, I've found that trying to prevent people from doing something "bad" by accident can often be a valuable effort. Trying to prevent people from purposefully doing something "bad" usually ends up being a worse idea than the original "bad" thing (that is trying to be prevented).

I can see the power of Perl::Critic being quite valuable when used to prevent accidental mis-steps. I can even see value in an automated tool telling me that I forgot to include "use strict;" in some file of Perl code. RequireUseStrict sounds like that.

I despair for whoever felt it was a good idea to even create the ProhibitNoStrict rule.

The only sane solution here is to simply turn off that rule in whatever configuration the original poster is using. If that rule is turned on by default in any cluster of configuration settings for Perl::Critic, then that should be changed as well.

If ProhibitNoStrict is even kept as part of Perl::Critic, then turning it on should write "Either you're an idiot or your boss is a maniacal control freak of limited skill; probably both" somewhere.

Whoever wrote ProhibitNoStrict, if you thought you were helping inexperienced coders learn some kind of best practice, then please read the original question. The only result was to plant FUD and to encourage working around a stupid test by doing something even more dodgy than the practice originally declared somehow undesirable.

At least there was more justification for the state of things with "/*LINTED*/". I thought we learned the folly of that route long ago. I guess the people writing and using the new Perl 'lint' are probably too young to know anything about the old C 'lint'.

I consider inclusion of "## no critic" to be completely unacceptable in a code review. Perhaps I should write a Perl::Critic policy module to enforce that automatically. What we really need is a tool that forces us to make our code ugly so we all have to look at that noise every time we edit or read the code so we can avoid seeing any complaints if we run the tool.

- tye        


In reply to Re^2: Symbolic reference with strict "refs" (it stinks!) by tye
in thread Symbolic reference with strict "refs" by denishowe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found