in reply to RFC: (DRAFT Tutorial) A Gentle Introduction to Perl 6

looking for constructive criticism

204 P5 lines versus 213 P6 lines, all to do nothing useful; and the advantage of P6 is?

  • Comment on Re: RFC: (DRAFT Tutorial) A Gentle Introduction to Perl 6

Replies are listed 'Best First'.
Re^2: RFC: (DRAFT Tutorial) A Gentle Introduction to Perl 6
by u65 (Chaplain) on Aug 06, 2015 at 02:23 UTC

    First, the purpose of this tutorial is to show how to translate a real Perl 5 program with typical, often-used statements and code idioms into the equivalent Perl 6 form, and it is not intended to show the advantages of Perl 6. Second, the greater length of the Perl 6 program is due to the extra subroutine required because of a currently non-existent module in the Perl 6 system. Third, I believe the example program's utility, although simplistic, does provide a useful template for many real-world problems.

      Third, I believe the example program's utility, although simplistic, does provide a useful template for many real-world problems.

      I make no claim for being especially conversant with P6.

      But. I think it is clear from my history here that I am reasonably conversant in P5.

      I downloaded your P5 example and ran it. I reformatted it to an acceptable standard. I threw away the superfluous fluff. I trimmed the unnecessary verbosity.

      I arrived at < 50 lines of workaday Perl 5 code and ... could see nothing in it that allowed it to demonstrate a single advantage of P6 over P5. Not one.

      If your purpose is to promote P6; then take council. Choose an example that exercises P6's strengths rather than it weaknesses. Trim it to its bare minimum. Then ...

      Contrast it with the best, most idiomatic, most performent, most clear; most maintainable P5 equivalent you can muster.

      My point is: demonstrating that a P6 solution to a non-problem takes more lines of code than a P5 equivalent; does not serve the purpose of persuading those of us suffering from CP6ES (Chronic Perl 6 Expectation Syndrome), that it is time for us to re-evaluate P6.

      Bad promotion is worse than no promotion. Doubt my words? Ask Gerald Ratner about his £277.5 million per word apercu; then protest my intervention.


      Anyone got any experience of this phone's predecessor?

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.
      I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
        I downloaded your P5 example and ran it. I reformatted it to an acceptable standard. I threw away the superfluous fluff. I trimmed the unnecessary verbosity.

        Please post your version so I can see the error of my ways.

        UPDATE 1:

        I disagree with the formatting comment. My code I believe closely adheres to Prof. Conway's style. Also, I do not believe in brevity for the sake of brevity. I never know who's reading my code--most likely someone with much less Perl knowledge than most monks here.

        However, thanks to your comments, I have used perlcritic for the first time and will update the Perl 5 code soon.

Re^2: RFC: (DRAFT Tutorial) A Gentle Introduction to Perl 6
by u65 (Chaplain) on Aug 17, 2015 at 12:52 UTC

    UPDATE: Please ignore this redundant and inadvertently added comment.

    As stated, the subroutine is there because the File::Basename module is not available yet. I'm sure there's a better way to do it in Perl 6 but this works for now.