rocketraman
02/18/2022, 5:48 PMbuildString
block: overkill for this scenario, and while performant, still some runtime overhead
• String concatenation: not visually appealing, runtime overhead
• some combination of raw strings with trimMargin
and removing newlines: runtime overhead
Thoughts?Fleshgrinder
02/18/2022, 6:42 PMrocketraman
02/18/2022, 6:44 PMStringBuilder
internally.rocketraman
02/18/2022, 6:44 PMrocketraman
02/18/2022, 6:45 PMrocketraman
02/18/2022, 6:55 PMStringBuilder
.
• Mixing concat with templates does not create any extra nested StringBuilder
Given that, concat should be safe to use with no additional overhead. Nice!ephemient
02/18/2022, 7:34 PM-Xstring-concat=indy-with-constants
will be default when targeting Java 9+rocketraman
02/18/2022, 8:06 PMYoussef Shoaib [MOD]
02/19/2022, 10:39 AMFleshgrinder
02/19/2022, 10:50 AMYoussef Shoaib [MOD]
02/19/2022, 11:03 AMephemient
02/19/2022, 11:45 AMconst val
or annotations; see https://youtrack.jetbrains.com/issue/KT-14652Fleshgrinder
02/19/2022, 12:14 PM+
comes back into the picture.edrd
02/20/2022, 12:49 PMlong_str = "pretend this is a " \
"very long string"
puts long_str # "pretend this is a very long string"
Fleshgrinder
02/20/2022, 1:10 PM+
does?!?
const val longString = "pretend this is a " +
"very long string"
// GENCODE:
// public static final String longString = "pretend this is a very long string";
ephemient
02/20/2022, 1:10 PM+
works just fine, and it only works like that in Ruby due to implicit string literal concatenation, which is a misfeature in Ruby and Python leading to
"foo" "bar" == "foobar"
edrd
02/21/2022, 12:08 AM