Skip to content

Line limit to 120 #78

Open
Open

Description

@mattBrzezinski

I'm finding the 92 line limit very restrictive and forcing breaks more often than not. Between giving a function a meaningful parameter name and typing it you're more often than not breaking this line with a couple parameters.

I'd propose increasing this line length to 120, it allows you to reasonably read two files side-by-side in an editor. I think this is goes a bit hand in hand with #76 and I think makes things easier to read.

Some Linus thoughts from a fixed 80 character limit.

Activity

  1. iamed2 commented on Nov 11, 2020

    @iamed2
    Collaborator

    I can only hit 112, not 120.

    I think 100 would be best.

  2. mattBrzezinski commented on Nov 12, 2020

    @mattBrzezinski
    MemberAuthor

    I'll take anything, do others have thoughts?

  3. fchorney commented on Nov 12, 2020

    @fchorney
    Contributor

    I think 120 is a little bit much. So I'd compromise to 100

  4. nickrobinson251 commented on Nov 12, 2020

    @nickrobinson251
    Contributor

    i'd be a little bit interested in knowing what effect this has in terms of reducing line breaks.
    JuliaFormatter has a BlueStyle and let's you configure line length (via the margin keyword e.g. format("path/to/src/", BlueStyle(); margin=N), so we could see across a bunch of different packages how changing N changes the total number of line breaks?

  5. zsz00 commented on Oct 14, 2021

    @zsz00

    I'd propose increasing this line length to 120 !!

  6. omus commented on Feb 17, 2022

    @omus
    Contributor

    If I recall correctly the original reason 92 was chosen was because it is the line length limit specified by the Julia contribution guide.

  7. mattBrzezinski commented on Feb 17, 2022

    @mattBrzezinski
    MemberAuthor

    If I recall correctly the original reason 92 was chosen was because it is the line length limit specified by the Julia contribution guide.

    The commit for this was made 7 years ago, maybe it's time to revisit? 😄

  8. mattBrzezinski commented on May 16, 2022

    @mattBrzezinski
    MemberAuthor

    i'd be a little bit interested in knowing what effect this has in terms of reducing line breaks. JuliaFormatter has a BlueStyle and let's you configure line length (via the margin keyword e.g. format("path/to/src/", BlueStyle(); margin=N), so we could see across a bunch of different packages how changing N changes the total number of line breaks?

    Just got brought up in the office again. I went through all the packages below and ran format(".", BlueStyle()) did a git add ., then re-ran format(".", BlueStyle(); margin=100) (only 100 since it seemed more agreed upon from previous discussions). These are the results of the following git diff --shortstat:

  9. Wynand commented on May 18, 2022

    @Wynand

    I'm not a linguist or typographer, but 92 characters seems fine with a few assumptions by taking
    (things on the line) * (max length of each thing) + (connectors between things) as an equation for line length

    If you assume most people can keep 5-9 things in mind at a time, that indentation is some of those things, and if you really stretch it an assume that the length limit for remembering a word is between 5 and 9, then the upper limit on that is actually (9*9 + 8) = 89

    I think 89 is short, especially considering that the 7 +- 2 rule is outdated (though 4 +- 1 is apparently more accurate) (https://en.wikipedia.org/wiki/Short-term_memory#Capacity), but it suggests that 92 characters is long enough

  10. iamed2 commented on May 19, 2022

    @iamed2
    Collaborator

    @Wynand one of the most common things, AbstractArray, is of length 13. As you have more functions in your codebase, the length of the things are probably going to increase. If you look at the top-level symbols in Base, the average size is greater than 11:

    julia> mean(length∘String, names(Base; all=true, imported=true))
    11.476996687523004
    

    (a better measurement could be done with a parser rather than just looking at the top level)

    @mattBrzezinski can you show those diffs? it might be interesting as a sample of lines that are impacted by the current line length limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions