home of the madduck/ blog/
OOP

But Steinar, it does... or what would you do if you had to limit the domain of a member variable so that e.g. it must not be set to an even number. If you have users of your class accessing public members everywhere, you are going to have a really hard time. Unless, of course, you use a proper language such as Python, which allows you to define implicit accessors for member variables.