Re:A Prettier JavaScript Formatter
by Strom on Tuesday January 10, 2017 @08:50PM
(#13371093)
The fact that gofmt doesn't enforce some arbitrary line length is a blessing. I have a modern widescreen monitor and I use a maximized window text editor. I have no problem with 200 char length lines. I'm more easily annoyed by 80 (or 60, like in this case) char limits, as if I was viewing this code on punch cards.
[ Parent
| on HN ]
Re:A Prettier JavaScript Formatter
by Manishearth on Tuesday January 10, 2017 @09:56PM
(#13371382)
It can be configurable. The rust community for example sticks to 100 or 120 lines (and rustfmt lets you choose).
I have big screens but side by side diffs on unformatted code on GitHub are always wrapped. Plus I often split my screen. Not everyone uses maximized windows all the time, and in a shared codebase sometimes you want to try and cater to everyone.
> The fact that gofmt doesn't enforce some arbitrary line length is a blessing.
You don't have an infinitely long screen. You have some line length limit.
You don't usually code for one screen since you're not generally coding for yourself alone.
IMHO unlimited line length + editor soft-wrap is the best way to deal with the problem since it automatically adjust the size to the reader's screen.
Same for tabs for indentation[1], that allows the reader to set its own indentation width depending on its own preferences.
I don't really understand why people keep using spaces + fixed line length. Old habits die hard I think.
[1] tabs for indentation, space for aligning
It's infinitely scrollable though. Scrolling horizontally sometimes isn't a bad fallback.
Scrolling horizontally interrupts flow like nothing else!
99% of all software projects have a de facto or de jure line length limit for a reason.
I like to divide my screen into multiple windows each 80 or 90 columns wide, so that I can see several source files at the same time, or code and documentation and shell windows.
Line length limits help me to make really effective use of big screens.
That's exactly how I feel about it. Line length is something I couldn't care less about. If it makes sense to be on one line, then it should be. Otherwise, create the new line where it does make sense.