Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: perlcritic speedup

by powerman (Friar)
on Jan 24, 2012 at 22:45 UTC ( [id://949785]=note: print w/replies, xml ) Need Help??


in reply to Re: perlcritic speedup
in thread perlcritic speedup

Thanks for your reply, but I didn't asked question you're replying to. I've asked how to speedup perlcritic, not is it make sense to use it.

My coding style is very good, and you can easily examine it yourself by checking my modules on CPAN or my open source software on my website.

So, I don't need perlcritic to improve my coding style. You probably know perl syntax good enough, but don't you find automated syntax check with perl -c on saving file very useful? We're all use it not because we don't know perl's syntax, but because it help us fix typos and mistakes early and easy. Same apply to use warnings and use strict. And same to perlcritic. They all help us have more safe and consistent coding style and warn about subtle issues at low cost and as early as possible.

But perlcritic work in such a way, what if it wasn't used on regular basis all of time since you begin writing code, there is high chance first time you run perlcritic you got dozens, or, even more likely, hundreds of warnings. EVEN if your coding style is really very good. Some of these warnings probably should be disabled at all, some ignored with ## no critic, some just not really important but better to change code in way perlcritic wants to make code style more consistent, and, finally, few warn about very important subtle issues. And chances are when you notice these hundreds of warnings first time, you decide to move one and ignore them all, because task of handling them all looks too scary. THIS IS WHY I want to run perlcritic each time when saving file - to handle it's warnings one by one, instead of dozens at once.

Replies are listed 'Best First'.
Re^3: perlcritic speedup
by JavaFan (Canon) on Jan 25, 2012 at 01:05 UTC
    but don't you find automated syntax check with perl -c on saving file very useful?
    Not at all. I want to save whenever I feel like it, and not whenever I think the syntax is correct. There are many times I save a file when running 'perl -c' on it would just sprout a gazillion of errors (because, you know, perl just can't shut up if there's one closing brace not typed yet)

      Even if there are syntax errors, you still can save the file, just with some annoying warning. So if you save incomplete syntactically wrong code more often than syntactically correct code, automatic syntax check on file save will be much more annoying than useful. (But wait, if you have to save completely broken code _so_ often, then maybe something _else_ is wrong here?)

      I'm usually save file with all closing braces in place (you know, I type closing brace right after I've typed open brace :)), so automatic syntax check helps me much more often than annoy. Maybe root of your attitude to these things is lack of type-closing-brace-after-open-brace skill? ;-)

      Actually, this comment is mostly a joke (but every joke contain a little truth inside), and I'm sorry for this useless reply. You'll keep your mind, I'll keep my, and that's ok. At least for me.

        So if you save incomplete syntactically wrong code more often than syntactically correct code, automatic syntax check on file save will be much more annoying than useful. (But wait, if you have to save completely broken code _so_ often, then maybe something _else_ is wrong here?)
        It doesn't have to be "more often". Even if it's 1-in-10 times, it's still annoying. But, to make you happy, I do it the other way around. With a simple keyboard macro, I can syntax check the file I'm editing -- with as side-effect that the file gets saved*
        Maybe root of your attitude to these things is lack of type-closing-brace-after-open-brace skill? ;-)
        I've experimented with that in 1980s. Using some editor macros to automatically add closing parens, braces and brackets. I found that annoying, because when you're done with a block you now have to navigate over the already present brace.

        Beside, if I now type a closing brace, my editor automatically de-indents (and it automatically indents when ending a line with an opening brace).

        *
        1 store-macro save-file shell-command &cat "/usr/bin/perl -c " $cfilname ~endm bind-key execute-macro-1 ^A-c

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://949785]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2024-04-23 14:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found