Hacker News new | ask | show | jobs
by globular-toast 2024 days ago
I completely agree with all of this. I'm happy that someone has taken the time to write these arguments down in one place so I now have somewhere to refer to if the need arises.

I happen to use 88 character line lengths in Python which I think accounts for it being slightly less terse than C, but the actual line length is neither here nor there really. It's much more important for a project to just define one, make it reasonably short, and enforce it rigorously.

2 comments

Depending on the project, I would go as far as 120 characters for Python. Normal small Python scripts, somewhere around 80 - 90 seems plenty.

Working with class, using something Django, I'd go up to 120.

It doesn't really matter though. What matters is that your team pick something and agree on it. The large scale Python projects I've worked on all required that code be run through flake8, but with a custom line lenght, normally 100 to 120.

I use 80col/8space tabs with Python code. I don't recommend it. I use it because when I started a project on which I'm still working I was using it and it's lead to very ugly code though much of the blame is mine rather than the format's.