3 ms·
Python, C#, all the Java-derived languages... basically every C-ish syntax language except for C/C++ itself use + to concatenate strings. And it's an intuitive
by Pxtl 13y ago
Python, C#, all the Java-derived languages... basically every C-ish syntax language except for C/C++ itself use + to concatenate strings. And it's an intuitive concept too - adding two strings is concatentation. That makes sense.
The problem isn't + string-concat, it's silently casting numerics into strings.
"foo" + 6 + 6
Should be a compiler-error.
- krapp 13y ago"foo" + 6 + 6 >Should be a compiler-error. Why? "foo" is already a string, getting "foo66" from that makes perfect sense to me. 6 + "foo" though would be crazy.