3 ms·
> what max line width do you choose? 80 > where do you break a line if it's too long Wherever a keyword or name ends, but does not exceed 80. Gofmt has made
by perryizgr8 5y ago
> what max line width do you choose?
80
> where do you break a line if it's too long
Wherever a keyword or name ends, but does not exceed 80.
Gofmt has made opinionated decisions about everything, why stop at line breaks?
- coryrc 5y agoWhen I'm writing Python at Google, and get yet another error because my Python or Markdown line exceeds 80 characters, and read the fights on the mailing lists about changing the limit, I think Go was created because it was easier to create a whole new language than get the line length increased for Python.
- throwaway894345 5y agoWhy do you get errors rather than auto-formatting (in the editor or in CI) and moving on with your day? I would have thought Google would have this sorted already?
- coryrc 5y agoI know! Usually the editor autoformats on save and while typing, but there are some edge cases where the regular incremental formatter fails but it's rare enough that I don't reflexively hit the "format all files" button and then get caught out by pre-submit tests.
- radlad 5y agoIME 80 is terribly short in almost any language.
- perryizgr8 5y agoI like 80 because I can have three vertical windows open on my monitor and see everything without side scrolling.