Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 2
    Kelsey - could you explain how this syntax makes it any more "flexible" code? I don't see it. If you would add any "logic" to the setter or getter, then in ether case (with or without private data) you would still break the interface, as it is, and need some coding. Commented Apr 29, 2019 at 12:33
  • @BaruchAtta: changing an auto property to a non auto property or vice-versa does not break the interface. An interface says that there WILL be a getter or setter property, not how that is implemented. In fact, without looking at the code, the only way to tell the difference is by looking at the generated IL and seeing that one has a weird name and one doesn't (and in other CLI languages even that may not be true, and it's not part of the C# spec so a future or forked version doesn't have to do that). Commented Nov 25, 2021 at 16:02