News for hackers. Stuff that matters.
Re:Black: An uncompromising Python code formatter by zestyping on Friday May 25, 2018 @09:47PM (#17159655)
I thought of another way to express this that might resonate better.

What I like about the Black philosophy is that it wants to make code style _uninteresting_. People should think about other things, not formatting. That's a great goal. So it seems to me that the best style choice is the most _boring_ choice. The least creative, least novel way. It should try to avoid inventing new formatting algorithms.

What's the most boring way to format a string literal?

The way the language already does it. The way every Python programmer has already seen string literals formatted from the very first day they started typing things into a Python interpreter.

Even if half of us liked single-quotes and half of us liked double-quotes, you can guarantee that every Python programmer on the planet has seen and lived with strings that are formatted the repr() way, including the double-quote fans. You can't guarantee the opposite.

No one could fault you for doing it the repr() way. Blame Guido :) he made that choice decades ago, and everyone has already had to make their peace with it. It's a solved problem. For anyone writing a program that emits Python code, it's the default way to format a string. It's the least assailable option, and that's a good thing.

How does that sit with you?

Re:Black: An uncompromising Python code formatter by weberc2 on Friday May 25, 2018 @10:07PM (#17159749)
I’m a Python programmer and I never had the perception that single quotes are more canonical in any capacity. I always felt that single quotes were for degenerates who didn’t realize that single quotes are most commonly used for chars by the broader programming community. ;)
Re:Black: An uncompromising Python code formatter by vijucat on Saturday May 26, 2018 @03:37AM (#17160710)
I've seen single quotes for chars vs. double quotes for Strings in Java, but in sh, it's "Strong Quoting with Single Quotes" vs. "Weak Quoting with Double Quotes":

http://www.grymoire.com/Unix/Quote.html#uh-1

"When you need to quote several character at once, you could use several backslashes. This is ugly but works. It is easier to use pairs of quotation marks to indicate the start and end of the characters to be quoted. Inside the single quotes, you can include almost all meta-characters"

So some of us associate single quotes with proper const strings, with no variable expansion, command substitution or other interpreter hanky-panky.

Re:Black: An uncompromising Python code formatter by heavenlyblue on Saturday May 26, 2018 @06:01AM (#17161206)
I’ve always thought that double quotes are for degenerates who don’t pay attention to what a standard repr output is for strings.
Re:Black: An uncompromising Python code formatter by kuroguro on Saturday May 26, 2018 @08:43AM (#17161723)
And I’ve always thought that triple quotes are for degenerates who... no, wait, nvm.
Re:Black: An uncompromising Python code formatter by heavenlyblue on Saturday May 26, 2018 @08:46AM (#17161733)
... who can’t write self-explanatory code.
Re:Black: An uncompromising Python code formatter by nerdwaller on Saturday May 26, 2018 @10:14AM (#17162115)
Code only captures the what and the how, comments for any complex routines can capture the why. Obviously overuse is probably a red-flag, but in my experience code alone doesn’t always capture enough context in any sufficiently complex system.

I get your specific comment may be a bit sarcastic, given the ancestry - but I make this one more for younger developers I see that don’t always filter that ;)

Re:Black: An uncompromising Python code formatter by aldanor on Monday May 28, 2018 @07:56AM (#17171946)
You don't have to press Shift as often to type string literals so it's a win, all other things being equal.
Re:Black: An uncompromising Python code formatter by rndgermandude on Saturday May 26, 2018 @01:12AM (#17160346)
I despise people using single quotes even more than people using tabs instead of space, emacs instead of vim or GNU-style indentation instead of... anything sane :D
Re:Black: An uncompromising Python code formatter by greyman on Saturday May 26, 2018 @07:50AM (#17161546)
I used to use single quotes for dictionary keys and other constants, and double quotes for strings intended to be read by human. I read some article about it a considered it a good convention. Now I see it actually isn't a convention. :-) I switched to black just yesterday and overall I like it, still I miss a bit this distinction between single and double quotes.