Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments

by einhverfr (Pilgrim)
on Nov 18, 2013 at 02:49 UTC ( #1063032=note: print w/ replies, xml ) Need Help??


in reply to Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments

First I don't want this to discourage you. I do think, however, that rperl would do better as a project aimed at expanding the realms in which Perl goes (i.e. aimed at new projects) than as a performance boost for existing projects. My current projects are entirely unlikely to ever use it, but hey if I find a use for it in a new project, I might consider it.

I am however unimpressed by the assertion that the commandments necessarily lead to less buggy code. Almost every feature in Perl has a legitimate usage, and almost every feature can be horribly abused. If you don't believe that, I have a codebase to sell you... For example, properly used, Moo and Moose can lead to more maintainable, clearer, and hence less buggy code than the old low-level blessed hashref approach. Yes I have worked a lot with both. Similarly coderefs have some very important uses which require quite a lot of annoying efforts to get around if you want to get rid of them. Same with typeglobs, etc. In general working around a legitimate use for a given approach means that you end up with complicated, unclear code.

Regarding creating clear, understandable code, the question very often times is when various things are elegant solutions to problems which do not otherwise admit of elegant solutions.


Comment on Re: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments
Re^2: Perl 5 Optimizing Compiler, Part 9: RPerl.org & The Low-Magic Perl Commandments
by Will_the_Chill (Pilgrim) on Nov 18, 2013 at 16:50 UTC
    einhverfr,

    You are correct, I expect a majority of projects utilizing RPerl will be new, rather than de-magicifying existing projects. The existing projects which are in critical need of a speed boost will have the option to upgrade their code to utilize the RPerl compiler.

    I never asserted that the commandments-as-a-whole lead to less buggy code. The only time the words "bug" or "buggy" appear are in commandments 4 & 5:

    LMPC #4. Thou Shalt Use Hard Work To Create Robust, Effective, Bug-Free, High-Quality Code That Serves A Real Need

    LMPC #5. Thou Shalt Not Use Laziness To Create Fragile, Ineffective, Buggy, Low-Quality Code That Just Saves Labor

    The exhortation to write non-buggy code is given in these 2 commandments, which is different than asserting one will write bug-free code by following all 64 commandments.

    Also, I never said that the commandments-as-a-whole lead to more readable code. The exhortation to write clear code is given in 4 more commandments, also in the "Ideals" section like the don't-write-buggy-code commandments above:

    LMPC #2. Thou Shalt Use Perl Best Practices (“perlcritic –brutal” & “perltidy -pbp”) & Idiomatic Programming

    LMPC #3. Thou Shalt Not Use Cleverness, Obfuscation, Golf, Or Non-PBP Code, Except As Officially Stated Herein

    LMPC #8. Thou Shalt Use Humility To Create Maintainable, Re-Grokkable Code That Serves The Greater Good

    LMPC #9. Thou Shalt Not Use Hubris To Create Unmaintainable, Incomprehensible Code That Just Impresses People

    So again, the idea of write-clear-code is given in the above 4 commandments, which is different than asserting one will write clearer code by following all 64 commandments.

    Which leads us to the important question: what is the point of The Low-Magic Perl Commandments, then???

    The purpose is to write low-magic code that can be made to run fast. Nothing more, nothing less.

    If any of the commandments are unclear, then please help me out so I can make them more grokkable.

    Thanks!

    Perling,
    ~ Will the Chill

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063032]
help
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: (8)
As of 2014-10-25 22:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls