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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Frankly, it just sounds like you're doing it wrong.

mandatory OO design and dependence on modules to perform even simple tasks

I don't consider either of those to be best practices.

you're an OOP elitist who spends the first 30 minutes of every script writing 50 lines of package infrastructure

If it takes you 30 minutes or 50 lines to create boilerplate for a new class, then I think you are certainly doing it wrong.

where everything should be verbose for the sake of clarity

Verbosity doesn't lead to clarity. An obsessive devotion to terseness certainly is unlikely to lead to clarity, usually the opposite. But clarity doesn't require verbosity. And verbosity can certainly go far enough that it interferes with clarity.

constantly have to type out the same one or two-line snippets to handle routine things

That's the opposite of a best practice.

I am not experienced enough to do this comfortably.

Based on what you wrote above, I'd personally encourage you to ease off on worrying about OO, verbosity, and consistency and instead concentrate on trying to write unit tests. Not primarily for the sake of testing (though that will likely prove useful), but to help you see how to do practical abstraction.

Code that can be unit tested well usually ends up being broken into logical subroutines, each with a unified and rather isolated purpose.

I think you need to first concentrate on breaking code up into logical units and get more experience and skill at figuring out how to split code effectively, producing routines with small and clear interfaces and purposes that match their names.

Once you start breaking code into subroutines with simple interfaces (which is called "modularity"), then you'll be able to wrap your head around moving some of those routines into a module.

And if your code is well tested, then you'll build confidence in your ability to refactor things without breaking them.

- tye        


In reply to Re^2: Perl Elitist Code vs Functional Code (test) by tye
in thread Perl Elitist Code vs Functional Code by morissette

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-03-29 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found