Closed iluxonchik closed 3 years ago
The patterns already include an example, do you want something more concrete like an actual real-life use rather than a toy example?
The patterns already include an example
True, but it's just a template.
No, I mean a toy example, but with code that'll actually compile. Like, give a little intro text to give an intuition of where the pattern might be used. This will specially be helpful for someone who's just beginning with rust.
As an example, you can check how the Builder pattern is presented in Effective Java, 2nd Edition book. I will try to make some pull requests this week to show you what I mean.
We are running CI with mdbook test
over the whole example section of the book. I rechecked it, and each pattern and/or idiom has examples. Every future article submitted with a PR will have an example by convention. Closing this issue therefore.
In my opinion, it would be usueful to include at least one concrete example of each pattern at the end of the file. It shouldn't be anything complicated, just something that gives the "feel" of the practical usage.