Hacker News new | ask | show | jobs
by matthiaswh 16 days ago
2-spaces is the norm. The line break style varies a little more, but your example doesn't look out of place to me as someone who uses nim a lot for personal projects and Python for my day job.

Here's an example in a popular Python library that feels stylistically similar to the one you gave: https://github.com/pallets/flask/blob/main/src/flask/app.py#...

1 comments

I think it's just cultural shock. Because it's hard to distinguish nestings with 2-spaces for someone like me used to TAB identations, and they had good reason to stick with it.

> Here's an example in a popular Python library that feels stylistically similar to the one you gave: https://github.com/pallets/flask/blob/main/src/flask/app.py#...

Tbh, the example code you gave me is much more tidied up with clear separation between logical groups of statement and some comments sprawled around to guide on the control flow.