Kiel Hodges | 1 Aug 2003 03:05
Picon

Re: What's a another name for...?

--- In extremeprogramming <at> yahoogroups.com, Ron Jeffries 
<ronjeffries <at> X...> wrote:
> On Thursday, July 31, 2003, at 9:00:48 AM, Ron Jeffries wrote:
> 
> > In the second case, I use a language that permits me a better 
deal, as does
> > Ilja. However, if I had to use iterators, I would behave as 
if they were
> > mostly irrelevant, and would give them trivial names, still 
giving the
> > other objects application or usage-explaining names, perhaps 
like this:
> 
> >   Collection transactionsOverLimit;
> >   Iterator iter = transactionsOverLimit.iterator();
> >   while (iter.hasNext()) {
> >     Transaction overLimitTrans = (Transaction) iter.next();
> >     overLimitTrans.processLimitAction();
> >   }
> 

I have this pattern. The whole Iterator thing is noise. Using the 
same trivial name -- iter is a common choice -- makes it just a 
bit easier to ignore allowing you to focus on what's important.

> One addendum. If the same method had more than one iteration, 
especially
> nested, then I might give the iterators more meaningful names, 
such as
> accountIter and overLimitIter.
(Continue reading)

Charlie Poole | 2 Aug 2003 01:22
Favicon

RE: What's a another name for...?

Kiel,

> For Java developers jealous of C#'s better syntax for iterating 
> through collections, JDK 1.5, codenamed Tiger, will have a 
> similar syntax. Looks like Sun is dragging Java kicking and 
> screaming into the 1990s!

Or Java is dragging Sun kicking and screaming...

Charlie Poole
cpoole <at> pooleconsulting.com
www.pooleconsulting.com
www.charliepoole.org

To Post a message, send it to:   extremeprogramming <at> eGroups.com

To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe <at> eGroups.com

ad-free courtesy of objectmentor.com 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Gmane