|No such thing as a small change|
Re^4: seeds...by Anonymous Monk
|on Oct 25, 2005 at 14:32 UTC||Need Help??|
To be honest, I prefer seeing idioms. It tells me that the user has a grasp on the elegance of the language.
Or a complete lack of a grasp, in my boss's case! ;-)
Knowing when to use Perl's idioms, and when to avoid them is the real point, I think.
For example, assigning to a typeglob just to get rid of a single level of indirection is a Perl idiom that's non-obvious, and not a wonderful idea if done for no reason. If you need to play with the typeglob syntax, it's there, and it's on rare occasions quite useful, but there's no reason to dabble lightly.
My boss didn't think so. He would frequently write stuff like this:
Me, I'd just explictly dereference %$x, and skip the whole typeglob idiom, unless there was a significant reason not to do so. If I really wanted an automatic conversion, I'd probably use signatures instead. And if I were for some reason going to use the idiom, I'd point out at least the types (scalar, hash, array, or coderef) that I expected to be aliased by the idiom.
Making a section of a hash "local" is another of my boss's abuses of Perl idioms, in my opinion. Yes, you can make things "local". Wow, you can even make sections of things local. What a cute, quirky little way to express yourself: idiomatic perl at it's finest! It's barely even a documented feature!
And with it, you can call a function on a hash, and then go back, and undo what parts of the function did, based on a poorly documented set of flag settings! What fun!
Me? I'm just bitter, I guess. ;-) Too much burnout. :-(