Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

As others said, the Apocalypses only highlight the changes. A real over-complication would mean e.g. to invent new assignation operators, make Hashes and Arrays just Objects held in scalars (%hash{foo} becomes $hash.get('foo')), to throw away all this list stuff at all ( @a = (@b,@c) becomes $a = array_merge($b,$c) like in PHP, bäh) . That would be horrible.

What does Apocalypse 6 introduce: Subroutines signatures, at last subroutine calls can be optimized at compile time, no more Perl's-subroutines-slowyoudown-trolls. This is nothing impractical, nearly every popular language has that "feature". Even more: named arguments, we're movng towards completely self-documenting code, and they can and will be optimized by the compiler as well: no memory- and time-consuming hashes to extract named arguments. This is no artificial invention, we know and love it from Perl5, a language with a lot of cool features we shouldn't forget ;)

Marking Arguments as constant: nothing new, plain old C 'const'. Marking them as rw: good old Perl5, access to parameters without messing around with pointers/references, no more than 'is rw', just as 'var' in Pascal. Slurpy lists using the * character: I already find that natural as the array flattening operator is the * as well.

Making arrays arrayrefs in scalar context: How logical, i didn't count how often newbies ask why 'function(@a,@b)' woudn't do what they want. It is straight-forward.

Seperating methods from subroutines does not only improve readability, it solves a lot of problems we had with OO (inheritance, private stuff, shooting your base class in the foot). It again allows optimizations at compile time. Other languages don't allow you too: In Java it's all methods, in Perl5 it's all subs; Perl6 lets you decide and get the optimum, you even have submethods.

Macros, old thing, known to be powerfull. They are no new concept.

Shortcut arguments ($^a ...) reduce the complexity without breaking the principles or would you rather like:

sort sub ($a,$b) { $a <=> $b } whatever #instead of sort { $^a <=> $^b } whatever

The latter is more or less nearly Perl5, only that you cannot break things when you use $a and $b somewhere.

In the end, it's not more complex than Perl5, but it can do more than Perl5 (and faster). As a parallel story: When I look at Perl5 formats, i think they're strange and their use is too complex (think of all the strange variables). I never used formats, and they never disturbed me for a few years of excessive Perl programming, althought they were always there. They'll be removed in Perl6 core (see Apocalypse 7 ;), because they've proven not to be too interesting for the majority of tasks. Why should things that turn out to be bloated theory disturb you in your work with Perl6? Just don't use them.


In reply to Re: Perl 6 is too complex by fruiture
in thread Perl 6 is too complex by Anonymous Monk

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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?

    What's my password?
    Create A New User
    NodeReaper . o O ( Did I forget to leave the gas on? )

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (6)
    As of 2018-05-22 16:18 GMT
    Find Nodes?
      Voting Booth?