Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Yes, I hear this suggestion a great deal. In fact, I've been hearing it for 20 years now...and mostly against Perl 5 itself:

Damian (in early 1995), commenting on a Perl 4 solution:
Of course, nowadays I'd write it in Perl 5.0, taking advantage of references, lexical variables, object-orientation, ties, autoloading, threads, better regexes, and modules.
Anonymous Perl 4 user:
Maybe we should be spending our time deciding what to call "Perl 5," since it obviously isn't "Perl." At best, it's a language that adopted a few keywords, like local and do, but it bears no resemblance (nor compatibility) at all to its erstwhile namesake.
.
.
.
Damian (in early 2014), commenting on a Perl 5.8 solution:
Of course, nowadays I'd write it in Perl 5.20, taking advantage of defined-or, switches, object filehandles, smartmatching, state variables, postfix dereferences, subroutine parameter lists, lexical subroutines, named captures, independent subpatterns, C3 method resolution, and autodie.
Anonymous Perl 5.8 user:
Maybe we should be spending our time deciding what to call "Perl 5.20," since it obviously isn't "Perl." At best, it's a language that adopted a few keywords, like my and use, but it bears no resemblance (nor compatibility) at all to its erstwhile namesake.

It's almost as if some people feel that the motto "There's more than one way to do it" applies to everything about Perl...except Perl itself.

But, in my opinion, "Perlishness" isn't really about syntax, or semantics, or even features. It's about the belief that programming languages should be designed to be flexible and powerful, and should come with all the useful tools and data structures built in, and should make easy things easy and hard things possible, and should do so without getting in your way. And by every one of those measures, Perl 6 is arguably more Perlish than Perl 5.

And as for "no resemblance (nor compatibility) at all to its erstwhile namesake", remember that I deliberately chose a Perl 6 approach that emphasized that language's many new features. The following is also a pure Perl 6 version of "bottles of beer":

my @bottles_of_beer = map {join "", "$_ bottle", $_ ne 1 && 's' || '', " of beer"}, 'No', 1..99; my $n = 99; while ($n > 0) { say "@bottles_of_beer[$n] on the wall,\n", "@bottles_of_beer[$n].\n", "Take one down, pass it around,\n", "@bottles_of_beer[--$n] on the wall.\n"; }

I think you'd have to concede that this version bears at least some resemblance to (and compatibility with) Perl 5, given that it differs from being executable Perl 5 by exactly one character.

Or I could have written my Perl 6 version "bottles of beer" like this:

sub bottles { my ($n) = @_; return "No bottles" if $n == 0; return "1 bottle" if $n == 1; return "$n bottles"; } for (reverse 1..99) { say bottles($_), " of beer on the wall,"; say bottles($_), " of beer."; say "Take one down, pass it around:"; say bottles($_ - 1), " of beer on the wall."; say ""; }

...which is executable Perl 6 and also executable Perl 5.

So, sure, when I use just the new features of Perl 6, it seems like a language entirely different from Perl 5. But that's just as true when I use the new features of Perl 5.20 and it seems like an entirely different language to Perl 5.8. Or when I use the new features of Perl 5.8 and it seems like an entirely different language to Perl 4. That's just the nature of all programming language development.

Damian


In reply to Re^4: too much free time by TheDamian
in thread too much free time by Anonymous Monk

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (4)
    As of 2014-10-21 00:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (93 votes), past polls