ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Duncan Davidson <>
Subject Re: Additions changes to the taskdefs.
Date Thu, 04 Jan 2001 10:45:57 GMT
On 1/3/01 4:53 PM, "Peter Donald" <> wrote:

> Moderately modern research in developement environments that are relative
> prone to iteration (ie virtually every modern oo dev-environment) indicate
> that you should ALWAYs mark scope.

I don't think all research indicates that. Some does, obviously.

> Each is roughly equivelent however Suns approach requires the programmer to
> think. They have to know which variables are members and which are locals
> etc and worse they can shoose to ignore it and get lazy.

Actually, using the strictest guidelines from Sun along with the JavaBeans
model means that you *never* expose instance or member variables to the
public or even package scopes. Only protected (sometimes) or (usually)
private scope. (exception to this is public static final CONSTANTS which
have their own allupcase notation).

Therefore, instance names only have to be remember in one file -- not
potentially accessed from anywhere in your system as is possible when using
oo languages with less enforcement of encapsulation where you can cheat and
call things that should be private just because you can. This means that the
need to mark things out with names is very much reduced. I'd argue that it's
reduced to the point of not needed. Everything possible should be a method
call to get that variable so that maximum benefits from encapsulation are

And for those of you worried about the performance drag of method calls,
Hotspot optimizes most bean methods out to simple variable accesses at
run-time when possible -- so avoids any performance penalty.

James Duncan Davidson                              
                                                                  !try; do()

View raw message