October 09, 2002
Primitive types and objects

The Fishbowl's Java Peeves.

I totally agree with, uh, whatever The Fishbowl's author's name is on the primitive types and objects issue. This is being fixed in Python. I can't see Java changing so fundamentally in the near term, though.

Exceptions haven't caused me too much of a problem, but I can see his or her point. Still, it's just another one of those lots-of-boilerplate things that irritate me about Java.

Closures? Hmmm, well, useful at times, but you'd get most of the same benefit if methods were to be first class objects.

Also recently at The Fishbowl: The StringBuffer Myth and Six Rules of Unit Testing. Both worth a read.

Posted to Java by Simon Brunning at October 09, 2002 01:15 PM
Comments

The StringBuffer Myth - Reopened

What causes the big performance penalty difference of String concatenation in comparison to StringBuffer is not the number of calls to StringBuffer.append(), but the StringBuffer's capacity. If the capacity is exceeded by append(), the internal buffer needs to be re-allocated. The capacity can be changed programmatically, by passing the expected length (or somewhat more) to the StringBuffer constructor. The default StringBuffer constructor (as employed when concatenating Strings with +) defines a capacity of 16 - too few in most of the cases.

Kind regards, Arno Huetter

Posted by: Arno Huetter on December 10, 2002 04:39 PM
Post a comment
Name:


Email Address:


URL:



Comments:


Remember info?