Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Modern::Perl

by metaperl (Curate)
on Jan 28, 2009 at 16:34 UTC ( [id://739629]=perlmeditation: print w/replies, xml ) Need Help??

I now have a new answer to my question about how to use strict; use warnings ... and it is the modern perl idea of chromatic.

Now, my brainstorm on this is:

  1. perhaps there should be a way for this module to gracefully age... use modern qw(5.10) selects the things that are modern now, but a different argument to use selects a different modern.
  2. in the name of saving typing, I clearly like use modern over use Modern::Perl... it is obvious we are using perl right? or will there be Modern::Ruby, Modern::Python, etc.

Replies are listed 'Best First'.
Re: Modern::Perl
by andye (Curate) on Jan 28, 2009 at 17:23 UTC
    Can I use Post::Modern?

      No, don't be silly. Fish don't like ice cream. BANANA.

      (Oop, I guess that's more use Dada; Post::Modern would probably just require all objects to have deconstructors instead . . .)

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        perlcritic --harsh Perl/Critic.pm
Re: Modern::Perl
by chromatic (Archbishop) on Jan 28, 2009 at 19:01 UTC
    [Perhaps] there should be a way for this module to gracefully age....

    That would be silly. Either a Perl version is modern or it's not. 5.10 is modern. 5.8.x is not.

    [In] the name of saving typing, I clearly like use modern over use Modern::Perl....

    It's not a pragma in core, so the name modern is not an option.

      It's not a pragma in core, so the name modern is not an option.

      I'm glad I'm not the only one who thinks this. Lowercase module names outside of the core are a sure sign of hubris, and I usually avoid authors who create them.

        I'm glad I'm not the only one who thinks this. Lowercase module names outside of the core are a sure sign of hubris, and I usually avoid authors who create them.
        I think of lowercase module names as being pragma-like. Whether they are in core or not is secondary to whether they perform pragma-like functions.

        In other words, location of the module is not nearly as important as its effect on the remaining body of code.

        /me thought we liked hubris?

        Perhaps you mean vanity?

      It's not a pragma in core, so the name modern is not an option.
      Why o why? With each version of Perl, a new "modern" pragma enabling each and everything would be really nice. So, where do I plea for it to be included in the core?? :-)
      []s, HTH, Massa (κς,πμ,πλ)
        [Where] do I plea for it to be included in the core?? :-)

        You don't. That's the surest path to stagnation and ossification. The module would then have to be backwards compatible until the implosion of Perl 5, and I'm not interested in that.

        When this pulls in other modules such as signatures and Method::Signatures, it'll have non-core dependencies that prevent it from being considered for core, and that's fine too.

      Damnit, I want to down-vote for the silly comment about 5.8.x not being modern, and up-vote for the bit about the module name.

        Exactly. Especially since the silly comment also missed the point that I noticed as an obvious issue when I read the spec for Modern::Perl and that may have been the point of this thread. Code that uses Modern:Perl will be more likely to break when Modern::Perl or perl is updated since the spec declares that the state exposed by Modern::Perl will change (and in unspecified or unforeseen ways).

        Cute name. Cute idea. Not something I'll be using as spec'd.

        - tye        

          Perhaps there should be a way for this module to gracefully age....
      
      That would be silly. Either a Perl version is modern or it's not. 5.10 is modern. 5.8.x is not.
      

      Perhaps you mean a version of Perl is 'current' or not.

      Well, that's what I'm trying to get at. Modern is relative. A particular version of perl (and associated features) is not.

      What is modern changes with time. Just think clothing styles... bell bottoms were modern at one time (1970). The time is fixed. Bell bottoms as being modern is not.

      Likewise, the features that you currently deem 'modern' are only modern in our eyes now. There is no doubt about what features you see as avant-garde, best practices, etc. But that is a pick for this time and this version of perl.

        Perhaps you mean a version of Perl is 'current' or not.

        I meant modern.

        Likewise, the features that you currently deem 'modern' are only modern in our eyes now.

        I'll release a newer version when what's modern changes. It's just software.

Re: Modern::Perl
by kyle (Abbot) on Jan 28, 2009 at 16:42 UTC

    perhaps there should be a way for this module to gracefully age

    I'd say the way to do this is to have the module look at what version of Perl it's running on and do the best it can with what it has. Or maybe it should look at some old crusty version of Perl and say, "this can't be made modern; upgrade!"

      As an aside, I've not found it that difficult to write text mangling code with Unicode support that functions on 5.005 through 5.10. There are some idiosyncracies of course, but there are alternatives to most of the banal modernities like our or delete $F[0].

      --
      In Bob We Trust, All Others Bring Data.

Re: Modern::Perl
by Anonymous Monk on Jan 29, 2009 at 07:26 UTC
    A Modern namespace is bad, for aside from the problem you mention, it implies the standard is somehow antiquated. This strikes me as a somewhat defensive reaction (marketing ploy?) to the common misconception that Perl is aging, that 6.0 is vaporware and Perl 5 is somehow inferior to alternatives. Those same monkeys will point and say "look, how cute, Perl is trying to be Modern, har har!" Stick with something less ambiguous and more to the point, I say.
      A Modern namespace is bad, for aside from the problem you mention, it implies the standard is somehow antiquated.

      If you only get implication from that, I haven't said it strongly enough. There is no good reason that the best features of the newest Perl 5 releases are only available to people who know the secret magic incantations to enable them.

      This strikes me as a somewhat defensive reaction (marketing ploy?)....

      It's not. It's an attempt to be somewhat less hostile to novices by encouraging them to develop good habits to write more maintainable Perl.

      Stick with something less ambiguous and more to the point, I say.

      The least ambiguous option I devised was Make::Default::Perl::Not::Suck, and that has its own flaws -- not in the least that it brings to mind dependency graph resolution engines.

        #!/usr/bin/perlmodern

        Perhaps a more emblematic name? TheSchwartz is already taken, so how about TheForce ?

        Or to borrow an idea from Class::DBI::Sweet, call it Perl::Sweet (Making sweet things sweeter).

        IMO the best features of modern Perl are the things that are enabled by default without any special incantations at all -- things like // and named captures, things that actually make it easier to write readable code. In contrast, all say does is save a little typing. Explicit line breaks were never a maintenance problem like defined $8 ? $8 : defined $6 ? $6 : 1.

        (I guess given/when might turn out to be totally awesome, but I'm one of those people who never felt the lack of a switch statement in the first place, so I've not got round to trying them yet.)

      Perl 6 is vapourware. It doesn't exist yet. It's been in development for 8 years. Looks pretty vapourous to me.
        Perl 6 is vapourware. It doesn't exist yet.

        We just released a new version of Parrot last Tuesday which includes a stable Rakudo release. If you run make perl6 there, you can write real Perl 6 code.

Re: Modern::Perl
by ambrus (Abbot) on Jan 30, 2009 at 07:58 UTC

      It's a source filter and you have to write your own customizations.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://739629]
Approved by ikegami
help
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: (2)
As of 2024-04-20 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found