Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: What's your programming style?

by dsheroh (Monsignor)
on Dec 08, 2018 at 09:58 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-19 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found