Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
"be consistent"
 
PerlMonks  

Re^2: If I was forced to program in another language, the Perl language feature I would miss most would be:

by Anonymous Monk
on Oct 17, 2006 at 16:37 UTC ( [id://578896]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: If I was forced to program in another language, the Perl language feature I would miss most would be:
in thread If I was forced to program in another language, the Perl language feature I would miss most would be:

It looks so nice and is so readable.

I disagree. It doesn't follow the code flow.

When debugging or analysing the code, you don't find out until the very end of the line whether or not you actually needed to read the line. By that point, you've had to read it anyway.

I find it quite jarring to read, for all but the simplest of expressions. Then again, I find the same thing for lists of English instructions, too.

unlink($file) && crack_password() && sacrifice_firstborn( $child ) && +take_over_world( $mwahahahaha ) if ( $ignore_all_that_just_kidding);
  • Comment on Re^2: If I was forced to program in another language, the Perl language feature I would miss most would be:
  • Download Code

Replies are listed 'Best First'.
Re^3: If I was forced to program in another language, the Perl language feature I would miss most would be:
by BerntB (Deacon) on Oct 17, 2006 at 22:52 UTC
    I mainly use it for returning error cases (as I showed) and for things like alternative initiation of variables:
    ... my($foo) = blah($yadda); $foo = barf->new() unless $foo; $foo = gazonkly() unless $foo; return ERROR_CODE if $foo < $boo; ...
    I am not exactly known for aesthetical good taste, but I like it. If you have a clearer way of writing things like that, please tell me.
      When code is written as

      if (<expr>) { statement }

      instead of

      statement if <expr>;
      you can mentally decipher the code in the order of control flow. That's what I prefer.

        I understand that traditional argument, the point is that I was using postfix if as an idiom in specific circumstances which make my code clearer.

        I specifically asked for "a clearer way of writing things like that", but you didn't answer -- which probably means you can't see a neater way, either.

        Update: Fixed spelling and a html tag so it worked. :-)

      Is this what Perl's or-equals or defined-or-equals operators are for?
      $foo ||= barf->new(); $foo ||= gazonkly();
      or to only test undef:
      $foo //= barf->new(); $foo //= gazonkly();

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://578896]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.