Photo by Dries Augustyns on Unsplash · 23/2/2016
In the project I’m working on there is a limit of 80 chars per line, in fact, in other personal projects I have, I also set a limit of 80 chars per line.
80 chars limit is one of the most used limit when programming, but why are we using this limit and no other?
If you search on the internet you’ll see that this limit is coming from:
But the question is, why are we setting this limit with current screen sizes?
Having a char limit when programming is very important because it makes code more readable, easy to follow, and it makes possible to split your screen and view your code at the same time with:
But today, most of the people have big screens with at least 24 inches, actually I use 2 monitors while writing my code, so why 80 chars?
Well, I would use a bigger limit, maybe 100 characters, this will allow to view the code in a split view in a 24 inches screen with a proper font size. But you have to take into account that you will probably have to hide the IDE sidebar if you are working in a 13″ laptop and scroll a little bit. If you are using Sublime Text “⌘K, ⌘B” will do the work.
Anyway, what is quite important is that, if you have very long lines, probably you should refactor your code.
· Adrián Gómez
Powered by Astro + TailwindCSS + Markdown