5 ms·
> Do I want to have that log span 3-6 rows, just because the silly formatter thought it is a long line? Yes. I do not understand what’s wrong with it. Code fo
by heavenlyblue 5y ago
> Do I want to have that log span 3-6 rows, just because the silly formatter thought it is a long line?
Yes. I do not understand what’s wrong with it.
Code formatting is a political stance. It’s so much easier to adopt that than have everyone have slightly different opinions on how things should be formatted.
- zelphirkalt 5y agoSo my function of 3-4 lines actual code with log lines in between (so maybe 8 lines) becomes a function of 20 lines, because of the code formatter changing those log lines and putting every argument on a new line. Now the function takes two third of my screen and I cannot scan it as quickly with my eyes any longer. I cannot simply skip log lines, but need to check for the end of the log calls instead. No thanks.
- xigoi 5y agoFold the lines with logs. Problem solved.
- zelphirkalt 5y agoThat's actually an idea. Gonna try that out next time I have this problem. I just hope that there is some way to automatically fold. I will also need to get a good keybinding in place for unfolding, in case I do want to read that log line.
- xigoi 5y ago>I just hope that there is some way to automatically fold. Depends on your editor. Vim can definitely do it.
- patrick451 5y agoThis is also one of my gripes with black. I'm pretty sure whoever wrote was getting paid per line of code. So we got an auto-formatter than optimizes for maximum line count.
- heavenlyblue 5y ago> Now the function takes two third of my screen and I cannot scan it as quickly with my eyes any longer. You should be able to scan is as fast because ignoring the 3 lines with additional spacing is easy.
- tayo42 5y ago> It’s so much easier to adopt that than have everyone have slightly different opinions on how things should be formatted. Cant this be done with just a linter to enforce some rules without forcing an auto format. I really liked just working with a linter to enforce style, as long it passed everything was fine. But still left some room for the coder to make things readable
- heavenlyblue 5y ago“Readable” is equivalent to “I am used to reading code like that” rather than “there is some idealised metric that defines readability” You are mistaking your own habits for your rationality
- tayo42 5y agoI don't think that's true otherwise I would never be able to improve my codes readability. I have received suggestions that make code better to read and have read others code that I found to be neater. If it was just my habits then everything written by other people would always be harder to read