Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you use design patterns?

What's the penetration of design patterns in the real world? Do you use them in your day to day job - discussing how and where to apply them with your coworkers - or do they remain more of an academic concept?

Do they actually provide actual value to your job? Or are they just something that people talk about to sound smart?

Note: For the purpose of this question ignore 'simple' design patterns like Singleton. I'm talking about designing your code so you can take advantage of Model View Controller, etc.

like image 956
Chris Smith Avatar asked Aug 14 '08 19:08

Chris Smith


People also ask

When should we use design patterns?

Most of the time, the design pattern is used when it is clear that the developer needs its flexibility. Each design pattern has its own approach. The strategies present in each design pattern are therefore original and are never the same from one design pattern to another.

When should design patterns not be used?

If a problem has two solutions, one that fits in ten lines of code, and another one with hundreds of lines of code along with a pattern, please consider not using the pattern. Their presence isn't a quality measurement.

Do developers use design patterns?

do you use them? Yes, experienced programmers definitely do. You can avoid using most design patterns (excluding simple singleton stuff) for now; but the more you program and the more complex systems you build, the more you will feel the need to use design patterns.

What is design patterns and why anyone should use them?

Design patterns are commonly defined as time-tested solutions to recurring design problems. The term refers to both the description of a solution that you can read and an instance of that solution as used to solve a particular problem.


1 Answers

Any large program that is well written will use design patterns, even if they aren't named or recognized as such. That's what design patterns are, designs that repeatedly and naturally occur. If you're interfacing with an ugly API, you'll likely find yourself implementing a Facade to clean it up. If you've got messaging between components that you need to decouple, you may find yourself using Observer. If you've got several interchangeable algorithms, you might end up using Strategy.

It's worth knowing the design patterns because you're more likely to recognize them and then converge on a clean solution more quickly. However, even if you don't know them at all, you'll end up creating them eventually (if you are a decent programmer).

And of course, if you are using a modern language, you'll probably be forced to use them for some things, because they're baked into the standard libraries.

like image 180
Derek Park Avatar answered Oct 14 '22 01:10

Derek Park