Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 contemplating the Monastery: (5)
As of 2024-04-24 06:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found