in reply to Code Readability. Break Rule Number 5?

I think rule 5 is another way of saying "Do not expect everyone els to use the same editor configuration and a color printer as you do". It is nothing do do with editability and all to do with presentation.

There are two issues with your added richness: those keys don't exist on most keyboards and Perl already has a very rich set of operators, sigils and special variables. Adding another several layers of meaning by using special markup (that has to be composed) and borrowing syntax from APL will simply exacerbate the problem for people who already struggle to remember the full richness provided by their chosen form of expression.

Why, some people even struggle to remember simple stuff like </br> is not HTML - how do you expect them to cope with anything truly complicated?


DWIM is Perl's answer to Gödel
  • Comment on Re: Code Readability. Break Rule Number 5?

Replies are listed 'Best First'.
Re^2: Code Readability. Break Rule Number 5?
by DACONTI (Scribe) on Apr 19, 2007 at 21:08 UTC
    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
      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.