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

Reorder constructors and fields in code example on Effective Dart: Usage page #5463

Closed
1 task done
Turskyi opened this issue Jan 13, 2024 · 2 comments · Fixed by Meyyaou/site-www#1
Closed
1 task done
Labels
a.effective-dart Relates to the best practices explained in Effective Dart cl.wont-fix Issue closed as it either can't be or won't be fixed e1-hours Can complete in < 8 hours of normal, not dedicated, work from.page-issue Reported in a reader-filed concern p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. st.triage.ltw Indicates Lead Tech Writer has triaged

Comments

@Turskyi
Copy link

Turskyi commented Jan 13, 2024

Page URL

https://dart.dev/effective-dart/usage.html

Page source

https://github.com/dart-lang/site-www/tree/main/src/effective-dart/usage.md

Describe the problem

The examples on the ‘Effective Dart: Usage’ page (https://dart.dev/effective-dart/usage) currently place fields before constructors. This is inconsistent with the Dart and Flutter style guides, which recommend placing constructors first in a class. This inconsistency could potentially lead to confusion for developers, especially those who frequently switch between Dart and Flutter projects.

Expected fix

Reorder the constructors in all examples on the ‘Effective Dart: Usage’ page to align with the Dart and Flutter style guides. Specifically, adhere to the guidelines from ‘sort_constructors_first’ (https://dart.dev/tools/linter-rules/sort_constructors_first).

Additional context

This issue was raised following a pull request (#5452) that aimed to align the examples with the official style guides. The discussion in the pull request highlighted the tradition of placing fields before constructors in Dart, which is more familiar to developers from other programming languages. However, given the close relationship between Dart and Flutter, it’s worth considering the impact of these stylistic differences on the developer experience. This issue aims to gather feedback from the community on this matter.

I would like to fix this problem.

  • I will try and fix this problem on dart.dev.
@Turskyi Turskyi added the from.page-issue Reported in a reader-filed concern label Jan 13, 2024
@huycozy huycozy added st.triage.triage-team Triage team reviewing and categorizing the issue a.effective-dart Relates to the best practices explained in Effective Dart p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. e1-hours Can complete in < 8 hours of normal, not dedicated, work and removed st.triage.triage-team Triage team reviewing and categorizing the issue labels Jan 16, 2024
@huycozy huycozy changed the title [PAGE ISSUE]: 'Effective Dart: Usage' Reorder constructors and fields in code example on Effective Dart: Usage page Jan 16, 2024
@atsansone atsansone added the st.triage.ltw Indicates Lead Tech Writer has triaged label Jan 23, 2024
Meyyaou added a commit to Meyyaou/site-www that referenced this issue Feb 18, 2024
Meyyaou added a commit to Meyyaou/site-www that referenced this issue Feb 18, 2024
@atsansone atsansone added the cl.wont-fix Issue closed as it either can't be or won't be fixed label Apr 19, 2024
@atsansone
Copy link
Contributor

Per comments in #5462 , closing this issue as Won't fix.

@atsansone atsansone closed this as not planned Won't fix, can't repro, duplicate, stale Apr 19, 2024
@Turskyi
Copy link
Author

Turskyi commented Apr 19, 2024

Hello @atsansone,

I've noticed that the issue regarding the ordering of constructors and fields in the Dart style guide was closed with a reference to a previous discussion in issue #5462. I understand that decisions on such matters are complex and involve the consideration of various factors, including community standards and historical precedents.

However, I feel that the closure of the issue without an extensive community discussion may have preempted a valuable opportunity for collective input. The Dart and Flutter communities are vibrant and diverse, with a wide range of experiences and perspectives that could contribute to a more informed decision on coding style practices.

Given the significance of this topic and its potential impact on the developer experience, I believe it would be beneficial for the community to have a more open forum for discussion. This would ensure that any decision made reflects a consensus or at least a majority viewpoint, rather than the perspective of a single individual or a small group.

I respectfully request that we reconsider the closure of this issue and allow for a period of open commentary, inviting the community to share their thoughts and experiences. This could help us reach a more democratic and inclusive resolution that aligns with the best interests of both Dart and Flutter developers.

Thank you for your time and understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.effective-dart Relates to the best practices explained in Effective Dart cl.wont-fix Issue closed as it either can't be or won't be fixed e1-hours Can complete in < 8 hours of normal, not dedicated, work from.page-issue Reported in a reader-filed concern p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. st.triage.ltw Indicates Lead Tech Writer has triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants