News for hackers. Stuff that matters.
Re:Black: An uncompromising Python code formatter by aagimene on Friday May 25, 2018 @12:29PM (#17155306)
> It's not configurable.

Except for the line length:

> if you're paid by the line of code you write, you can pass --line-length with a lower number.

Re:Black: An uncompromising Python code formatter by ambivalence on Friday May 25, 2018 @12:35PM (#17155372)
Yeah, I wasn't willing to die on that hill, especially that I'm introducing a new default value that wasn't popular before.
Re:Black: An uncompromising Python code formatter by nemoniac on Saturday May 26, 2018 @05:35AM (#17161123)
Ah but there's the irony.

Everyone would like to stick to the standard formatting rules. Well... except for that one little idiosyncratic thing that they just won't sacrifice.

Then black comes storming in to enforce conformity. Well... except for that one little idiosyncratic thing the author of black just can't bring himself to adhere to.

Don't get me wrong. I'm a big fan of the approach in general. I use things like paredit-mode and aggressive-indent-mode and whitespace-mode and I've just set up emacs to use black together with blacken-mode, but with blacken-line-length set to 80.

Re:Black: An uncompromising Python code formatter by gregw2 on Saturday May 26, 2018 @05:38PM (#17164387)
Time for a fork!

Let's call it "black-ish"

Re:Black: An uncompromising Python code formatter by ben509 on Friday May 25, 2018 @06:14PM (#17158479)
It was a good call. Some code bases use long identifiers and an 80 column limit gets to be a mess.

And for the 80 column fetishists, you'd have to pry their VT-100 terminals from their cold, dead hands. Disposing of the body is enough of a pain, but worse, you have to find a recycler who can deal with the lead glass in the CRT.

Re:Black: An uncompromising Python code formatter by asah on Saturday May 26, 2018 @09:04PM (#17164978)
The modern argument for lower-line-lengths is the ability for more screens+fonts+UIs to display two blocks of code side-by-side. Somewhere between 80 and 120, you start to force many UIs to wrap. Adding to the subjectivity, approx nobody cares about one line of long code out of 100,000 -- so what percent of code-that-wraps is too much?

To avoid dying on that hill, many eng leads just throw up their hands and give into the 80-column folks, even if it's less productive for everybody else.

The beauty of gofmt and black is that formatting can become a commit hook, so no human wastes time cutting lines manually like some early 20th century typesetter.

Re:Black: An uncompromising Python code formatter by lambda on Friday May 25, 2018 @04:21PM (#17157555)
I've got to say, I'm quite happy with the default line length in Black.

The reason I always fight with people who want to increase line length is that they generally want to increase it to 100. Which is just a bit too big to fit two columns comfortably side by side at a reasonable size on a laptop screen, or three columns side by side on a wide desktop screen, which is how I generally set up my editors.

I'm always frustrated with codebases that use a 100 character standard, since I'm always running into lines that wrap, but when I use type annotations, 80 characters causes too many function signatures to have to wrap.

Re:Black: An uncompromising Python code formatter by klodolph on Friday May 25, 2018 @03:55PM (#17157310)
When I read that line in the documentation, it hurt a little. I'm going to be honest here. I did not feel good with someone saying that an 80-column limit is just there to pad my paycheck, rather than an informed decision I made. I realize that it was tongue in cheek, but it still felt bad.
Re:Black: An uncompromising Python code formatter by sametmax on Friday May 25, 2018 @04:39PM (#17157745)
If that hurt you, you need bigger problems in life.
Re:Black: An uncompromising Python code formatter by ubernostrum on Friday May 25, 2018 @06:45PM (#17158751)
I like a line length rule because I use an editor that can show me multiple files side-by-side, and keeping things to a certain length ensures that I can productively do that.

And my terminal happens to be around 240 characters wide for the font size I use and the size of my laptop's screen, which means if I limit to 80 characters or less I can snugly fit three files, or if I set to 100 I can get two with some breathing room.

Plus, if a line really is going over those lengths, then it's often a code smell: maybe I've got code that's too complex and ending up deeply-nested, or maybe I've got functions or methods taking way too many arguments, and hitting a line-length rule will warn me about that.

Re:Black: An uncompromising Python code formatter by klodolph on Friday May 25, 2018 @05:06PM (#17157986)
Why are you being so dismissive? It seems like you are making this into some kind of contest to see who has bigger problems.

I am just being honest, and I think I am being helpful because other people will also react negatively to the way the documentation is written. I support the project and want it to be successful, providing feedback like this achieves progress towards that goal, in my estimation.