If I went with “what fits” without thinking, besides this, I would type 60 lines into a function of 260 characters per line and still I could say that “it all fits on my screen”. It does, and I don't use the ridiculously small font size. (9 pt Courier New, a 24-inch widescreen monitor with a resolution of 1920x1200, mainly for all on-screen real estate dedicated to code, a solution browser, a code definition window, an output window, a list of errors, etc. They are located on my second monitor.)
Everyone will have their own opinion, and personally I think that these days the width of 80 characters in the other direction is a bit in the other direction, but depending on what is being discussed, I try to keep myself at 100-120 characters per line, including indentation. If it grows much longer, perhaps it has parts that can easily be broken down and put on separate lines in ways that improve readability.
Because it really is. Readability. I don't care if you use 60 characters per line or 200, but when I need to work with your code, it would be better to read easily and easily understand at a glance what it does.
Also, try breaking the code in such a way as to provide meaningful differences, which, again, are easy to read. This is another rule of thumb that I am trying to adhere to; if I compare two sets of files, I want to see changes that really matter, not kilometers, in which the only difference is the change of one character (which may well be a very correct change, but it is difficult to find in such a hippo).
source share