I am trying to understand the reason behind the Engineers @ Microsoft Lab decided to add the get and set attributes. Was it just to simply add a feature or there are actual advantages, 4ex:
// Snip class Name { private String first_name; .... public String FirstName { get { return first_name; } set { first_name = value; } } // VS public String getFirstName{ return first_name; } public String setFirstName{ first_name = value; } .... }
does the very same thing. While I can add verification code to the (g/s)etFirstname methods, I cannot add any other code to the (g/s)et attributes. I would really appreciate a bit of help understanding the wisdom behind the (g/s)et attributes.
Thanks in advance
Worry is a misuse of imagination :)