[haiku-development] Re: The 80 columns limit?

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 06 Sep 2021 16:29:37 +0000

6 septembre 2021 18:03 "Ryan Leavengood" <leavengood@xxxxxxxxx> a écrit:

On Mon, Sep 6, 2021 at 11:53 AM Alexander von Gluck IV
<kallisti5@xxxxxxxxxxx> wrote:

My only worry about the soft limit vs hard limit is it will create a lot of
discourse in gerrit over line lengths which will be pretty frustrating
to contributors.

(at least with a hard line length limitation the message is pretty clear)

That's fair. But I think the basic idea is to strive to keep your code
at lower levels of nesting/indentation, but if you do have that
unavoidably long "if" statement at least having 100 columns as a hard
limit can make it less awkward. I feel like in my experience when code
hits 80 or more it is usually only by a small bit which is not very
obvious and why we spend so much time policing it. I bet this change
will streamline reviews more and someone going over 100 will be more
obvious.

I don't see the point of a soft limit. Either I know all the code will
fit in a 80 column space, and I will configure my tools (Gerrit, text
editor, ...) accordingly. Or I know it won't, and I will configure my
text editor to the hard limit. And then I will use the available space.

A soft limit may make sense if your hard limit is super large (something
like 120 or more) because then you have the additional problem that it's
hard to scan the text withyour eyes and find where the next line is.
That's the reason for rather short line lengths in books and newspapers.
But I don't think at 100 you'll really have this problem.

So in my case with my 1360px wide display at 10pt font size:
- 80 characters * 2 columns of text fits easily (with line numbers, git
  change markers, and some space left for DeskBar)
- 100 characters * 2 columns fits if I have the window in fullscreen
  (hiding deskbar)
- Above 100, I would not be able to fit two columns of text

Because of this, 80 is the most convenient option for me. 100 would be
a bit unconvenient, but I can manage. 120 would definitely be too wide.

I am probably not the only person with such a limited resolution display.
At work I have a proper 1080p display and I have no problem with 100
columns there. But this sounds like a very silly reason to have to replace
my current laptop :)

-- 
Adrien.


Other related posts: