5 ms·
My favourite variation is from Zig: const hello_world_in_c = \\#include <stdio.h> \\ \\int main(int argc, char **argv) { \\
by Rendello 5y ago
My favourite variation is from Zig:
const hello_world_in_c =
\\#include <stdio.h>
\\
\\int main(int argc, char **argv) {
\\ printf("hello world\n");
\\ return 0;
\\}
;
It neatly sidesteps the whole "cat-and-mouse" issue.
Pair this with the fact that it only has the C++ style // comments, it means that every line can be tokenized independently. Not that that particularly matters for programmers, but I know Vim sometimes gets confused about where Python's strings end and it turns the syntax highlighting to garbage.
- afiori 5y agoit also fixes the indentation problem