Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
ddephor44465ySure, it doesn't make sense to have long lines, code becomes less readable with growing length.
And it is often a sign of bad code, that should be refactored.
The classic 80 characters is too little today, but around 120 character should be sufficient for most cases. -
Yup, 120 chars is the perfect length nowadays. Two files open side by side are productive, long lines are counter-productive.
-
It's absolutely essential IMO. Shorter lines are readable in smaller windows, or larger fonts. I for one have bad vision, so I use 24-28px font size, and I code on a 16" laptop. Also, it's much easier if each line does only one thing, especially with function calls. Control flow is ideally laid out in one dimension. (Yeah, fuck impure functions in ternaries and especially bool operator based control flow.)
-
I try to stick to the whole Line 80 thing, but as other's have mentioned it's probably closer to the Line 120 area in practice, especially in Javascript (all of those event handlers being passed functions etc).
-
Upvote for "yes".
Used to work with guy whose name rhymes with Rohan. He was that guy who always aligned everything to right with the argument space, loved scrolling left and right. To everyone else, it was a nightmare. Don't be like Rohan, respect your fellow devs.
Related Rants
As a now obsolete practice in the age of widescreen monitors and resolutions many times greater, do you still enforce line lengths in your code?
If so, what length do you use and why?
question
line length
programing
character length