Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

The condition heavily weighs it's position quite often. Compare with:

If you need milk, go and buy some If the trash is full take it out If it is too hot, open the window

In the first, the condition is now more important than how to meet it. (At least in my perception. In the latter two, I just switched and personally think it is clearer that way. Note that English is not my native tongue and that I am very well aware that not all people think alike. That is why I love perl5: it is very easy to write it as it best fits your mind while still not too hard to read when others wrote it the way they think is best.

In the third example it is also important to realize the number of options on either side of the and/or/if/unless.

If it is too hot, turn down the heating If it is too hot, open the window If it is too hot, turn on the air conditioning If it is too hot, go out for some fresh air

Of course this also goes the other way: there may be a number of reasons to open the window (other than to throw out ... from the 13th floor).


Enjoy, Have FUN! H.Merijn

In reply to Re^2: A matter of style: how to perform a simple action based on a simple condition? by Tux
in thread A matter of style: how to perform a simple action based on a simple condition? by muba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
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-24 09:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found