Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Good practice for OO module defaults

by GrandFather (Saint)
on Apr 08, 2019 at 09:50 UTC ( [id://1232283]=note: print w/replies, xml ) Need Help??


in reply to Good practice for OO module defaults

Think about where someone who has never encountered the code before would most likely find and understand the default processing and defaults. To my mind having the strings in the construction code is a pretty reasonable way to do it. The code is clear, concise and easy to maintain without needing any additional explanation.

If the strings are long and span multiple lines using HEREDOCs can make it easier to see how things hang together.

For default handling defined or (//) is your friend.

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-07-23 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.