Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choose more descriptive and/or realistic examples than foo-bar-baz #301

Open
mihsamusev opened this issue Mar 9, 2022 · 5 comments · Fixed by #368
Open

Choose more descriptive and/or realistic examples than foo-bar-baz #301

mihsamusev opened this issue Mar 9, 2022 · 5 comments · Fixed by #368
Assignees
Labels
C-amendment Category: Amendments to existing content E-help wanted Call for participation: Help is requested to fix this issue

Comments

@mihsamusev
Copy link

Thank you for a great effort on the patterns book. An enhancement suggestion. There are many good examples in the book that help to relate the patterns and their application. However, in some places there are classic foo bar and baz examples that, yes, show the intended interaction that the pattern tries to achieve, but get completely decoupled from the application. I think overall useful book looses quality with those examples. Compared to the official rust book where language features are exemplified on relatable structs and functions from real life i think that should be the standard for examples.

Concrete suggestion select more descriptive example for:

@MarcoIeni
Copy link
Collaborator

Yes, I agree with you. PRs are welcome :)

@simonsan simonsan added E-help wanted Call for participation: Help is requested to fix this issue C-amendment Category: Amendments to existing content labels Mar 11, 2022
@simonsan simonsan changed the title Can we have more descriptive / realistic examples than foo-bar-baz? Choose more descriptive and/or realistic examples than foo-bar-baz Apr 8, 2023
@Owen-CH-Leung
Copy link
Contributor

@simonsan Can you assign this issue to me ? I'm eager to create PR to fix it

@simonsan
Copy link
Collaborator

Sure :)

@simonsan
Copy link
Collaborator

Both examples have been fixed now, but there are more to go, I would keep this open as a more general issue.

@mtfcd
Copy link

mtfcd commented Mar 1, 2024

As someone who is new to patterns, I've found this book to be incredibly helpful, but I'm a bit puzzled about the 'Compose Struct' chapter compared to the 'NewType' pattern.
Initially, when delving into the example code, I found it very similar to that of the NewType pattern. So, I thought 'Compose Struct' was about composing a struct using 'NewType' instances.
Now I've come to realize that the 'Compose Struct' pattern is more about struct decomposition and borrowing each field independently rather than the composition through 'NewType'.
So maybe removing the NewType from the example will be clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-amendment Category: Amendments to existing content E-help wanted Call for participation: Help is requested to fix this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants