Nasty string growth performance

Hal Fulton [mailto:hal9000@hypermetrics.com] expounded:

Perhaps you want

 buf += line

to be treated specially for strings.

you read my mind: yes.

But it isn’t… it always means

 buf = buf + line

sigh…

and I think you can see there that there is always a new
object created.

+= is not a “real” operation… it’s only syntax sugar. It’s not a
method, so it can’t possibly modify an object in place.

Clear enough. Thx.
fwiw, I’ve always thought “+” symbol is common for numeric addition and
string concatenation… Maybe my old (non-o-o) programmg style does not
apply anymore :frowning:

…or maybe the syntax sugar is more of a danger than of help…

I’m getting phobia of this “+” thingy…

Does this help any?

Yes, much. Thank you and very kind of you to.

Hal

kind regards -botp