-
Notifications
You must be signed in to change notification settings - Fork 711
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
feat(docs): Add documentation for using records and typedef #6382
base: main
Are you sure you want to change the base?
Conversation
This commit introduces a new section in the documentation showcasing the combination of Dart's record types and `typedef` to create simple, reusable data structure for dynamic UI rendering. This approach was originally shared as an answer on Stack Overflow in Spring 2023 to the question: "Is there anything like a struct in Dart?" (https://stackoverflow.com/a/76391196/12158825). The solution received highly positive feedback via emails and comments, highlighting its usefulness for developers. This feature is now documented as a recommended approach for developers aiming to write cleaner and more maintainable Dart code that wasn't mentioned before.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
/gcbrun |
Visit the preview URL for this PR (updated for commit 1436da5): |
Hi @lrhn, could you give your thoughts on this addition, since you left the accepted answer on the stack overflow question? Thank you! |
I think the text is a little too unfocused. It's not clear what it's trying to tell the user, and unclear on why this code would be better or worse than alternatives. It's just an example, and it lacks a motivation for that example, so the reader is likely to not know what their take-away should be. The text can be improved, but that's just editing. We can fix that. (The text starts out by referring to the previous section as just "The provided example", which makes a reader think it should be something closer. It mentions UI code in a way that feels out of the blue, as something that the example shows something about, even though this is the first mention of UI in the document, and it's not mentioned in any other section. The reference to JavaScript interfaces may be relevant, but should have a link to a definition or explanation of what it is, a reader cannot be assumed to know already. Claims are made, but are generally unsupported: "without the overhead of classes" (which overhead? syntactic or runtime?), "particularly useful for..." (how?). If the section was presented as just an example, of how you can use records as simple data objects, Something like:
Or something :) I might be over-embellishing, and making this too long for a simple example. |
Not at all @lrhn, this is great! I was expecting just a review of the code alone, but I feel like you gave me a world-class lesson in technical writing in the process! I really appreciate your consideration of the docs :) @Asncodes-80, I'll update the PR to incorporate Lasse's guidance and then we can get this published on the site. Thanks so much for bringing this to our attention! |
This commit introduces a new section in the documentation showcasing the combination of Dart's record types and
typedef
to create a simple, reusable data structure for dynamic UI rendering.This approach was originally shared as an answer on Stack Overflow in Spring 2023 to the question: "Is there anything like a struct in Dart?" (https://stackoverflow.com/a/76391196/12158825). The solution received highly positive feedback via emails and comments, highlighting its usefulness for developers.
This feature is now documented as a recommended approach for developers aiming to write cleaner and more maintainable Dart code that wasn't mentioned before.
Waiting for the further feedback.
Thank you!