News for hackers. Stuff that matters.
Re:Black, the uncompromising Python code formatter, is stable by monsieurbanana on Saturday January 29, 2022 @04:42PM (#30130830)
> If you don't want to discuss "taste" questions, then just don't, it doesn't matter what option you pick.

Exactly, it doesn't matter what option you pick, as long as everybody picks the same option. Enter opinionated code formatters, because otherwise how do you do it?

Re:Black, the uncompromising Python code formatter, is stable by colechristensen on Saturday January 29, 2022 @05:19PM (#30131158)
> otherwise how do you do it?

Only reject obviously quite messy code, and only rarely allow formatting rewrites. Learn that anybody’s strong preferences for a specific style or discussion of such aren’t demonstrably beneficial for the bottom line of the business or customers.

Re:Black, the uncompromising Python code formatter, is stable by darkerside on Saturday January 29, 2022 @06:15PM (#30131601)
This is a recipe for people spending time cleaning up files, back and forth, ad infinitum. Or, just letting the stubborn person win.
Re:Black, the uncompromising Python code formatter, is stable by colechristensen on Saturday January 29, 2022 @10:37PM (#30133701)
My point is you let people have their different styles, reject changes on lines where code isn't changed, and coach the style zealots to calm down. Changing a couple of bytes in a file? Don't change the style. Writing something new? Figure out what's best. Rewriting a big chunk? Make reasonable formatting choices.

Some programmers are zealots who have a hard time working with others, the solution isn't always to force the matter or acquiesce to the squeakiest wheel. A strong organization should be able to enable people do have their style and disable people from forcing their opinions on everybody or wasting everybody's time with low-value debate.

Re:Black, the uncompromising Python code formatter, is stable by crehn on Sunday January 30, 2022 @02:17AM (#30134805)
> Changing a couple of bytes in a file? Don't change the style. Writing something new? Figure out what's best. Rewriting a big chunk? Make reasonable formatting choices.

This is exactly the type of arguably useless effort we don't want to spend any time on. Having to think about what is "reasonable", "allowed", or "best" is non-negligible cognitive burden for both the writer and reviewer/reader.

Re:Black, the uncompromising Python code formatter, is stable by The_Colonel on Sunday January 30, 2022 @07:01AM (#30136321)
When I use black or other formatter, I have to exert cognitive effort to anticipate how the formatter will format the code so that I can avoid the inevitable stupid formatting decisions.

I often then tweak the code in a way that is not necessarily better, it's merely rendered better by black.

It just feels like I'm fighting against the tool half of the time.

Re:Black, the uncompromising Python code formatter, is stable by dragonwriter on Saturday January 29, 2022 @11:23PM (#30134006)
> My point is you let people have their different styles, reject changes on lines where code isn't changed, and coach the style zealots to calm down

Code with style changes, especially within a file, is harder to follow than almost any reasonable consistent style. And adopting a common formatter with common settings is a lot less work than “reject changes on lines where code isn't changed, and coach the style zealots to calm down” even if it was neutral in readability.

Re:Black, the uncompromising Python code formatter, is stable by paiute on Saturday January 29, 2022 @11:20PM (#30133986)
I think it's a tell when people get so fussy about style, if you can't get past non functional differences how are you going do on differences of functional differences. "my code is spaghetti and performs poorly, but at least I used a formatter!"