fair point. basically this is ported from a java ...
# announcements
j
fair point. basically this is ported from a java String.format() call, which is more efficient than string literal concats iirc, so I guess I'm still trying to avoid the latter. not sure if kt improves java in that regard?
h
AFAIK String literal concats are compiled (in Java) to
StringBuilder.append(…)
and are quite efficient.
☝️ 1
j
well, I guess I've been thinking in C all these years. concat is much faster than string format. TIL. https://stackoverflow.com/questions/925423/is-it-better-practice-to-use-string-format-over-string-concatenation-in-java/925444#925444 and string format is largely preferred for localization.