rust-unofficial / patterns

A catalogue of Rust design patterns, anti-patterns and idioms
https://rust-unofficial.github.io/patterns/
Mozilla Public License 2.0
7.95k stars 362 forks source link

Should we have a subsection for short mentions and explanations of design principles (SOLID, DRY, ..) #165

Closed simonsan closed 3 years ago

simonsan commented 3 years ago

While I was looking through patterns on this repo, I noticed that people does not mention or refer to SOLID principles at all. When designing application we usually think in terms of design principles, e.g, DRY, SOLID, etc, and only then we choose specific patterns to achieve our goals. I think it would be, in particular, useful and informative to create a section for design principles too. I mean, sometimes Strategy, Command, etc,...patterns do not mean much. But if I know, for example, that a specific pattern allows me to to stay DRY, then I consider it. Personally for me, software design is built upon principles, and those principles are achieved using concrete patterns. Just my opinion :-)

Originally posted by @fade2black in https://github.com/rust-unofficial/patterns/pull/146#issuecomment-754631542

MarcoIeni commented 3 years ago

Explaining these principles in this book might be a violation of the DRY principle 😂

In my opinion we should only mention these principles here and there (maybe in introductions) by linking to wikipedia pages and stuff like this. People are free to do their own searches if they are missing something.

Any word that we write is a word we have to maintain in the future, so adding stuff it's not free! Another cost to adding stuff is the time of the reader. I prefer having different smaller focused books with respect to a giant one that tries to cover everything.

What do you think?

simonsan commented 3 years ago

I agree, found the idea interesting but it's like you said, as long as we mention the principles where they are most important, people are able to research on their own. We could also link to good articles or something - maybe in the additional resource section then. Like a subsection: Design Principles that would give it some exposure without us needed to maintain it so much because of just linking.

fade2black commented 3 years ago

Yeah, I think simply mentioning and providing links would be enough for people who'd like to make further research.

MarcoIeni commented 3 years ago

Great. Should we close this?

simonsan commented 3 years ago

Let me make a PR fixing this later with linking some principles in additional resources in a # Design principles subsection, no?

MarcoIeni commented 3 years ago

ok!

fade2black commented 3 years ago

We could close this issue.