Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Writing multi-line strings in Zig is not easy.


Huh? It might be slightly wordy, but otherwise very simple and easy for both people and computers to read. Even a primitive editor with primitive highlighting can make the syntax painless.

Reasoning: https://github.com/ziglang/zig/issues/162


I really don't understand why people have issues with Zig's multiline syntax.

    \\I really don't
    \\understand why people
    \\have issues with
    \\Zig's multiline syntax


I never used Zig, but used many other languages, and that looks better than most which don't have line prefix like \\: in languages that don't need it there is confusion about significance of whitespace in the beginning of 2nd+ lines.


Yep, that's precisely what that sintax solves, and also makes it easier to build a grammar for it (think of editor syntax highlighting for example) because the multiline marker is repeated in every line, instead of being a contextual marker. This is the same reason why Zig doesn't have dedicated multiline comment syntax.


- Can't easily indent

- Can't easily copy paste

- Can't easily edit

- Looks ugly

- Harder to read




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: