logoalt Hacker News

drysarttoday at 2:02 PM2 repliesview on HN

All of the caveats basically boil down to "if you need to access the private backing field from anywhere other than the property getter/setter; then be aware it's going to have a funky non C# compliant field name".

In the EF Core and Automapper type of cases, I consider it an anti-pattern that something outside the class is taking a dependency on a private member of the class in the first place, so the compiler is really doing you a favor by hiding away the private backing field more obscurely.


Replies

pwdisswordfishytoday at 3:11 PM

I'm surprised there isn't something pseudorandom thrown in for good measure – like a few digits of a hash of the source file.

show 2 replies
materialpointtoday at 4:23 PM

Serialization is a pretty good cause.

show 1 reply