Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
It contributes to the notion of perl being obscure and hard to read.
For me, it contributes also to the notion that perl is hard to write - summing both: that perl is very sophisticated.

I like golf not only because it reveals dark corners of perl; it also reveals perl's tremendous ability to eliminate noise and produce dense expressions. Ultimately, golf tends to be noise, when shorter statement can not anymore be contrieved, but even those constructs - add a bit of air (white space) to them, a bit more verbosity, and many of them expand into beautiful, perfectly understandable nailing-downs of solutions to the problem at hand.

Compare

%hash = (); { my @keys = qw ( a, b, c); my @values = 1..3; for ( my $c = 0; $c <= $#keys; $c++ ) { $hash { $keys [$c] } = $values [ $c ]; } }

which is a common idiom in many languages, to

@hash { qw (a, b, c) } = 1..3;

of which the latter is the golfed code version, useable in production code, and you must admit that perl to some extent is golf - well, compared to Java anyways ;-)

Any language is "obscure and hard to read" for those that don't venture into it; and no matter whether that "obscure and hard to read" judgement is uttered as a pretext to not do so, or as a disinformed dismissive, it is just prejudice - and there being perl golf or not doesn't change that in the least.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

In reply to Re^4: Golf Challenge: FizzBuzz by shmem
in thread Golf Challenge: FizzBuzz by Ovid

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 sharing their wisdom with the Monastery: (5)
As of 2024-04-23 07:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found