Why use design patterns?

Keyboard Shortcuts

In this video, it’s explained what the relevance is for design patterns. Reynald discusses that the thing you want to keep in mind is that - just because you don’t need it now, doesn’t mean you won’t ever need it. If it’s a program with just 20 lines of code, patterns are an overkill but for large programs, you want to leverage design patterns when appropriate.

- [Instructor] So you might ask yourself,…do I really need to think about design patterns?…I already write code that's easily maintainable…and my code works.…Well, the thing is you want to keep in mind…that just because you don't need it now…doesn't mean you won't need it in the future.…Sure, if it's a program with just 20 lines of code,…patterns might be an overkill.…But for large programs, you want to leverage design patterns…when it's appropriate because besides the fact…that they provide solutions and make your code maintainable,…there's two other major benefits.…

The first is that they provide a shared vocabulary.…They make it easy to explain code,…rather than saying, hey, can you write code…that lets you set up and alter objects and runtime…by wrapping them in some class and leaving the object…intact without modification,…you could simply say, hey, just use the decorator pattern.…The other major thing that design patterns provide…is what I like to call academic motivation.…