Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love the new read-only auto properties. 90% of the objects I write are immutable and it's a pain to declare all those private readonly backing fields just to return them in getters.


Agreed, I hardly ever used auto-implemented properties for that reason. But, Is the backing field for a read-only auto-property still readonly (i.e. only assignable from within a constructor body)?


Yes, the backing field is readonly.


Why don't you use public readonly fields?


Interfaces and overriding usually.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: