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

Re^7: Backdating strict

by jcb (Parson)
on Nov 19, 2020 at 00:41 UTC ( [id://11123807]=note: print w/replies, xml ) Need Help??


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

I have never refactored code to use strict; because all of my code has been written under strict (command-line one-liners excepted), but when I have had typos in variable names, I have always had great success by simply running the script at a terminal and letting perl point out the errors.

Since this is presumably functioning code, we can expect that there will be no variable-name typos. The simplest option for moving to strict would be to add use strict; and then use vars at top-level, listing the variables already used until all are declared. Narrowing the scopes to lexicals can then be done incrementally, using grep or Emacs' M-x occur to identify where each name is mentioned in the code and understanding of the program to determine where values can be reduced to narrower scopes.

Replies are listed 'Best First'.
Re^8: Backdating strict
by LanX (Saint) on Nov 19, 2020 at 00:48 UTC
    > I have always had great success by simply running the script at a terminal and letting perl point out the errors.

    You never tried flymake-mode, right? :)

    And why do you run it in a terminal instead of a compilation buffer?

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

      Simple; the main reason I run X is to have dozens of xterms and Emacs frames scattered across my numerous virtual desktops with the occasional graphical application. Emacs is a better editor, but xterm is a better terminal. :)

        The benefit of an IDE comes from the "integration".

        Like automatically jumping to errors found in the STDERR output. This facilitates development a lot.

        Your line of arguments are classical with VI zealots, ( I don't need feature XY integrated I can always use Unix) and from that perspective VI is probably the better editor.

        Anyway, I don't intend to convince you. :)

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

        Check out vterm if you're using a recent emacs with loadable module support. Anecdotal but I've noticed differences (I still do most normal work in iTerm but the things I do do within emacs straight seem peppier).

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

        What follows is a totally irrelevant post in this thread, sorry.

        I do the same but I use micro-emacs and can't stand tabbed terminals. I like to take my time scrolling the page of errors and jumping to the offending line in another terminal. It's like a zen exercise. I start thinking subconciously the problem in these few seconds between switching contexts and that helps me.

        I have to admit that when I had to use it, Android Studio feels like flying a JumboJet. I press a button and the drinks cart comes out. A lot of these I could make with a Makefile and scripts, e.g. to upload the app to the emulator etc. And I would prefer it that way.

        I often wonder what productivity does the IDE offer? The one it comes to mind is autocompleting method names in classes, checking arguments etc. that's cool as it saves me time to look up the docs. But what company would deny paying their developers an extra hour per day for reading documentation? And instead get them an IDE to save money? Oh yes: Fools Inc.!

        Of all the free code out there I avoid like the plague those integrated with Xcode and VisualStudio. I just don't bother with these (anymore).

        So, I would use an IDE if it guarantees that compiled code can be achieved also via the command line without that IDE.

        And another thought, there is so much effort put into graphical editors, let's say Android Studio's UI builder (in olden times it was Access db). It's almost impossible to be able to explain or get help from a text-based forum. I consider heroes those answering those queries with a ton of screenshots and phrases like Menu->X->Y->Z click, drag, left-holder, etc. Instead there is a perfectly sane XML-based UI language there. The point here is that "Menu->X->Y .." is the lowest form of knowledge.

        So, what I am trying to say is that IDE is cool but they start innocent and before you know it, you depend so much on it you can't escape it. Hello IDEs, welcome and join the queue. So many of you battling for my soul.

        bw, bliako

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 11:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found