News for hackers. Stuff that matters.
Re:Zig's Lovely Syntax by Metasyntactic on Sunday August 10, 2025 @02:19PM (#44857130)
Just a minor correction (as I'm the author of c#'s raw string literal feature).

The indentation of the final ` """` line is what is removed from all other lines. Not the indentation of the first line. This allows the first line to be indented as well.

Cheers, and I'm glad you like it. I thought we did a really good job with that feature :-)

Re:Zig's Lovely Syntax by gf000 on Sunday August 10, 2025 @04:17PM (#44857969)
Really not trying to go into any of the "holy wars" here, but could you please compare C#'s feature to Java's multi-line strings? I'm only familiar with the latter, and I would like to know if they are similar in concept or not.
Re:Zig's Lovely Syntax by winwang on Sunday August 10, 2025 @05:07PM (#44858286)
That's a fantastic design idea, and it seems to require all the other lines to have the same indentation "prefix".

Haven't used much C#, but I love Scala's `.stripPrefix` and `StringContext`.

Re:Zig's Lovely Syntax by panzerboiler on Monday August 11, 2025 @01:39AM (#44861034)
Did you draw inspiration from Swift's multiline string literal, or was it the other way around? The syntax looks very similar, if not identical.
Re:Zig's Lovely Syntax by kcartlidge on Monday August 11, 2025 @03:54PM (#44868709)
Thanks for the correction. I never read the spec, just started using it. And as I tend to balance my first and last line indentation I never realised.