NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Regexps and T-SQL (Score:1)
Regexps are usually very compact and opaque. Your comment about whitespace is spot on, so
Stored procedure code in T-SQL on the other hand is ridiculously fluffy. The syntax requires you to express your ideas in so many lines of code that sometimes you need a comment on top of each code block in order to summarize what it does. Kind of what a descriptive method name does in a sane langauge. The verbose syntax actually obscures the meaning of the code because of the low semantic density (wow, new word!).
When it comes to Perl, I find that using implicit $_ often obscures the code. Not using an explicit variable means a missed opportunity to self-document the code by naming the variable properly.
The bad rap Perl gets is probably mostly due to:
Reply to This
Re: $_ (Score:1)
I think the exact opposite.
$_has a meaning in Perl: “the current ‘thing’ being operated on”. That's a well-defined convention, and it has the advantage of being the same in every program.In other languages when people want a temporary variable they often use
iornors, but they aren'Re: $_ (Score:1)
If the code block is very brief, like in
then I agree that it isn't necessary to alias it to a new name. But if the code block is longer than a few lines, it's indeed very useful to have an actual name connected to the entity you're dealing with.
Consider the followi