Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: What's your programming style?

by dsheroh (Prior)
on Dec 08, 2018 at 09:58 UTC ( #1226951=note: print w/replies, xml ) Need Help??

in reply to What's your programming style?

None of the above.

1) Too many comments. Good names remove the need for most/all of them.

2) What's with all this CamelCase naming? Normal Perl practice is underscore_joined_names.

3) Why are you doing this yourself instead of using one of the many fine CPAN modules that handle it?

4) If you must roll your own, a regex match is much Perlier than index and, therefore, more likely to be instantly understood by someone looking at the code. I question whether the average Perl beginner would even understand your "The Beginner" version unless they're already familiar with index from past experience with other languages. (Also, the use of postfix conditionals (return if rather than  if () { return }) is rather idiosyncratic to Perl and often treated as either "advanced" or "to be avoided", rather than a "beginner" technique. I disagree with that view, but it seems to be relatively common nonetheless.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1226951]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2020-06-05 04:09 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (35 votes). Check out past polls.