The stupid question is the question not asked | |
PerlMonks |
Re: Re: Re: Re: Balancing Coding Time And Code Qualityby BrowserUk (Patriarch) |
on Dec 08, 2003 at 17:58 UTC ( [id://313162]=note: print w/replies, xml ) | Need Help?? |
Sorry diotalevi, but I guess this is (another) one of those things that we will have to agree to disagree about:) My comment was based upon your use of the word "style". It was intended to be a vaguely humourous way of indicating that style is in the eye of the beholder and critiquing on the basis of style is a little like saying that you don't like someone else choice of colour. You may not like the colour they favour, but saying that their chioce is wrong makes no sense. It's equivalent to saying that someones opinion is wrong. You may disagree with their opinion. You may be able to to prove that the facts their opinion is based upon are incorrect. But you cannot say that their opinion is wrong, because it is their opinion, and they alone are the final arbitars. The point you made about modifying the input list as a side-effect of a map statement has merit. In general, side-effects can be misleading and dangerous. However, in the specific case, as the input list was direct input from a file, and was summarily discarded after use within the map, the effect of the side-effect was also discarded and, as such, will never be available to the rest of the program or anywhere outside of the map. It is therefore impossible that it would ever have a detrimental "confusion factor" on the rest of the code. The alternative would be to read the file into an array and pass the array to chomp and then supply the chomped array to the map in order to construct the hash. Then discard the chomped array. All of which would buy you absolutely nothing, as the array would still have been modified as a side-effect of passing into chomp. All that would have been achieved is the unnecessary and confusing creation of a temporary array for no good purpose whatsoever. Under slightly different circumstances, the use of chomp within the map could be considered a bad practice. On those occasions where that would be so, the reason for it being a "bad practice" have everything to do with sound, quantifiable, technical reasons...and nothing whatsoever to do with "style". The purpose of my tongue in cheek analogy was to emphasis that your positioning a (sometimes valid) technical critique, under the banner of "style" was itself a dubious practice. I might say, that your critique itself was "bad style", but then I'd be guilty of exactly the same sin as (IMO) you were.
In Section
Meditations
|
|