His StringBuffer example is also wrong (the java compiler would automatically use a StringBuffer in his example).
Re:Why Python is more fun that Java
by chrisbroadfoot on Sunday August 17, 2008 @01:49PM
(#278468)
StringBuilder?
Oh yeah, that's right, since jdk1.5. It used to be StringBuffer.
Re:Why Python is more fun that Java
by chrisbroadfoot on Saturday August 16, 2008 @09:11PM
(#278099)
TRWTF is this:
for (String s : args[0].split("\\s+"))
System.out.println(s);
which is exactly the same as: System.out.println(args[0]);
(redacted) [jdale@localhost ~]$ java -cp . Test "foo bar baz"
foo
bar
baz
Re:Why Python is more fun that Java
by chrisbroadfoot on Saturday August 16, 2008 @09:55PM
(#278117)
Oh, good point. Cheers.
I then submit my Groovy solution:
args[0].split().each { println it }
System.exit(0);
It's hardly going to be fair and balanced with things like that in it.