Live data from Hacker News

Why code lines still should not exceed 79 characters

moaboelez.medium.com

1–5 of 5 posts

Re: Why code lines still should not exceed 79 characters

#3
post #2

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.

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.

Re: Why code lines still should not exceed 79 characters

#4
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.

Re: Why code lines still should not exceed 79 characters

#5
post #3
post #2

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.

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.

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.