It seems like such a random number, but I was just curious if there was any particular reason for using this many characters?
I believe it’s more or less random.
The Blue style guide 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).
Personally, I’m glad that it’s 92 characters. 93 would have been far too many.
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.
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.
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.
The question has been asked before:
So it’s getting on to be a FAQ, like “where does the name Julia come from?”
I did a poll on this 2 years ago:
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.
- indentation with 16–20+ spaces: consider moving code to local or global functions
- very long argument lists: group them to (immutable)
structs or similar
- closures taking up a lot of the line length: use
do, or a local named function
- if all else fails: just break that line somewhere