Settings

Theme

Why code lines still should not exceed 79 characters

moaboelez.medium.com

3 points by mariambarouma 3 years ago · 4 comments

Reader

zenosmosis 3 years ago

I do a soft limit of 80, typically only ever exceeded by a comment w/ a link in it that might bust the cap.

Despite using a 4K display, it is nice to be able to put individual code windows side by side, multiple times, and be able to read it all w/o horizontal scrolling.

I also feel that a lot of code reaching past 80 characters could be refactored.

sylware 3 years ago

Kind of true, but 79 is really damn short after a few decades of coding. I did put myself a "soft" limit up to 100 chars.

I like powers of two and 128 felt really too much and 64 was really too short.

  • uberman 3 years ago

    I kept my limit to 128 or 132 until I had to work in python. Any language that makes whitespace significant coupled with reasonably descripting naming makes that limit impractical imho.

    • sylware 3 years ago

      Well, you would have to break your code into a lot of functions to keep indentation reasonable.

      Actually, this is what it is expected in the linux kernel (but some parts did fail that by A LOT).

      Most of the time, it is all about complex expressions with explicit(long) variable names.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection