Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Main routines, unit tests, and sugar

by perlfan (Curate)
on Jun 19, 2013 at 15:47 UTC ( #1039795=note: print w/ replies, xml ) Need Help??


in reply to Main routines, unit tests, and sugar

Personally, I really like brian's modulino approach, but I use it sparingly.

Main methods are one of the things that LPW wanted to do away with, or make implied (as many other things are).

Yes, the main() or however you do it will make it more familiar with those comfortable with compiled languages. However, it's not really useful unless you're going to be taking advantage of it for things like unit testing.

Where brian's modulino approach shines for me are situations where I am writing a utility that generating a useful set of subroutines for a related set of utilities. With the modulino, I get the ability to run it as a utility or include it as a library in a related util. I get to create unit tests as well.

So, I would highly recommend that approach in these situations, rather than just arbitrarily creating a main() method.


Comment on Re: Main routines, unit tests, and sugar

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2014-07-10 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (217 votes), past polls