Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

  (email not shown publicly)

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Friday December 21, 2007
10:24 AM

Java gem of the day: Java's got for!!!

[ #35183 ]

Java has a for that iterates over arrays! (And over any object implementing the Iterable interface.)

String[] strings = {"First", "Second", "Third"};
        for (String s: strings)

This is spectacular. This most definitely did not exist the last time I looked closely at Java (circa 2001, I think, although most of the Java coding I did happened in 2002-3 or so).

Java's added piece after piece of Perl syntax. :) I knew that regular expressions had been added at some point, although I never looked at them, and I figured that like most languages where regexes are added they were probably garbage rather than being first class parts of the language. (Perl is the only language I know that has benefitted over a certain baseline from having first class regular expression variables added to it. Although regexes that are only accessible through unwieldy functions are technically better than no regexes at all, they're still not much good to you if noone uses them, yourself included, because they are too hard to use.)

For people like me who haven't checked out Java in a long, long time, it would behoove you to check out Java's version history to see what's been added.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I've been doing mostly Java for the last year. I wouldn't want to go back to pre-Java5. Generics are often slated by the Java people, but the alternative is casts everywhere. For something that's supposed to be a typesafe language, that's ridiculous.