Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
First :) Might use second with spaces around the plus sign. Basically never use double quotes. Assuming you mean JS, that is.
-
C0D4669442yJs: first
Most other languages: "hey"+uu
I have this problem of strings being in double quotes, and chars (single letters) being in single quotes 🤷♂️ -
First, but interestingly enough, the second is still in my muscle memory.
Third only when I'm drunk or doing golang. -
In JS I exclusively use template strings, I even have an eslint rule against adding something to a string literal
-
ZaLiTHkA8412yAssuming JS/TS related..?
I use the first option if I need to reference any variables in building the string, purely because it's easier to read. (This also makes it easier to bounce between TS and Flutter, which I do quite often)
Otherwise I use the third option, because then I don't need to escape any apostrophes that the string might contain.
For the most part, I find strings tend to contain apostrophes way more often than quotation marks..
Related Rants
-
github5Sharing a short story. Time: 1:30 am Conversation between me and a night watchman in my society. I was walking...
-
LevitatingLion523:59 -> 0:00 First thought: did the clock just broke? Second thought: oh right it's midnight
-
FunniestClown16Did anyone notice this? Today's date is a palindrome: 8 10 2018 👻😍
`heyy ${uu}`
'heyy '+uu
"Heyy "+uu
Which one do you use¿ And wheres poll bot :'
question
midnight
lifechanging
interesting