Hacker News new | ask | show | jobs
by zmmmmm 90 days ago
String concatenation in a loop is a 1990's era Java footgun. It's interesting the things that have persisted vs been cast aside. Very significant design decisions have been enforced on far less grounds than the stupidity of how the default String concatenation operator works.
2 comments

This. I learnt Java in 2004-5, when 1.4 was dominant and O'Reilly books were a much better training resource than whatever you found on the Internet.

Concatenating of thousands of individual Strings was already considered a well-known performance killer back then.

Interesting to see this in the wild in 2026.

Does Java not have some kind of helper function to join strings? Why'd anyone write loops like that?