▲ | afiori 6 hours ago | ||||||||||||||||
The best multiline strings are those where you can have proper indentations without having to guess how indentation is handled. bonus points for making nesting easy and making copy-pasting work without breaking indentation. To my knowledge only Zig's multiline strings work this way
| |||||||||||||||||
▲ | pavel_lishin a minute ago | parent | next [-] | ||||||||||||||||
I clicked on that FAQ link, because I wasn't familiar with zig-style multilines, and my initial reaction was "ew, ugly" - but reading the justifications, I think it rather won me over with how it addresses the indentation issue alone. | |||||||||||||||||
▲ | 1718627440 4 hours ago | parent | prev | next [-] | ||||||||||||||||
In C:
Granted, this is not a real multiline string, but you also have characters in your Zig example that are not part of string content (\\). | |||||||||||||||||
▲ | librasteve 6 hours ago | parent | prev [-] | ||||||||||||||||
okaay, I get that you want the indentation to work (ironically this is more important when you are multilining a Python code example), but having to manage all the \\ is a pain in the butt | |||||||||||||||||
|