Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Code Readability. Break Rule Number 5?

by DACONTI (Scribe)
on Apr 19, 2007 at 21:08 UTC ( [id://611035]=note: print w/replies, xml ) Need Help??


in reply to Re: Code Readability. Break Rule Number 5?
in thread Code Readability. Break Rule Number 5?

Perl already has a very rich set of operators, sigils and special variables
Exactly, and If you would use new symbols to rework/consolidate/make more expressive the old ones, you would have a more condensed way to code (see example nr 3 with the arrow).
About </br>
... it is fixed now...
Regs,
DACONTI
  • Comment on Re^2: Code Readability. Break Rule Number 5?

Replies are listed 'Best First'.
Re^3: Code Readability. Break Rule Number 5?
by blazar (Canon) on Apr 22, 2007 at 13:51 UTC
    Exactly, and If you would use new symbols to rework/consolidate/make more expressive the old ones, you would have a more condensed way to code

    Well, that's fine and all, but don't forget that except in specific situations, we do not strive for extreme condensation per se, we want conciness to optimise typing requirements but also clarity. Yes: conciseness increases clarity and readability, but if you exaggerate, then you degrade them instead. So all in all you want to stay balanced. If you consider for example Perl 6, which has been mentioned several times in this thread now, you may easily see that in some respect it is more condensed than current perls and in some others it is less: for example all those punctuation special vars are going away. So what can we deduce from this? Probably that at extreme forms of condensation, like those of golf, it will perform worse than Perl 5. But golf is, in fact, nothing but a game. So what about "normal" uses? Well, there's at least one pseudo-scientific (attempt at a) study in Perl6 burns 18% fewer calories. In it, the author claims to have compared equivalent Perl 5 and Perl 6 portions of code, both supposed to be "reasonably written" (i.e. we're not talking again about golf or obfu) and Text::TypingEffort suggests that "typing the Perl5 code takes about 18% more physical effort than typing the Perl6 code".

    see example nr 3 with the arrow

    The dereferencer is going to be replaced by a single dot anyway (still talking about Perl 6), which will be implicit in some cases, and although I had some attachment for the good old arrow, I see that there are good reasons to prefer the dot instead. How would the unary dereferencer look like, as an arrow?

    ->say for @list;

    No, plain horrible, even with a single charachter arrow as in your example.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://611035]
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-26 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found