Hacker News new | past | comments | ask | show | jobs | submit login

So 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.



This 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.


Fold the lines with logs. Problem solved.


That'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.


>I just hope that there is some way to automatically fold.

Depends on your editor. Vim can definitely do it.


> 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: