Phill. W said:
I would /still/ argue for using properties, /even if/ all they do is
get or set the value. If you start your application using a field,
then change it to a property later on, you will *break* existing,
deployed code.
I design a member based on the current needs or the needs that are planned
for the future. If there's no need to make a property, I use a public field.
I won't make them *all* properties just because one *might* become a
property later. When will it be? Next year? In five years? Probably never?
In other words, I want to look at a component or it's source code at any
given point of time and it must make sense at the same point of time. If I
now look at the op's code, I'd call it bad design because the property
procedures are not necessary.
Later, if it has to be changed to a property, and if this breaks existing
code, well, that's how it is if we change the interface. Better than now
having unnecessary code.
I admit I might have a little more work later, but a) not even the
field's/property's usage changes, b) not very probable and c) better
than now having the work of writing a property instead of a field.
Luckily, the JIT-compiler can optimize these simple properties to inline
field access.
Besides, you should always /validate/ property
values as they are set (unless they're Boolean's of course).
If there is something to check, I do use a property. This was not the case
in the op's code.
Armin