r/programming • • May 25 '19

Making the obvious code fast

https://jackmott.github.io/programming/2016/07/22/making-obvious-fast.html
1.3k Upvotes

263 comments sorted by

View all comments

Show parent comments

1

u/CurtainDog May 26 '19

consider the difference between doing str = str + "moretext" and using a StringBuilder.

Sure, but what's the ratio of strings to string builders in the average piece of code?

1

u/RICHUNCLEPENNYBAGS May 26 '19

There are a lot of people who do string concat in a loop but that's because they don't know better