11

Possible Duplicate:
Are design patterns really essential nowadays?

Is it necessary have a knowledge and understanding of design patterns for someone to be a professional programmer? Why?

3
  • 2
  • 1
    You probably already use patterns (If you have written more than ten programs). Design Patterns are just formalized names for stuff you are already doing. Ar they useful to know Yes. Will it make you a better programmer (not necessarily but it will help you talk to other programers). Nov 5, 2011 at 17:10
  • Maybe you don't understand them well and hence your question (this is a guess). I don't blame you. Most of the writing I saw are not encouraging even for some one with experience in the language. In most cases, you can't find a good application for the pattern and it looks so distance from the day-to-day code that you deal with.
    – NoChance
    Nov 5, 2011 at 19:33

6 Answers 6

23

No. I only say that to be pedantic though. The term "professional programmer" really just means you get paid to program. I assure you that you can be paid to program without knowing any design patterns (I certainly did, for a few years).

However, knowing design patterns has some benefits:

  1. It's a way that other programmers tell us about general ways that they've solved general classes of problems.

  2. It's a name that you can apply to a specific pattern, and other programmers who know that pattern will understand what you mean. You can even put it into the name of the methods and classes (XyzSingleton, for instance).

  3. In many ways it's a good way to learn the shortcomings of programming languages and paradigms. For instance the Visitor pattern exists because in object-oriented programming you typically have to make a choice between an architecture where it's easier to add new types that exhibit the same interface, or easy to add new behaviors to existing types, but doing both gets complicated. Thinking about these problems informs your design decisions.

7

If you're a good programmer, you will find out yourself some of the design patterns, and later on notices that these constructions have a name.

So strictly no, but they can help you improve your object-oriented skills and they can help to communicate with fellow programmers.

5

Design patterns serve a couple of purposes:

  1. They are tried-and-true solutions to many commonly encountered problems, and
  2. Because many developers know them, they are a shorthand for communicating concepts.

You don't have to know them to be a professional developer, but not knowing them will handicap you to a certain degree, because you will be unable to "speak the language." You will also be reinventing the wheel.

2

Algorithms, Design patterns, Application architecture types are building blocks for programmers.

They are the independent of most popular languages ( C#, Java etc ) and one of the positive sides of this fact is that they can be used to communicate your thoughts easier when it comes to explaining how something is coded.

3
  • 5
    Design patterns aren't quite language independent - some languages contain certain design patterns as trivial building blocks (e.g. Iterator, Observer / Listener / Delegate), so there is no need to implement them by hand. Other languages make certain design patterns practically useless. Most patterns are based on the OO paradigm, so they often don't make sense in e.g. a functional language. Nov 5, 2011 at 16:06
  • @PéterTörök the question had tags about java and C#, its those languages I meant. But yes you are correct in your comment about other languages and especially functional ones Nov 5, 2011 at 16:22
  • Some design patterns are pretty dependent on the language you use not obsoleting them :P
    – hugomg
    Nov 5, 2011 at 19:01
1

While knowledge and understanding of design patterns is not a prerequisite to becoming a professional programmer, they are a useful tool to improve the reliability of your code, your ability to communicate with other programmers, and the ability for others to maintain the code you've written.

Just like learning additional programming languages and technologies, good understanding of design patterns improves your skill and value.

In other words, you don't need to know and understand design patterns, but the more you do understand, the better you will be professionally.

1

Patterns are not necessary to write code and get paid for it. The process of learning what types of pattens, algorithms, and architectural styles exist is a process of learning how to design and engineer software with higher internal quality and that meets more strict non functional requirements. Oh and it may be necessary if you don't want the other dev kids to laugh and point. ;)

Not the answer you're looking for? Browse other questions tagged or ask your own question.