I agree, string interpolation is cool, but sometimes I feel that some simple operations are more readable if you just use concatenation, like when adding a prefix to a string.
let prefixedString = prefix + string
// versus
let prefixedString = "\(prefix)\(string)"
When my brain sees latter, it thinks "oh, some serious formatting is probably going on here, I should totally spend time and energy to carefully investigate it".
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I prefer string interpolation on languages that support it.
let multiplier = 3
let message = "\(multiplier) times 2.5 is \(Double(multiplier) * 2.5)"
// message is "3 times 2.5 is 7.5
I agree, string interpolation is cool, but sometimes I feel that some simple operations are more readable if you just use concatenation, like when adding a prefix to a string.
When my brain sees latter, it thinks "oh, some serious formatting is probably going on here, I should totally spend time and energy to carefully investigate it".