Community

.NET Tip: Data Encapsulation: Using Properties Instead of Public Variables

(Jay Miller) I have run across some old code recently where some classes exposed public variables directly to the outside world. Even though the code works, it is very fragile. The code looked something like this: public class Person { public string Name; public int Age; }

Read More - Register for Free Membership