« Deployment | Main | StudentDev Contest Results »
April 30, 2004
More on public properties
More info properties. This sort of extends on the topic Kyle covered in his article.
In Jay's post the read only situation was something I hadn't thought of with sticking with the simpler public properties. But really, regardless of which method you use if you decide to go from a read/write to a read only you're going to break something.
Jay wrote a post entitled Properties? Not my bag, baby.
When I first started writing C# code, I used properties for everything. But recently, I've felt that I was wasting a lot of time writing trivial properties. Yes, I know that in Whidbey I'll be able to use expansions to write them easily, but that still means that I have to deal with the property bodies cluttering up my code.
So, that got me thinking about whether it makes sense to be writing properties in the first place. After a bit of thought, here's my current position:
Properties are a great thing for component libraries. There are certainly cases where you would want the future-proofing and decoupling that properties gives you.
But when you're working on a single project that gets built all at once, I don't think you're getting any future-proofing benefits, and you have to pay the “property tax” the whole time.
This may be heretical, since “use properties” has been the common guideline.
What do you think?
[C# Stuff]
Posted by mikel at April 30, 2004 08:58 AM
Comments
Post a comment
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)