Aaron Digulla | 15 May 14:56
Favicon

Re: [groovy-dev] I'll give a Groovy presentation at the Jazoon'08

Quoting Tom Nichols <tmnichols@...>:

> How do you call the 'each' method on iterable types?
>
> Do you do this every time?
> myList.each ({
>   ...
> })
> That would get annoying quickly I think.

I did :) Jochen just told me that I can use "myList.each() {...}".

There are two reasons why I do this:

- Consistency (I never have to think whether to omit the parens or  
not). That means I can store "typing macros" in my fingertips.

- The parens are a good visual clue for "this is a method call" (and  
not a property access). Again, my eyes are trained for these and my  
brain gets a pre-processed version when I read code - I don't have to  
"read" the line; I simply somehow "know" that it's a method call.

Regards,

--

-- 
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://www.pdark.de/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane