in reply to Re^2: Two simple code style advice questions
in thread Two simple code style advice questions
You have a point, but I think you're taking it a bit too far (and yes, I did stop and think).
First of all, "dumbing down" is an awfully harsh term here. The for loop and if statement solutions that LanX suggests are functionally equivalent to any other solution that has been proposed, and there is no meaningful performance penalty.
To me "dumbing down" would be avoiding powerful language features (such as regexes) because they are confusing. That would be dumb. But this is nothing more than a benign style preference.
Perl's allowable syntax is so vast that anyone who wants to write sane code will only use a subset of it. Maybe avoiding map and the ternary operator is going too far. But as much as I love map, I have to admit that I am usually using it "because I can" not because it is clearly advantageous in my code. And as much as I love the ternary operator, it has its pitfalls (such as the can-be-used-as-an-lvalue-making-assignments-have-unexpected-behavior pitfall).
Finally, all of your examples are professionals using their jargon with other professionals. Any good doctor will speak quite differently when talking to non-medical staff or a patient. Perl, because of the nature of the language, is often used by Perl "non-professionals"--sysadmins, web designers, and others who only spend a small part of their time writing Perl code. If this is your context, it makes sense to write the code with that in mind. It would be foolish not to.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Two simple code style advice questions
by BrowserUk (Patriarch) on Jan 18, 2013 at 01:09 UTC | |
Re^4: Two simple code style advice questions
by Anonymous Monk on Jan 17, 2013 at 11:02 UTC | |
by LanX (Saint) on Jan 17, 2013 at 14:56 UTC | |
by Anonymous Monk on Jan 18, 2013 at 05:42 UTC | |
by Anonymous Monk on Jan 17, 2013 at 14:36 UTC | |
by Anonymous Monk on Jan 18, 2013 at 05:33 UTC |