good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: How Much Is Too Much (on one line of code)?by adrianh (Chancellor) |
on Jun 19, 2007 at 04:15 UTC ( [id://621932]=note: print w/replies, xml ) | Need Help?? |
How do you feel about that code snippet? Too much :-) Mostly because if the trailing if means I have to re-evaluate a fairly complex LHS after I've read it. I'd also wonder about the hard-coded 'gbr'. Mostly I'd wonder if some other part of the system should "know" what the default country was. However, if this was the only place it was used I'd probably leave it inlined for the moment. I'd probably re-write it as something like:
with appropriate tweaks if the coercion of a false country to under/() in scalar/list was inappropriate in context.
In Section
Seekers of Perl Wisdom
|
|