Hacker News new | ask | show | jobs
by BiteCode_dev 1595 days ago
yapf is configurable, and that's why it never won.
1 comments

What's wrong with configurable? Too much opportunity to bikeshed?

I figured yapf was not "new" which is why black won.

Starting about 5-6 years ago there was a push in the Python community to replace solved problems with new ones in what appears to me as chasing the JavaScript community.

Instead of consolidating on existing tools that worked well but had some rough edges to smooth out, numerous projects came about to reinvent the wheel.

There is no "best format". It's a matter of opinion.

Taste is something we cannot objectively agree, and in fact, people will end up arguing even about this very statement, offering what they think is an objective measure.

Bikesheding, yes. Hours lost in meeting, chat debates, documentation to write, linting configuration. To be redone for each project, team, etc. Worse even in FOSS where everybody will come in a ticket and complain. And after while, you do it again, because the debate is never settle even in the same team or project.

There is not way to take a team of 3 people, choose a style, and make it so that they are all 100% happy with it.

Black took the road of gofmt: you can't chose. And it won because of that: it saved people time and energy.

People realize the cost was not worth the satisfaction, which you are unlikely to get anyway. Let's just move on to what matters, it's good enough. Pareto.

> Bikesheding, yes. Hours lost in meeting, chat debates, documentation to write, linting configuration

Sounds like a team problem, I've been on plenty of teams that use clang-format for c/c++ and there have never been any issues like this. Team players know that (almost all) arguing over formatting is not a good use of time. (edit: in case not clear, clang-format is extremely configurable. Set a default config and live with it forever, that's how those teams work.)

> Black took the road of gofmt: you can't chose. And it won because of that: it saved people time and energy.

I don't see how this follows, if a team was dysfunctional enough to be wasting hours and hours of time before, I can't imagine why that wouldn't continue. It just shifts from "let's change this flag in yapf" to "let's switch to yapf because black looks ugly and gives us no options".

> Sounds like a team problem,

You had a good team. I had a great mum. Some people have great doctors.

> It just shifts from "let's change this flag in yapf" to "let's switch to yapf because black looks ugly and gives us no options".

If the practice doesn't match the theory, I'd rather trust the practice.

Well if it helps your team out then that's great, I just wouldn't expect that to generalize well. But who knows, people are weird, maybe more would give up fighting about style because of a tool change than I expect.
I don't have one team, I'm a freelancer, I meet 2 teams each month. I have a large sample to generalize from.
All problems are team problems. It's OK to use technical solutions to get around them.
> Too much opportunity to bikeshed?

Yes, and also too hard to set up. It's extremely dumb, but I'm much more likely to use something I can't configure, because if I can configure it, I'm going to want to, and it'll take forever to make all those choices.

I've never had to configure yapf, even though I could...

"yapf -i --style=pep8" works great.