ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: Additions changes to the taskdefs.
Date Thu, 04 Jan 2001 10:58:41 GMT
At 02:45  4/1/01 -0800, James Duncan Davidson wrote:
>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.

ahhh ... check again. While not ALL research does virtually all modern
research (within last 7 years or so) does. 

>> 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).

Actually usually it is immutables that have the UPPER_CASE notation of
which static final primitive types are a subset.

>Therefore, instance names only have to be remember in one file 

bing ! The light goes on ;)
Most theory is based around what I call cognitive programming. Your eyes
should  never travel more than 2 lines above current line and 3 lines below
and you should never have to stop typing. All variables should be full
names or "well known shortcuts" which means none of those miss the vowels
or shortening of names ;)

I spent about 3 months researching all this junk for a company and had the
help of a retired psychologist who specialized in psycho-physics help me
debunk the research. Most of it was utter trite biut there was some decent
research done .. most of it on IBM employees for some strange reason ;)

>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. 

nope - most OO theory saids objects should never expose member attributes
so that is irrelevent.

>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.

And even on non-hotspot machines marking the accessor methods as final will
achieve the same for older VMs (I think 1.7+ ???).


| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |

View raw message