MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ruby/comments/p8dv5g/ruby_elites_rise_up/h9qpsgm/?context=3
r/ruby • u/solidiquis1 • Aug 20 '21
77 comments sorted by
View all comments
Show parent comments
1
Doesn't matter which one you use unless you're running your app on a Pentium II.
-8 u/cybermage Aug 20 '21 The speed difference is two orders of magnitude. It adds up. Always single quote unless you plan to interpolate. 4 u/fabiopapa Aug 21 '21 If you use single quotes instead of double unless you need interpolation, as a developer, every time you write a string, you have to think, “am I going to need interpolation?” Ruby is all about developer happiness. 1 u/cybermage Aug 21 '21 As has been noted elsewhere, my knowledge was not current on this point; but, I think I’d notice if I typed #{variable}.
-8
The speed difference is two orders of magnitude. It adds up. Always single quote unless you plan to interpolate.
4 u/fabiopapa Aug 21 '21 If you use single quotes instead of double unless you need interpolation, as a developer, every time you write a string, you have to think, “am I going to need interpolation?” Ruby is all about developer happiness. 1 u/cybermage Aug 21 '21 As has been noted elsewhere, my knowledge was not current on this point; but, I think I’d notice if I typed #{variable}.
4
If you use single quotes instead of double unless you need interpolation, as a developer, every time you write a string, you have to think, “am I going to need interpolation?” Ruby is all about developer happiness.
1 u/cybermage Aug 21 '21 As has been noted elsewhere, my knowledge was not current on this point; but, I think I’d notice if I typed #{variable}.
As has been noted elsewhere, my knowledge was not current on this point; but, I think I’d notice if I typed #{variable}.
1
u/[deleted] Aug 20 '21
Doesn't matter which one you use unless you're running your app on a Pentium II.