Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Should I be concerned that my code doesn't fit the Gang of Four's vision of architectural sophistication?

Not necessarily.

Are design patterns all they're reported to be, or even close?

Yes, with caveats. (See Design Patterns Considered Harmful.)

Design patterns capture solutions to specific types of problems. The Gang of Four patterns are fairly generic. Additional, domain-specific patterns are also plentiful (witness the multi-volume Pattern Languages of Programming (PLOP) series.) The generic patterns are a good thing to know, because they do affect the way you look at design, in the same way that having a big bag of programming tricks can help you implement. Many of the GoF patterns are really not that sophisticated, but they do depend on structuring your code into classes. Depending on what you're doing, that might be overkill.

Is their scale [< 2000 lines] too small for pattern-based design to make an appreciable difference?

Not at all, though it depends on whether you have a problem that a pattern helps you solve. I regularly use the "Strategy" pattern on medium sized (~1000 line) scripts, but that's because a couple of things I like to do are natural candidates for strategies.


In reply to Re: Are design patterns worth it? by dws
in thread Are design patterns worth it? by FoxtrotUniform

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 sharing their wisdom with the Monastery: (6)
As of 2024-04-18 08:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found