Nah, you're all wrong, Prof. So are you, Jamie. :)
Benj, What you SHOULD do, is adhere to the programming standards and
guidelines of whoever is paying to have you do the programming, or whomever
is in charge of the project.
If nobody's paying you, and there's nobody to get along with, then what you
SHOULD do is whatever makes you satisfied that the code works fine, and will
work fine in the future.
If you happen to get a say in the discussion that sets the standards, great!
But, when you lose, you See Figure 1.
Now, what *I* do...that's a whole 'nother matter.
- *I* don't use those !...@#$#@$...@$% stupid Underscores. I only program in
case-sensitive languages. :)
field bob is accessed via property Bob.
- If *I* create properties, I use them internally and externally; and I set
up automagic properties so I don't have to have visible fields, if I'm not
doing anything special.
public int Bob {get; set;}
This way, if I refactor methods out of the class, I don't have to scour the
code for internal reference. As well, if I convert 'useless' properties to
auto so I can get rid of the 'field', I don't have to look for possible uses
of the field...I know when they don't exist.
Assuming a .NET language, there's no utility in using the field when you
have a property. That's why it's a BACKING field, and a property ACCESSOR.
As for the rest of the War...well, there's no sense in me taking up language
Arms against people typing blanks. :) Suffice it to say that a sentence is a
complete thought, but when you don't write in sentences in the first place,
your logic is already suspect. :)