DEV Community

Discussion on: Maximum line length in your code

Collapse
 
johnkennedy9147 profile image
John Kennedy

Why stick to an arbitrary max length at all?
Make lines as long as is natural for the code without having to horizontally scroll.

Collapse
 
stenpittet profile image
Sten

In my case it comes in handy when I have 2 files opened side-by-side. I switched to 120 from 80 and it works pretty well for me.

Collapse
 
khophi profile image
KhoPhi

Now that's the principle.

I think there shouldn't be any definite edged-in-stone approach to maxlengths.

In my case, I simply turn on the text wrap in whatever IDE, and it fits what's right in the viewport.

Collapse
 
monknomo profile image
Gunnar Gissel

I like max lengths because I usually work in an IDE with other devs. A shared max length means we can all format our code on save, and it doesn't mess each other up

Collapse
 
buinauskas profile image
Evaldas Buinauskas

This usually comes from tools like GitHub or VSTS. These will enforce horizontal code scrolling on code comparison if lines are longer than {x} characters.