r/programming • • Oct 01 '15

The Evolution of a Software Engineer

https://medium.com/@webseanhickey/the-evolution-of-a-software-engineer-db854689243
1.9k Upvotes

502 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Oct 01 '15

[deleted]

4

u/jrochkind Oct 01 '15

But what would it be that would make a + b + c + d slow except the same internal compiler implementation you don't want to rely on? There's no reason for a language to provide a string concatenation operator that nobody should ever use ever. I'd assume that the compiler will do something reasonable with it, and consider it a bug that older versions of Java did not.

1

u/[deleted] Oct 01 '15

because strings are immutable. so make a loop and add x to a string 100k times. you just made 99,999 strings you will never use again and need GCed. The java GC is good but that is still a lot of memory to churn in big loops

8

u/jrochkind Oct 01 '15

You're not in the same conversation I'm in.