3 ms·
I love everything Nim but that. Spaces-only indentation forces you to write with an at least mediocre code editor and that's a gripe, for the rest it's just me
by foul 2y ago
I love everything Nim but that. Spaces-only indentation forces you to write with an at least mediocre code editor and that's a gripe, for the rest it's just me that i'm C-brain-damaged, i even wrote an awk preprocessor for writing multi-line blocks with curly braces delimitation. I don't recommend my habits as the right way, they are probably the wrongest of ways.
- archargelod 2y ago> Spaces-only indentation forces you to write with an at least mediocre code editor I don't understand how is that an issue, unless you write your code in notepad =). And even if you do use dumb text editor, you can quickly write code with 1-space indentation and reformat it with nph[0]. There's also a neat trick for people who like C-style languages. If you use sufficiently enough parenthesis and semicolons - you don't need indentation at all: import os;proc main = (let file = paramstr(1);(for line in file.lines:(echo line; if line == "": return))) Random thought: it shouldn't be too hard to write a formatting tool that translates braces to indentation and vice versa. But I have yet to see a project like this for Nim. 0 - https://github.com/arnetheduck/nph https://github.com/arnetheduck/nph
- foul 2y ago> import os;proc main = (let file = paramstr(1);(for line in file.lines:(echo line; if line == "": return))) Yeah, bliss-style, you know in docs it isn't made clear that that works but i sensed that would. > Random thought: it shouldn't be too hard to write a formatting tool that translates braces to indentation and vice versa. But I have yet to see a project like this for Nim. It's a hour-long "project" if you don't care about how to treat pragma annotations. I did just that.