3 ms·
The newline character plays a very important role in formatting source code: long declarations/statements are usually broken up into several lines of code using
by axilmar 6y ago
The newline character plays a very important role in formatting source code: long declarations/statements are usually broken up into several lines of code using hidden newlines. These newlines do not alter the meaning of code.
The same hidden newlines though in a string will alter the string: they will make the string multiline.
So, in order to be more consistent with how code is formatted, I'd prefer hidden newlines in strings to not modify the strings.
- int_19h 6y agoEverything inside the quotes alters the string, so it's quite consistent in that sense. And even in a language where whitespace is completely insignificant, it's not insignificant inside a string literal.