Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^7: Get a known substring from a stringby flowdy (Scribe) |
on Sep 14, 2016 at 19:03 UTC ( [id://1171762]=note: print w/replies, xml ) | Need Help?? |
Good answer, I must admit. I acknowledge it, but it does not really convince me. It doesn't need to, either. In my job, my code is known as "flowdy's way of Perl coding", because it is full of idioms, it is compact and created with efficiency in mind (clearly this is just my version of the story). To me, it is a compromise between resource usage of perl processing it and how quick I or a colleague of mine will get a clue of what it is supposed to do months later. Since I was said that my code is touched with awe and "Uh, let's leave him the maintenance", I have begun to think twice before getting fond of some new idiom like 1+index(...). Idiomatic code is useful when it is intuitively understood by someone not as firm in a programing language. Otherwise, it might become a boomerang, especially when not used that often, and most especially if a considerable number of different idioms of that subtle kind is used. That boomerang might hit the employer so he regrets having hired you. Only if a resource usage bottle-neck is significantly shown in benchmarks and there is a specific idiom to solve it, you are completely right. Then the use of the idiom outweighs any more thought needed for recomprehension.
In Section
Seekers of Perl Wisdom
|
|