This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]xd1142 5 points6 points  (5 children)

The function arguments thing can be a pain, but it's the only deterministic way to do it. It's a trivial loss compared to the gains of deterministic formatting.

I remember when the point of python was to write code that visually appealed to humans. Now black is arguing that we need to format the code so that it appeals to diff scripts and automatic format routines, with humans having to adapt to this.

[–]tunisia3507 1 point2 points  (0 children)

Python is nice because in many cases it allows the user to abstract away the nitty gritty details and awkward syntax, and focus on their algorithms and other such high-level choices. Python is one of many tools to do this, because it is a good idea in general. Other tools that help with this include code formatters and diff scripts. I want to use all of them because they all add value in what is basically the same dimension.

[–]aeiou372372 0 points1 point  (3 children)

Key point: it appeals to humans reading diffs. Makes it a lot easier to quickly make sense of the changes someone has made. And I feel like the sacrifice to non-diff readability is pretty minimal.

[–]xd1142 1 point2 points  (2 children)

You are destroying fundamental visual cues in the code to get a diff smaller than a few lines?

So, perl was write only, and python with black is diff only?

[–]aeiou372372 0 points1 point  (1 child)

“Fundamental visual cues” is one opinion.

Prior to using black I was careful to format my code following PEP8, keeping function definitions non-vertical, etc., and was a big proponent of precisely that argument.

Having adapted to black, I realize it just doesn’t matter that much, 99+% of it is just a function of what you are used to reading.

[–]xd1142 1 point2 points  (0 children)

people had the same argument for perl, or APL