Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » StringBuffer size [BUG]
Re: StringBuffer size [BUG] [message #21412 is a reply to message #21409] Tue, 19 May 2009 07:27 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
leidner wrote on Mon, 18 May 2009 22:31

Hi,

While it is true that the default text may simplify debugging,

I agree with the poster that this behavior violates
developers expectations (I don't know of any other API where
you have to call clear() before using an object the first time),
and because of that, it makes it more likely that bugs get
introduced in the first place.

Would you consider changing this so as to initialize with the
empty string?

Best regards
Jochen




But that would defeat the purpose of StringBuffer. You are using the constructor variant with len parameter mostly if you need to "convert" external data to String, for example in LoadFile.

If you want to start with empty string, please do not ask for non-empty one... (just do not put the length into the constructor).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: date filter bug?
Next Topic: LocalProcess in Core
Goto Forum:
  


Current Time: Sun Jun 08 06:00:50 CEST 2025

Total time taken to generate the page: 0.04639 seconds