Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 14327 invoked from network); 17 Feb 2000 18:43:05 -0000 Received: from phoenix.webslingerz.com (balld@206.66.49.24) by locus.apache.org with SMTP; 17 Feb 2000 18:43:05 -0000 Received: from localhost (balld@localhost) by phoenix.webslingerZ.com (8.8.7/8.8.7) with ESMTP id NAA05539 for ; Thu, 17 Feb 2000 13:35:34 -0500 Date: Thu, 17 Feb 2000 13:35:33 -0500 (EST) From: Donald Ball To: "'cocoon-dev@xml.apache.org'" Subject: RE: Check this! In-Reply-To: <8234CF257FAAD311A690009027B1003A421965@hqex01> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 17 Feb 2000, COFFMAN Steven wrote: > >From the article: > "Among these pitfalls are the excessive use of strings, which in the Java > language are immutable objects, and excessive use of exceptions" > > Each time you modify a String ("Hello" to "olleH") you basically create a > new object and recycle the old one. I see how this is less efficient then > merely modifying the bytes in a previously allocated array of characters, > but what alternative is there in Java? FOP uses StringBuffer all over the > place, but I thought that was *worse* than String. Are Java arrays of chars > better? StringBuffers and StringWriters are better when you're building strings. character arrays are possibly better when you're modifying strings, but I don't believe in using them much myself. StringCharacterIterators and StringReaders are good when you're iterating over strings. - donald