Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Are design patterns worth it?

by stephen (Priest)
on Aug 28, 2002 at 17:37 UTC ( #193518=note: print w/replies, xml ) Need Help??

in reply to Are design patterns worth it?

I don't think you have a problem-- or if you do, you also have the solution. You recognize the difference between "maintenance minefield" and "good, well-documented, loosely coupled, easy to maintain code." Once you've got that distinction, you can refactor the minefields into grassy plains as you need.

Design patterns do not define good design. They merely specify one way of getting there, and serve as examples of it. If the code is expandable, documented, and orthogonal, I don't care if it's DP-based or not.

My usual method of dealing with partially muddy designs is as follows:

  • If the code works and doesn't need to change, I don't mess with it. I write automated unit tests for it as a background task, just in case I ever do need to fix it.
  • If I need to make a change, I start by checking my unit tests to make sure they test things out well. Then I refactor bit by bit.
  • If the code doesn't work, then I'll rewrite it-- or at least the broken portions.

The only worry about bad-but-working code is the fact that bad code begets bad code. If I'm working on a project that uses a lot of globals, it's always tempting to add more globals in my new code... after all, why not? There are globals there already. It's a quick downward slide to coding cynicism.

My interactions with a Big Ball of Mud are detailed in Failure To Refactor.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2020-05-25 03:05 GMT
Find Nodes?
    Voting Booth?
    If programming languages were movie genres, Perl would be:

    Results (143 votes). Check out past polls.