in reply to Backdating strict

If you revisit the code for maintenance there is some argument for using that as an opportunity to roll in strictures. But it's a bang for buck thing. With modern editors that perform background syntax checking it's pretty quick to identify where variables need to be declared and fix that. Because declaration gives a defined scope for variables it can also be a good way to think about how the code works. So the process of declaring variables can actually make the maintenance task easier.

If you have no other need to visit the code then generally it's best to leave it as is. Another reason to visit the code may be occasional flakiness. In that case adding strictures, especially warnings, is very compelling.

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

Replies are listed 'Best First'.
Re^2: Backdating strict
by Bod (Parson) on Nov 17, 2020 at 21:03 UTC

    With modern editors that perform background syntax checking...

    Ah yes!
    That could be another issue. I use TextPad and have done for the last couple of decades. Taking a look at Atom is on my ToDo List but should I be looking at anything else?

    I fear I might be opening a can of worms here

      I've used Komodo IDE for many years. It's editor engine is the same engine used for Sublime Text so there is a lot of feature cross over in the editors. When I'm developing Perl code I pretty much never leave Komodo. It's debugger support is great and the IDE integrates well with test and coverage tools. Common revision control systems are well supported. And these days it is essentially free, although if you are doing a lot of script coding it was worth the price of admission even when it was a pay for product.

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

      An editor war? Why not? ;) Seriously though, Notepad++ is great, or Vim has Windows builds.

        I feel confident it wouldn't be the first editor war and most certainly won't be the last in the Monastery :P

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

        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

      "should I be looking at anything else?"

      I use intelliJ IDEA as my IDE, with the Camelcade Perl5 plugin, and Devel::Camelcadedb distribution which allows in-IDE debugging. Of course, I also have the Vim plugin installed in the IDE as well. Been using this setup for years. I've got their Open Source license, but the free version works all the same.

      Here's an image I saved quite some time ago.

        That looks rather like Eclipse which I used briefly at university when I had to produce some Java code. The little bit of Java I use now is for Android app development and is done in Android Studio.

        I'm guessing it is rather more powerful than Text Pad which I currently use. This does provide Perl syntax highlighting but not much else.