-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add reason for using primary constructor #50741
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
Conversation
Explain the benefits and trade-offs of using primary constructors in C#.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds an explanatory paragraph about the benefits and trade-offs of using primary constructors in C# to the IDE0290 style rule documentation. The addition aims to help developers understand when and why to use primary constructors versus traditional constructor syntax.
Key Changes
- Adds a new paragraph explaining the purpose and trade-offs of primary constructors
- Provides context about constructor generality versus declaration syntax complexity
BillWagner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM @gewarren
You can
once you decide on the Copilot suggestions.
* Initial plan * Rewrite primary constructor rationale in active voice Converted passive voice paragraph to active voice with conversational tone per style guidelines. Uses "you" form and simpler, more direct language. Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Explain the benefits and trade-offs of using primary constructors in C#.
Internal previews