Sign in
Log inSign up
Mario Cervera

96 likes

·

3.9K reads

17 comments

Matt Moll
Matt Moll
Dec 29, 2020

Really good article Mario! I'm an advocate for design patterns so this article resonates a lot!

They might not be as used as before, but they still have plenty of value for the reasons you mentioned. And I still find myself applying them frequently enough.

Keep the quality articles coming!

1
·
·1 reply
Mario Cervera
Mario Cervera
Author
·Dec 29, 2020

Thanks for your kind words Matt! 🙏

Yes, exactly. Many people believe they are not relevant anymore because we have more advanced tools that make them unnecessary. But that's not true, in my opinion.

Patterns have plenty of benefits that are not so obvious, and I wanted to highlight them here 😊

·
Apoorv Tyagi
Apoorv Tyagi
Dec 30, 2020

Amazing article Mario Cervera 👍

I didn't know that this is even a question whether design patterns are relevant or not.

Design patterns are even taught in CS degrees (not very detail though). So I always assumed that they're important as they're helpful to solve problems whose solution has been thought through already plus you added another 4 good points here in this article.

1
·
·1 reply
Mario Cervera
Mario Cervera
Author
·Dec 30, 2020

Thanks Apoorv!

Yes, it's indeed a question. I run a poll in Twitter some time ago and 20% of the people voted 'No'.

That's a valid opinion, but I wanted to give an elaborate answer about why I believe otherwise.

1
·
Maxi Contieri⭐⭐⭐
Maxi Contieri⭐⭐⭐
Dec 30, 2020

Amazing Article, Mario!

Eric's book is definitive a must read Many people stick to the original gang of four patterns, but we learned a lot, discovered many new ones and also deprecated some.

They never updated their book for reasons beyond this article and our profession continued to evolve.

1
·
·1 reply
Mario Cervera
Mario Cervera
Author
·Dec 30, 2020

Thanks Maxi!

Yes, you are right. A long time has passed and that's why I think it makes sense to wonder whether design patterns are still relevant.

But, in this article, I wanted to talk about benefits of the very notion of 'design pattern', not necessarily the patterns that are described in the GoF book.

I am not sure that this is clear in the article, but I do mention the DDD book and also 'Dependency Injection', which is a design pattern that is clearly not from the GoF book.

2
·
Anshu Shandilya
Anshu Shandilya
Dec 30, 2020

Thank you sir for an amazing article on clearing out this.

As a fresher I usually get stuck at the point whether it will be relevant to learning DP or not.

But, today you have cleared all doubts and given some solid reasons to prioritize the Design pattern.

1
·
·1 reply
Mario Cervera
Mario Cervera
Author
·Dec 30, 2020

Thanks Anshu! I am very happy to read this! 🙏

I think that the key point is that, when you learn about patterns, you do not only learn patterns. You gain much more!

That's why they are a good investment.

1
·
Romain Rochegude
Romain Rochegude
Dec 30, 2020

Hi, I like your article very much!

I'm just more mitigated about naming: I see tons of developers using a lot of terms like "strategy", "factory", "facade", etc. But we should focus on expressive naming in the domain context and these suffixes should disappear. After all, they are simply patterns...

1
·
·1 reply
Mario Cervera
Mario Cervera
Author
·Dec 30, 2020

Thanks Romain! 🙏

What you say about naming is true, but I am not saying that pattern names should appear in the code, and I am not talking about patterns from the GoF book only.

Pattern names are important during design discussions. For example, "dependency injection" is a pattern. Imagine that, during a design discussion, you have to explain to somebody else how to solve a problem applying dependency injection, but you cannot use this term. It would take much longer, wouldn't it?

That's the point about pattern names. They allow you to convey more information with less words.

1
·
Divyajyoti Ukirde
Divyajyoti Ukirde
Dec 31, 2020

Starting my career I had just studied the patterns and could not really recognise when seeing the codebase.

There's actually a need to know these patterns.

1
·
·1 reply
Mario Cervera
Mario Cervera
Author
·Dec 31, 2020

It's not easy, but you start to consider them more useful when you become very familiar with them (i.e. when you know them very intimately). At that point, you recognize them without effort, so code becomes more readable and intent-revealing (if it's has been written by someone who knows the patterns well, of course).

You also start to learn their trade-offs better, so you also know when not to apply them.

The learning process is slow, but definitely worth it 😊

1
·
Dev
Dev
Dec 31, 2020

Loved this article.

Hey can you suggest me a book on design patterns.

1
·
·2 replies
Mario Cervera
Mario Cervera
Author
·Dec 31, 2020

For me, the canonical reference "Design Patterns: Elements of Reusable Object-Oriented Software" continues to be the best book. But, it may be a bit dense for inexperienced developers. If that's your case, I suggest you read "Head-First Design Patterns" first. This book is more introductory and will help you understand the other book better.

You may also want to have a look at:

refactoring.guru/design-patterns

·
Dev
Dev
Jan 1, 2021

Thank You, I'll read both of the books. Mario Cervera

1
·
Adesanoye Samson
Adesanoye Samson
Dec 31, 2020

Amazing article talk about everything i have read concerning design patterns

1
·
·1 reply
Mario Cervera
Mario Cervera
Author
·Dec 31, 2020

Thanks for your kind words Adesanoye! 😊

·