Discussion about this post

User's avatar
Wyrd Smythe's avatar

I think that reading code is different enough from reading text that I'll stick with my 100-character limit, though most lines fall well short of that (I'm not one for clever one-liners; they're much worse than dad jokes).

With code, the syntax highlighting changes the equation (to the point I now find working with code without it something of a challenge). I use a lot of alignment and whitespace for readability, and I do prefer to work vertically rather than horizontally. Comments definitely have to fit in a narrower range because doc pages.

But 80 is just too restrictive for me. (In retirement, I only ever write my own hobby code anyway, so I'm free to follow any standard that works for me. 😎)

Expand full comment
MoonZ's avatar

I tried to stick to 80 columns as much as possible for a long time, but I realized that I had the tendency to use more and more very short function and variable names because of that.

Of course I try to decompose complex operations that could fit in a single line for readability and ease of maintenance, but since a few years ago, I added another practice that is sacrilege to PEP8 advocates: I align on equal signs (and colon for dicts).

It is contrary to PEP8 and makes the 80 column rule almost impossible to reasonably conform to, but since then, I find my code way, way easier to read and maintain. I generally do a pass on my fresh new code to fix PEP8 warnings and with a multiple cursor IDE (thanks PyCharm) it's done in an instant to adjust the alignment this way.

To each his own I guess ;)

Expand full comment
11 more comments...

No posts

Ready for more?