Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: use strict; before/after use warnings;

by harangzsolt33 (Chaplain)
on Nov 07, 2019 at 04:03 UTC ( [id://11108420]=note: print w/replies, xml ) Need Help??


in reply to use strict; before/after use warnings;

I usually write

use strict;
use warnings;

for purely aesthetic reasons.

For example, when I type a paragraph,
I sometimes pay attention to make sure
that lines become increasingly longer as
the paragraph is beginning, and the lines
become shorter as you get near the end.

See above example ^

When I write if-and-elsif chain, I do this:

   if (condition) { do something; }
elsif (condition) { do something; }
elsif (condition) { do something; }
else              { do something; }


It's easier to read.

Okay, call me OCD.

Replies are listed 'Best First'.
Re^2: use strict; before/after use warnings;
by vr (Curate) on Nov 07, 2019 at 13:30 UTC

    I agree. It occurred to me that if code reading is harder work than writing, then, on subconscious level, 1st line being shorter than the 2nd is perceived as gradual increase in amount of required effort, and so slightly less stress for a reader. So not only use strict; comes 1st, but, when I have to break too long line in two and there are no parts to align vertically, I'd prefer 1st line shorter and 2nd line longer, more often than not. As ridiculous as it is, when analysed logically.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-03-28 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found