# Does anyone know why JuliaFormatter uses a 92 character max line length?

**URL:** <https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477>\
**Category:** Offtopic\
**Created:** [August 24, 2020, 11:14pm UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477 "2020-08-24T23:14:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewjessop](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@andrewjessop](https://discourse.julialang.org/u/andrewjessop)\
**Post date:** [August 24, 2020, 11:14pm UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477/1 "2020-08-24T23:14:40Z")

</div>

It seems like such a random number, but I was just curious if there was any particular reason for using this many characters?

[https://domluna.github.io/JuliaFormatter.jl/stable/#JuliaFormatter.jl-1](https://domluna.github.io/JuliaFormatter.jl/stable/#JuliaFormatter.jl-1)

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daniel/32/6480_2.png) [@daniel](https://discourse.julialang.org/u/daniel)\
**Post date:** [August 24, 2020, 11:57pm UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477/2 "2020-08-24T23:57:04Z")

</div>

I believe it’s more or less random.

The Blue style guide [https://github.com/invenia/BlueStyle](https://github.com/invenia/BlueStyle) suggests a line width of 92 and many people just used that because it was of the first ones and is also quite reasonable.

I don’t think there is a specific reason for 92, the motivation is just that it’s a bit wider than the standard limit of 80, which is often perceived as too narrow (the limit of 80 however has historical reasons and goes back to hardware TTY limitations, which I think is rooted in some punchcard format).

---

<div class="post-metadata">

**Author:** ![jonniedie](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jonniedie/32/12842_2.png) [@jonniedie](https://discourse.julialang.org/u/jonniedie)\
**Post date:** [August 25, 2020, 1:52am UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477/3 "2020-08-25T01:52:38Z")

</div>

Personally, I’m glad that it’s 92 characters. 93 would have been far too many.

---

<div class="post-metadata">

**Author:** ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)\
**Post date:** [August 25, 2020, 2:55am UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477/4 "2020-08-25T02:55:15Z")

</div>

80 columns was the size of an IBM punched card. I used them a lot at one time.

IIRC Univac had an alternate punched card format with 96 columns.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 25, 2020, 5:18am UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477/5 "2020-08-25T05:18:10Z")

</div>

92 is a nice number. I often use 100, but it’s actually a bit wide. 80 is way too narrow, and pointless with modern displays.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [August 25, 2020, 5:38am UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477/6 "2020-08-25T05:38:42Z")

</div>

I guess the number 92 comes from Julia formatting guidelines: [https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#general-formatting-guidelines-for-julia-code-contributions](https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#general-formatting-guidelines-for-julia-code-contributions).

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [August 25, 2020, 8:52pm UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477/7 "2020-08-25T20:52:14Z")

</div>

The question has been asked before:

[https://github.com/JuliaLang/julia/pull/9848](https://github.com/JuliaLang/julia/pull/9848)

So it’s getting on to be a FAQ, like “where does the name Julia come from?”

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 26, 2020, 12:37pm UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477/8 "2020-08-26T12:37:26Z")

</div>

I did a poll on this 2 years ago:

> [@Line length limit poll](https://discourse.julialang.org/t/line-length-limit-poll/14703):
>
> When I code in Julia, I like to keep my line length below [poll](https://discourse.julialang.org/t/line-length-limit-poll/14703/1)

and 92 was the most common choice.

I don’t think this value comes from any deep principles, it is just kind of a sweet spot for most people in the sense that longer lines usually signal a problem with the code.

In particular:

1. indentation with 16–20+ spaces: consider moving code to local or global functions
2. very long argument lists: group them to (immutable) `struct`s or similar
3. closures taking up a lot of the line length: use `do`, or a local named function
4. if all else fails: just break that line somewhere

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [May 2, 2024, 3:16pm UTC](https://discourse.julialang.org/t/does-anyone-know-why-juliaformatter-uses-a-92-character-max-line-length/45477/9 "2024-05-02T15:16:21Z")

</div>

2 posts were split to a new topic: [Setting line length limits in VS Code](https://discourse.julialang.org/t/setting-line-length-limits-in-vs-code/113747)
