Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

( Re:)+ What training do YOU need?

by rir (Vicar)
on Oct 22, 2002 at 14:57 UTC ( #207095=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: What training do YOU need?
in thread What training do YOU need?

There is not much more. The context was about changing  for(;;) to  for(@array) or to  map {} @array and doing it with an editor macro to the worst work of a weak group of perlers. In a training presentation to that group.

My points were:

  • This, in its presentation, would trivialize the issues.
  • The  for(;;) and  for(LIST) constructs are very different.
  • This a rather small issue, surely there are more important problems in the above situation.

Your comparison of the  for(;;) and  while loops is a different issue. For the simple cases I prefer a  for( $i=1; $i < 10_000_000; $i++) as all the loop's controls are there upfront. This assumes good practice, i.e. you don't fiddle with  $i while looping. If you mess with  $i then you should use a  while loop.

You say:

Usually when someone uses a C-Style for loop they are not exploiting the equivalence to a while , but rather using a slightly less readable, more error prone and less efficient form of a for (LIST) loop.

Which is exactly the difference I was refering to with: more cumbersome but more adaptable.

If brevity caused my unclarity, please let me know.


Comment on ( Re:)+ What training do YOU need?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2015-07-29 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls