Hacker News new | ask | show | jobs
by natvert 2493 days ago
Ok, but 2 or 4 spaces?!
3 comments

Yes. :-) The right answer depends on the project. I really appreciate it when projects have .editorconfig files so that indentation just works.

https://editorconfig.org/

4.

Also, max line width should be 120 characters. 80 is too limiting if you're using sensible variable names like you should.

3 looks pretty nice in a lot of code...
Please don't do that. Just... please... don't.

I will have trouble controlling my frustration if I ever have to work on a codebase built with 3 spaces per indentation.

There's zero logical reason to use a power of two, though.
If you use tabs, you can customize how it looks. ;)
heretic