In an earlier post I wrote:
"PS I use 4 spaces for indents because I read years ago in Code Complete that comparative studies had shown that a minimum of 3 is needed for clarity, and I'm used to 4 from Python;-}"
I rechecked the reference and found that my note above was incorrect. According to Code Complete second edition (page 737):
So, from now on, for Nim I'll use the Nim standard of two spaces.
Thanks for clarification, I was indeed a bit surprised by your former post.
Two spaces for indentation is indeed fine. One exception is for some proportional (none monospace) fonts with tiny spaces. And yes, I am using proportional fonts for code, they work great. Aligning lines of code like
proc myP(
i: int,
c: char
)
will not work with proportional fonts or tabs of course. But I have never done such a strange layout manually, and I think I never will.
Nice font. A quick test with a nim sample:
I wonder if using a proportional font would further discourage me from doing any...
proc myP(
i: int,
c: char
)
... space-alignment tricks.
Hmmm... a project I'll probably never get around to: design a san-serif coding font where [space] is the same size as [0..9], [a..f], and dot (.), but otherwise everything is proportional.
Everyone has their own opinion about formatting. Reading code formatted by some one else always takes getting used too. So instead of paying the mental cost of reading code formatted by others there is a chosen format that we all try to use.
You will not like that format. I will not like that format. For completely different reasons! But both of us will like the consistency. We should value consistency.
Please just use nimpretty to format your code (built into the VS-Code nim plugin) and surrender yourself to consistency.