Just for fun, here is an interesting article that argues against using
Get/Set methods, and public member variables (title: "Why getter and
setter methods are evil.")
http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html
Basically, the guy argues that this violates encapsulation and that
there are few situations in which you should use this.
On Tue, 2004-11-16 at 10:12 +0000, Marek Jarocinski wrote:
> Dear Jurgen,
>
> Often I find myself mechanically typing functions interfacing to member variables, like MyClass::GetX() and MyClass::SetX(const x), when I would prefer to access them directly by myclassobj.x
> What is the reason for making all member variables private? Have you considered relaxing this in the next version of Ox?
>
> Greetings,
>
> Marek
>
--
[log in to unmask] <[log in to unmask]>
|