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

Re^3: Stop suggesting to upgrade perl

by chromatic (Archbishop)
on Sep 01, 2013 at 06:15 UTC ( #1051771=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Stop suggesting to upgrade perl
in thread Stop suggesting to upgrade perl

Yes, saying "//=" is concise and more accurate in many instances, but does it really provide any real advantage over using "||=" in the majority of use cases?

Given that it's more accurate, yes. Accuracy is a fine feature in many programs—perhaps even most. I like getting the right answers and I like having fewer bugs than more bugs.

Besides, it's a feature of a Perl release that's nearly six years old. If you want it on a Perl that's even further out of date, you can easily get patches for Perl 5.8 and perhaps even 5.6... but if that's just too much work for you, it's trivial to replace instances of it with a combination of defined and multiple appearances of the relevant variable.

Worse still, IMO, is using Moose (and MooseX) when it is trivial to use traditional OO Perl to do the same thing.

I just can't see it as a terrible thing that people who volunteer to give away their code for other people to use freely choose to do things that make their volunteer work enjoyable. You might as well suggest that we stop using Perl and start using the combination of shell, awk, sed, C, and other Unix tools because that's compatible with SysV in its purest form circa 1986. (Imagine how awful it would be if POSIX features were available to people who didn't know how to use them in C, let alone implement them.)

... but this is all a silly argument for you to make, because you've already poisoned the well by claiming that all features in Perl newer than your personal cutoff point are merely "cool" and not useful.


Comment on Re^3: Stop suggesting to upgrade perl
Re^4: Stop suggesting to upgrade perl
by boftx (Chaplain) on Sep 03, 2013 at 08:24 UTC

    I submit that the fact that one can install Moose or code the equivalent of //= in Perl 5.8 (I am not sure just how early a version of Perl can support Moose) indicates that there is nothing fundamentally new about what is being introduced.

      But increased readability increases maintainability. IMHO the equivalence of

      sub fexists (-f $_[0] ? $_[0] : undef); my $file = fexists ($p) // fexists ("$p.exe") // fexists ("$p.sh") // +;

      would involve lexical copies and a huge chain of defined ($x) ternaries.

      So yes, many new features were doable in older versions, but they were ugly and error-prone.

      I myself do NOT like OO programming. I need to understand how perl does it when dealing with modules that have no non-OO alternative, like DBI and Tk, but I still prefer to program non-OO myself. Moose however makes the threshold to actually *use* OO in perl in a way that does not constantly irritate me a lot lower (if it does take away the threshold at all). That on itself is worth considering, as that also makes the language more open to newcommers. OO-programmers get a head-start with Moose over the available OO techniques that the CORE has available.


      Enjoy, Have FUN! H.Merijn
      ... there is nothing fundamentally new about what is being introduced.

      That's true, but what does it matter? There's nothing I can do with say I couldn't do with print, but say is more convenient. There's nothing I can do with Moose I couldn't do by hand, but it's more readable, shorter, and easier to use.

      As I see it, a feature that makes it more pleasant to write code, easier to write correct code, and simpler to understand code is a benefit, even if that feature adds nothing fundamentally new from a CS perspective or a UX perspective or whatever theoretical perspective you prefer.

      (That's part of my gripe about P6. It adds a lot of nice newish features that probably meet your criteria for fundamental newness, but it's failed to deliver anything practical directly for my uses in 13 years. It's only due to the hard work of people working on things that aren't P6 that we have anything at all practical from the effort.)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-08-30 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls