Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Backdating strict

by jcb (Parson)
on Nov 18, 2020 at 04:04 UTC ( [id://11123767]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Backdating strict
in thread Backdating strict

While we are making editor suggestions, I find GNU Emacs and its cperl-mode to be very useful for writing Perl code.

Replies are listed 'Best First'.
Re^4: Backdating strict
by LanX (Saint) on Nov 18, 2020 at 21:37 UTC
    What grandfather meant with "background syntax checking" is called flymake-mode in emacs.

    It runs regularly perl -c in the background and highlights problematic lines. And strict will cause compile-time errors, like with undeclared variables.

    I know that Komodo offers it too. Not sure about vim or notepad++ or alike.

    Though I don't share his confidence that code which evolved without strict can be easily fixed with these tools. I rather share Bill's analysis.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      Though I don't share his confidence that code which evolved without strict can be easily fixed with these tools

      Um, I don't think I expressed that confidence. I did say:

      With modern editors that perform background syntax checking it's pretty quick to identify where variables need to be declared and fix that.

      which as BillKSmith points out may be the thin edge of the wedge, as indeed you also imply. However, identifying issues is a huge head start in resolving them!

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

      Quibble: flycheck >>> flymake. It comes more or less out of the box with both perl -c and Perl::Critic support.

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        I was thinking of mentioning flycheck, because it's indeed far more elaborate.

        But last time I tried it under Windows it used to slow down and make emacs often pause. (IIRC did the maintainer say that Win is not his concern)

        Sorry, but I made it a habit to only recommend OS agnostic solutions. flymake dates back to the antiques of emacs, that's why it's stable.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

      The syntax highlighting in Emacs' cperl-mode is extensive and tends to catch most of my syntax errors when I notice that the code did not highlight as expected.

      This is particularly useful for catching sigil and subscript typos — CPerl mode highlights direct array and hash lookups accordingly, so if I miss the shift key and type $foo[bar] instead of $foo{bar}, the syntax highlighting will indicate my mistake almost instantly.

        I just wanted to return to the topic on how an IDE can help refactoring to strict.

        I agree that cperl's syntax highlighting is among the best.

        But it can't help catching typos in variable-names or scoping problems. That's where flymake et al. comes very handy.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

      I know that Komodo offers it too

      I have downloaded and installed Komodo and it certainly looks impressive. I think I need quite a while to find my way around and start using it to produce something but I shall certainly give it a good try...

      I did think of Padre but that doesn't seem to be being developed or supported anymore.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found