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

comment on

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

OTOH... ;)

I personally think the second of your examples really is more readable. But maybe I'm just a bit nuts.

Myself, I use as few temporary (synthetic) variables as possible, I think they often make things harder to understand. Even if I immediately get the idea what @chars is, I would glance back on every occurance of it, to make sure what your idea of "characters" really is (with or without underscore, hypen, etc.). If the code spreads out, things become even worse...

In your second example, it's right there.

Which brings us back to the topic of this thread. While I am sure that there are some style ideas, any good Perlmonk would propagate, some other things really are a matter of taste.

For example, my block statements look like this:

if($foo) { print $bar; }

A pattern I am quite sure most here don't use, even If they'd call it acceptable. Although I'm a developer for longer than I'd admit to an attractive young lady, ;) I still absorb other's styles from time to time. The monastery, CPAN and the like are good places for such inspiration. Just lately I saw a hash initialization like so:

my %hash = ( one => 1 , two => 2 , three => 3 );

A new pattern I didn't see before, but I liked and absorbed it instantly. It's unprobable to drop a comma on it, and optically, it's much nicer than my old style:

my %hash = ( one => 1, two => 2, three => 3 );

So, IMHO the bottom line is: Tastes are different. The important thing is, that you have style, wich one, matters less.

So long,
Flexx


In reply to Re^2: Tact and the Monastery by Flexx
in thread Tact and the Monastery by FoxtrotUniform

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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-19 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found