News for hackers. Stuff that matters.
Re:Using implicit operator overloads to keep your C# API dis... by kevingadd on Friday May 09, 2014 @01:20PM (#7722043)
If the field is readonly why did you make the property in the first place? Just do public static readonly BookingTypeId Gold. It's equivalent.
Re:Using implicit operator overloads to keep your C# API dis... by Locke1689 on Friday May 09, 2014 @01:44PM (#7722215)
If this is public surface area, the change from field to property is a binary break.
Re:Using implicit operator overloads to keep your C# API dis... by danbruc on Friday May 09, 2014 @02:11PM (#7722407)
...and you never know when you might have to add something to the getter. It's the same reason why you usually prefer properties over public fields even if there is no logic in the accessors. Similarly you usually want to expose constants by wrapping them in a read-only property because otherwise the compiler will inline the constant and you can not change it without recompiling all dependencies.