News for hackers. Stuff that matters.
Re:Black, the uncompromising Python code formatter, is stable by Teongot on Saturday January 29, 2022 @04:13PM (#30130525)
Because "don't" is easier to read than 'don\'t'
Re:Black, the uncompromising Python code formatter, is stable by JimDabell on Sunday January 30, 2022 @01:01AM (#30134512)
If you use proper apostrophes instead of ASCII apostrophe / single quote, you don’t have to escape anything and you get better typography. "don’t" is easier to read than both.

If you’re on a Mac, Option-Shift-] will type it.

Re:Black, the uncompromising Python code formatter, is stable by JackFr on Saturday January 29, 2022 @04:39PM (#30130796)
When you’re embedding SQL in a string, a you use ‘ a lot more than “. Not the only use case, but one to give some consideration.
Re:Black, the uncompromising Python code formatter, is stable by throwaway894345 on Saturday January 29, 2022 @05:10PM (#30131084)
I think that’s only MySQL. Postgres uses double quotes for identifiers and single quotes for literals.

EDIT: I misinterpreted that single quote as a backtick. In any case, both single and double quotes are common in SQL, but single quotes are a bit more common.

Re:Black, the uncompromising Python code formatter, is stable by shpx on Saturday January 29, 2022 @04:36PM (#30130763)
Black will use single quotes if your string contains double quotes and no single quotes. It'll reformat

     print("\"Hello\" he said")
to

     print('"Hello" he said')
I think pretty much all formatters for languages that let you use either quote do this. It makes sense.
Re:Black, the uncompromising Python code formatter, is stable by iqanq on Saturday January 29, 2022 @04:25PM (#30130644)
And 'do not' is easier to read than both :)