News for hackers. Stuff that matters.

revfried

Re:Black: An uncompromising Python code formatter on Friday May 25, 2018 @12:50PM (#17155512)
A little bit of a catch 22 you think?

C++ has clangfmt.

Black has a good momentum right now it very well might be the clear winner in a few months

Re:Black: An uncompromising Python code formatter on Friday May 25, 2018 @12:43PM (#17155434)
using black is the no cognitive load in my book.
Re:Black: An uncompromising Python code formatter on Friday May 25, 2018 @12:36PM (#17155379)
Science. 88 produced smaller files than 80. And 90 and above didn’t noticeably shorten files.

Like Raymond Hettinger said in his talk beyond pep8, 90ish is better than a strict 80. If you have 81 characters on a line its a waste of time to move that to three lines and now harder to read. So there should be some buffer. that buffer is 10%. The goal is 80 but we are ok with up to 88.

Re:Black: An uncompromising Python code formatter on Friday May 25, 2018 @12:27PM (#17155292)
I find as I write code I no longer worry about alignment or long lines. When I have vim paste a section of code and its at a different indentation I just run black.
Re:Black: An uncompromising Python code formatter on Friday May 25, 2018 @12:21PM (#17155209)
yapf is not consistent, you can rerun it on source and it will reformat it multiple times. The rules for how it formats are also hard to understand