4 ms·
I'm a firm believer that good code should be consistent in its style, but that consistency should not prevent the programmer from communicating intent via subje
by CrLf 7y ago
I'm a firm believer that good code should be consistent in its style, but that consistency should not prevent the programmer from communicating intent via subjective style choices.
I'm OK with following someone else's (be it an individual code owner or a team's) style rules even when I strongly disagree with them (my personal style opinions have even changed on occasion because of this).
I find code linting really useful (and even critical) to make the above two statements work well in practice.
Having said this, "black" makes me not care about the code I write. It makes me feel like I'm serving under a robotic dictator whose sole purpose is purging any trace of subjective readability in the name of consistency. This makes my code worse in ways well beyond style issues. It makes me want to abandon professional programming in python altogether.
Just to make it absolutely clear: I'm not talking about it's style choices, just how inflexible and inhuman it is. It's style choices would be another discussion.
And no, littering code with comments preventing it from reformatting specific sections of code isn't the solution.
- fastball 7y agoI have had the opposite experience. Black has been liberating for me, in that I can just worry about writing the code / worrying about the actual business logic, and Black handles all the formatting for me. I used to worry far too much about whether this style was more readable than that style, which in the end is less important than almost everything else, as long as one of them is actually readable. Now I am free. No automatic system is going to be perfect. Black might have edge-cases where a different style would be more readable, but that is true for any formatter. Using an opinionated (non-configurable) one means that I spend 0 time on config (not a useful way to spend time imo) and that my code will be consistent with the code of many others.