Must know design pattern?
whats your favourite design pattern or you think is one must know one or the one you keep seeing in the standard code?
21 Replies
Depends what type of app it is, for xaml ui applications it is MVVM
No, you don't need to know design patterns
what do you mean mtreit. 🙂
I believe mtreit means that design patterns are optional, it isnt a requirement
why do they give so much emphasis then? Like we have books as well on the topic
How to select a Design Pattern?
In this issue, we will talk about design patterns, explaining them in a simple language, what kinds of patterns we have, when to use them, and when not, all with source code examples in C#. So, let’s dive in. Postman's VS Code Extension (Sponsored) Postbot is now available across Postman with enhanced capabilities! The latest refresh of Postbot ...
O’Reilly Media
Technology Trends for 2024
What O’Reilly Learning Platform Usage Tells Us About Where the Industry Is Headed
because much like with everything else, people have different opinions, and opinions can also change over time. And code/design patterns obviously exist, they are a thing...
but studying a bunch of patterns can easily lead to "when all you have is a hammer, everything looks like a nail"
I have seen some true code horrors justified by "but I was following a well-established pattern!"
makes sense makes sense :HmmCouncilRTX3:
I think there is some merit to looking into the common patterns and knowing they exist and what problems they try to solve
but you dont need to know them by heart, or exactly every detail on them
as you code C#, you'll get familiar with a bunch of patterns even if you might not be aware of them. Modern C# uses inversion of control, and builder patterns quite a lot for example
beside job interviews, it's mainly a matter of general culture... knowing they exist & how they work seems to be a must have to me, but you shouldn't bother about it that much, pattern knowledge will come on it owns...
Around 2000-2010 design patterns were important (due to books from GoF/Martin Fowler) because people started to build large scale applications. But after that the application frameworks took over the heat so you just need to study the patterns quickly and then dive into specific frameworks. Knowing how to adapt to the patterns exposed by the frameworks is now more important than writing your own frameworks with design patterns (junior developers are rarely given the chances either).
What @Pobiega said. There are certain fundamental principles of good software engineering like encapsulation, loose coupling, high cohesion that you can learn from reading a good basic software engineering book (Code Complete, say)...you don't need to distill everything into formalized design patterns.
I also find that when I've worked on codebases where people were really into design patterns and that kind of thing, that the code was more complicated with too many layers than it needed to have.
That said, if formal design patterns speak to you and you think they will make your code better, by all means study and use them. I would read the original Gang of Four book and make up your own mind.
I was responding to the "must" part of your original question. You definitely do not need design patterns, and plenty of brilliant programmers never use them consciously.
This makes so much sense ❤️ Thank you
And builder, factory, memento, adapter, command... You can quote them all 😅
Talking about Martin Fowler, his books are pretty nice to open your mind as a junior dev (clean coding, clean coder, clean architecture) and a lot more precious than patterns...
I'm confused. You say Martin Fowler, then you list books written by uncle Bob?
Lol, indeed, not enough sleep, I meant Robert Martin
Then I will go right out and say that I strongly disagree with recommending his books to beginners.
They have not aged well, and a lot of his ideas are considered "meh" to "outright bad" these days
He has a very particular flavor of OOP that has lost a lot of momentum with the rise of functional programming, imho
hum... I cannot disagree about the fact that they not aged so well (except, maybe, for "Clean Coder" which is more about professionalism than pure technicity)
There is still a certain value to them I think, but maybe for more experienced developers who are not as... impressionable 😄
100% agree with this XD