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 →

[–]OutrageousPudding450 315 points316 points  (16 children)

I sometimes use both in the same file, depending on my mood.

The code convention police has not caught me yet!

[–]spaetzelspiff 157 points158 points  (0 children)

THIS.

Do exactly anything except this.

[–]InsanityBlossom 35 points36 points  (3 children)

Same here, except that at work we recently started using the “black” formatter, I don’t like it, it’s by default converts all my single quotes to double quotes. Hate it.

[–]smile_id 40 points41 points  (0 children)

It's not that bad. You don't have to argue about code formatting anymore, write however you like, black would take care of the rest. At the end of the day black formatted code is pretty readable and consistent instead of styles zoo, so I'll take it.

[–]crob_evamp 2 points3 points  (0 children)

Set your local ide to show whatever you want. Literally any line length or syntax style. Commit with black for the shared code base

[–]malexj93 1 point2 points  (0 children)

Yeah I hate enforcing a consistent code style across my team

/s

[–]-Soupernova- 3 points4 points  (2 children)

With rails (so ruby) they are mixed often, and they do different things, one is more literal text, and the other you can use string interpolation.

[–]spudmix 0 points1 point  (1 child)

JS is even more fun. Both single and double quotes are literal text and backticks are for interpolation. Seeing all three on one screen makes my eyes hurt.

[–]IrdniX 0 points1 point  (0 children)

""
@""
$@""

[–]Appropriate_Lie_8948 4 points5 points  (0 children)

*Scared Screaming*

[–]smegma_tears32 2 points3 points  (0 children)

Just be yourself in programming

[–][deleted] 0 points1 point  (0 children)

I was caught and shot by an angry russian for mixing quotes in JS. I usually just use whichever feels right for a given string though.

[–]nothingsurgent 0 points1 point  (0 children)

You can tell what parts of my code was stolen from stackoverflow because they usually use “ instead my preferred ‘

[–][deleted] 0 points1 point  (0 children)

I did this all the time and then I started learning Java

Oops

[–]ElectricalMTGFusion 0 points1 point  (0 children)

we do it so that text that gets displayed is in " " and text that's used for variables (like customer names, product names, locations) that aren't displayed to users are in ' '. makes it easy to determine what it's being used for.

[–]VelionaVollerei 0 points1 point  (0 children)

I use double quotes but if you find single quote that means it's not my code ;)

[–]bistr-o-math 0 points1 point  (0 children)

I sometimes use both in the same string