Skip to content

Comment on Marketing the Odin programming language is weirdparent

Comments

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

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.