Thanks Pifta for writing the elaborate explanation, you beat me to it :) Increase in line length was proposed a few months ago too and that time a lot of community members had disagreed with the idea. It seems this time the proposal is making it through!
I was and still am not in favor of increasing the line length. Cheers, Dinesh On Tue, May 19, 2020 at 10:14 AM István Fajth <fapi...@gmail.com> wrote: > Hi everyone! > > TLDR: > I strongly disagree to increase the limit, you can read my reasons below, > some are personal opinions formed based on a lot of (I think) clever > people's thought I read/heard over time. I do not want to block the > community to go down this way, and willing to accept the decision if that > is to go with 120 chars per line, but I wanted to explain why I disagree, > and also I would like to see what you think about these arguments. > > > > I have the following personal reasons: > - in my laptop, I can have two files in IDEA splitted horizontally with a > line length of 80, with 120 I loose this property of our source code > - in my big monitor, I can fit 4 different files in IDEA splitted > horizontally, or I can have my browser open beside my IDEA on the same > screen, with line length of 80, with 120 I loose this property or at least > I might need horizontal scrolling in the browser > - also if the lines are 120 characters long, for me it is harder to get to > the next line correctly and easily while reading if there are lines of code > after each other going up to the 120 limit > - usual argument for a longer line is long type definitions, long method > names, long parameter lists, or long accesses that spans lines with > sthg.get.get.get.set.... like calls, same is stream.map.filter.collect that > might fit into 120 characters, but this drastically limits readability, and > is already a smell, which points to increased and probably unnecessary > complexity in the code. > - sometimes I also find it hard to fit in to the 80 character limit, and I > really don't like to wrap lines, so the limit makes me do a couple of > things to prevent wrapping... for example: > - check if I can extract something from the line > - check if I can name something better to still express what it means, > but in a shorter form > - check if I can simplify the code that I use, to have a shorted access > to the functionality > - check if there is a simpler way of doing the same > - check if I am too deeply nested, and whether I should extract the > block I am in so it fits > - if after all the above measures, the line still does not fit, I look into > ways of wrapping that helps the understanding of what I am trying to > express in the code, and try to separate things visually, usually during > this process I still find ways of simplification > - with the 120 character limit, I think this process (as it initiates > lazily when I reach the limit), will trigger later, leaving the longer > lines with more complex to understand things, eventually degrading > readability, in exchange to allow less thinking when we work on to fit into > the 80 characters. > - when I read code, and I see 3-4 lines long expressions, I always realise > that not everyone feels the urge to fit into the 80 characters, and I don't > blame anyone not doing so, but still if at least a couple of us feels the > same then I strongly believe it does worth it to limit ourselves to that 80 > characters, as I believe this if just by a small portion, but pushes for a > bit more thinking with that probably a bit more values/quality in the > code... > > > There is a scientific reason as well: > - typography studies shows that the ideal line length for reading is around > 45-75 characters long, the longer the line the slower the reading, with > increasing the line length, we make it more uncomfortable reading the > longer lines, and with that we reduce the likelihood of the reader reading > through the whole line. As during most of our work, we read code, and less > time we write code, the readability is a property of the code that we must > take into account when we make these decisions... > On this see for example: > https://baymard.com/blog/line-length-readability > > https://www.smashingmagazine.com/2014/09/balancing-line-length-font-size-responsive-web-design/ > > I also suggest a small experiment: > 1. Go to your IDE > 2. Select a big class like OzoneManager > 3. Change the line length to 120 > 4. Reformat code > 5. Start to read code > > Who thinks it is better that way? (Feel free to ignore broken automatic > wrapping and concentrate on parts where there are not too much wrapping > after the change...) > I don't. > > Pifta >