Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: A brief question about testing/best practices

by davido (Cardinal)
on Jan 20, 2015 at 17:15 UTC ( [id://1113904]=note: print w/replies, xml ) Need Help??


in reply to A brief question about testing/best practices

The right honorable David Wheeler said it best: "All problems in computer science can be solved by another level of indirection, except of course for the problem of too many indirections."

Put everything into subroutines or methods. This even includes taking user input. If you can add a layer of abstraction around the while( <> ) {... then you can mock input by substituting your own version of that abstraction, for example.


Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found