Rory Primrose

Learn from my mistakes, you don't have time to make them yourself

View project on GitHub

Public Fields vs. Public Properties

Posted on October 5, 2006

Just came across this post in my feeds this morning. Interesting read.

I think there is a lack of consistency in implementations (event handlers being the classic case), but the contract/interface argument leans me towards always wrapping fields in properties. Using properties also means that you can change the code without having to change the structure of the class.

Any thoughts? Is Ian Cooper a witch? Should he be burnt at the stake? Is there a Monty Python take on this?