Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Re: Re: "Perl Idioms for Java" Underway at

by simon.proctor (Vicar)
on Feb 10, 2003 at 14:48 UTC ( #234129=note: print w/replies, xml ) Need Help??

in reply to Re: Re: "Perl Idioms for Java" Underway at
in thread "Perl Idioms for Java" Underway at

With regard to the threading comment, you also test if a variable (list) is null and if it is - create a new ArrayList.

You should synchronise on the list which may mean not accepting null list variables.

As to anonymous classes, its 6 of one and half a dozen of another. They do provide the means of creating nice customisable blocks of code - I think its too easy, sometimes, to get caught up making everything defined types and using patterns (etc) but they are there. Additionally, I was thinking about your switch statement and how you are using integer vars to decide what to do. I was kind of hinting that it may be possible to keep your annonymous front end syntax and make the backend a little more complex and eliminate the switch statement as well as allow you to add more perlisms at a later stage. Note, I don't say it *is* possible, only that it *may be* possible :).

Finally, your code would look even better on 1.5 as static imports will allow (if there are no namespace collisions) for you to ignore the class name ie:
So your looping methods will look more perl-ish still (hurrah!).

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://234129]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2023-10-03 08:16 GMT
Find Nodes?
    Voting Booth?

    No recent polls found