DaWolf has asked for the wisdom of the Perl Monks concerning the following question:
An interesting question arised: I'd do this code snip like this:for($i=1; $i<($messages+1); $i++) { ... }
But then I've remebered my algorythm classes, when my teacher stated that you should always avoid the use of <= or >= because using them makes your program do twice the job, and therefore eat more machine resources, etc, etc...for($i=1; $i<=$messages; $i++) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Better use of for()
by bart (Canon) on Oct 31, 2003 at 15:12 UTC | |
|
Re: Better use of for()
by Limbic~Region (Chancellor) on Oct 31, 2003 at 15:16 UTC | |
|
Re: Better use of for()
by hardburn (Abbot) on Oct 31, 2003 at 17:52 UTC |