Suppose I have a class Foo, with a private variable bar_ containing some state for Foo. If necessary, I may write public get/set metho
Foo
bar_
I prefer to use get/set function. Because I found that it is very hard to debug if use member variable directly. Especially when you have a big class and there are a lot functions access bar_.