this post was submitted on 29 Oct 2024
5 points (85.7% liked)
C Sharp
1532 readers
2 users here now
A community about the C# programming language
Getting started
Useful resources
- C# documentation
- C# Language Reference
- C# Programming Guide
- C# Coding Conventions
- .NET Framework Reference Source Code
IDEs and code editors
- Visual Studio (Windows/Mac)
- Rider (Windows/Mac/Linux)
- Visual Studio Code (Windows/Mac/Linux)
Tools
Rules
- Rule 1: Follow Lemmy rules
- Rule 2: Be excellent to each other, no hostility towards users for any reason
- Rule 3: No spam of tools/companies/advertisements
Related communities
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Yep, I know I could assign those manually to readonly fields or such. But then I don't profit much and also risk of field duplication (as described in article). Also I use CodeRush to auto generate constructors for me (after manually typing all readonly fields) - that way I have less typing to do than using primary constructors. I guess CodeRush could do it the other way round as well, but still, there is problem with duplication at least. I don't know, perhaps is subjective, but I'm avoiding primary constructors for now.