DEV Community


Discussion on: 80 Characters per Line Is a Standard Worth Sticking to Even Today

kovah profile image
Kevin Woblick

Can't really relate to the given arguments but as I wrote in another thread on Hashnode, this topic is highly subjective and hardly depends on the developer itself and/or the used stack.
I am not really a fan of having two or three columns with code side-by-side and also not having the editor and browser side-by-side (mainly because the browser dev tools alone take up half of the monitor).

In my opinion, the limit may also be set based on the programming language.

Because not all programming languages are the same and they have different standards. Just take Javascript and PHP. JS is usually coded with 2 spaces while 4 spaces is the common indentation for code in PHP. While 80 chars can be pretty much in JS and a lot of space for anything you code, in PHP you hit that limit after 3 indentations with a class-based method call that contains 3 parameters. Therefore, we at Taikonauten decided to use 80 characters for HTMl, JS,... and 120 chars for PHP as hard limits. Works pretty good for us.

(Quoted myself here)

nickjj profile image
Nick Janetakis Author

I do a lot of programming with Python and Bash which typically uses 4 spaces. I also work with Ruby, Elixir and Node on a regular basis at 2 spaces.

Never had a problem with 80 characters on the 4 space languages. Maybe PHP is different?

Even on Python code bases with many thousands of lines of code, I very rarely have to think about the 80 character limit, everything just fits naturally.

That's with using very descriptive variable and function names too. I never abbreviate for the sake of line length.

Forem Open with the Forem app