Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re^3: The Cost of Nested Referencing

by lestrrat (Deacon)
on Nov 20, 2002 at 18:24 UTC ( #214560=note: print w/replies, xml ) Need Help??


in reply to Re^3: The Cost of Nested Referencing
in thread The Cost of Nested Referencing

I *personally* would rather stay away from

statement if condition statement for(@list)

...because that way I'm less likely to be bashed by others claiming that (my) perl code is unreadable ;)

Replies are listed 'Best First'.
Re^5: The Cost of Nested Referencing
by Aristotle (Chancellor) on Nov 20, 2002 at 18:34 UTC
    Why? What's more readable about
    foreach my $foo (@bar) { do_something($foo); }
    than do_something($_) foreach @bar;
    ? All I see is twice as much to type and read with absolutely no difference to the clarity. Especially when you nest a few of those and it ends up something like
    for $blah (@blah) { # ... # ... # ... if($whatever) { last; } while($foo) { if(@bar) { # ... while($baz) { # ... # ... # ... } if($whatever) { next; } elsif($snafu) { last; } else { # ... } # ... # ... } # ... } } # ... # ... }
    It's atrocious. Please use a few last if ... and spare me the effort of having to eyeparse 15 levels of indentation.

    Makeshifts last the longest.

      All I can say is that you probably don't have non-Perl programmers around you who look at your perl-ism laden perl code. I don't care myself - I think the perl-isms are cool, so I use them when it's code that only I look at. But when other people may look into it - who are not perl programmers - I try to write code that is as close to the common denominator

        Would you try to talk English such that understanding would be easier for a French? Update: choose your poison, I guess. :-)

        Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://214560]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2020-02-21 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (96 votes). Check out past polls.

    Notices?