3 ms·
Agreed. Formatters are supposed to remove all cognitive burden related to formatting. But formatters like Black (for python) will do line-length based formattin
by umvi 5y ago
Agreed. Formatters are supposed to remove all cognitive burden related to formatting. But formatters like Black (for python) will do line-length based formatting which reintroduces the cognitive burden again ("oh crap, my variable names are too long, better shorten them so this line stops getting broken up"). I like gofmt better for this reason. It doesn't break up your lines based on some arbitrary line length.
- sixstringtheory 5y agoI usually set the line length limit to somewhere around 80 so I can have several columns visible at once without wrapping or truncation. So far my magic number is three columns: three code files, or one/two code files with a terminal and/or browser window thrown in the mix. Or any of these columns can be split into two vertically stacked boxes for a total of six things. I’m also a (nonultrawide) single screen coder (after many forays into the multi screen world) which has undoubtedly guided my preference.
- munificent 5y agoUltimately code is a visual medium (for most users). It is a data format consumed primarily by human eyeballs, so there is no escaping the reality that things like identifier length, line length, wrapping, etc. matter. Any other strategy is like trying to design a chair without thinking about butts. You may come up with some sort of elegant Bauhaus mathematically perfect work of art, but no one will want to sit in it.