in reply to Re: Re: Think for yourself.
in thread is the use of map in a void context deprecated ?
Then we extract different semantic value from the same code. To me both grep and map make me start looking for where the return is going, because the return is likely to be the point of the operation. By contrast a for loop tells me that the action of the loop is what I should focus on. This bias is strong enough that while I am happy to have loops have side-effects, I will go out of my way to rewrite maps or greps with side-effect in their blocks to be regular loops instead.
If you are not the only maintainer of your code, it might be worthwhile to find out what both constructs mean to them. Remember that meaning is highly dependent on the context that the reader brings to the document. If people around you read it the same way, then the map solution may well be more maintainable in your environment. If they read it differently, then it may be better to retrain your intuition to match theirs. This kind of issue is one where having people be on the same page matters more than what page everyone is on.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Think for yourself.
by thelenm (Vicar) on Oct 06, 2003 at 16:37 UTC | |
by gwadej (Chaplain) on Oct 30, 2003 at 05:36 UTC | |
Re: Re: Re: Re: Think for yourself.
by gwadej (Chaplain) on Oct 30, 2003 at 06:02 UTC | |
by tilly (Archbishop) on Oct 30, 2003 at 15:49 UTC | |
by gwadej (Chaplain) on Nov 04, 2003 at 03:52 UTC | |
by tilly (Archbishop) on Nov 04, 2003 at 06:24 UTC | |
by BrowserUk (Patriarch) on Oct 30, 2003 at 20:15 UTC | |
by tilly (Archbishop) on Oct 30, 2003 at 22:01 UTC | |
by BrowserUk (Patriarch) on Oct 30, 2003 at 22:38 UTC | |
|
In Section
Seekers of Perl Wisdom