• icesentry@lemmy.ca
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    I have a massive ultrawide and I still 100% believe in line limits. Long lines are harder to read in general but even with a limit of 100 I frequently have 3 files opened next to each other and I can’t read entire lines easily. Line limits just aren’t about the size of the monitor and I can’t believe people still say that.

    • ZpAz@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      The best code has very little comments because the naming conventions should explain what it does and individual functions should do one thing.

      Lines should not be too long, but any IDE can do soft wrapping anyway. So it’s kind of a moot point.

    • fkn@lemmy.world
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      1 year ago

      I understand the concern, but readability and comprehension are way more important than line length. If the length impairs readability, it’s too long. Explicitly limits are terrible. Guidelines, fine.

      Ultimately, you do you. I still think your crazy and I think your argument is poor.

      • icesentry@lemmy.ca
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Yes a strict 80 character limit would be bad but that’s why modern formatters aren’t strict and default to 90-100.

        I’ve pretty much never seen code that would have been more readable had the lines been longer than that.

        My main argument is still that shorter lines are more readable. I just think it’s a bullshit argument to say that long lines are fine because large monitors exists. I don’t see how that makes me crazy.

        • fkn@lemmy.world
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          1 year ago

          See, I think length limits and readability are sometimes at odds. To say that you 100% believe in length limits means that you would prefer the length limit over a readable line of code in those situations.

          I agree that shorter lines are often more readable. I also think artificial limits on length are crazy. Guidelines, fine. Verbosity for the sake of verbosity isn’t valuable… But to say never is a huge stretch. There are always those weird edge cases that everyone hates.