It's a similar *concept*, but in no way is it similar in performance degradation. It is in no way one with a serious enough difference to matter when there are probably more useful bottlenecks to go after, but only *after* you profile and collect data. Premature performance optimisation should be avoided unless there is data already that shows something will make a difference. Otherwise, the beautiful code mantra applies: 1. Correct. 2. Pretty. 3. Fast.
On Sat, Mar 15, 2014 at 9:02 AM, Walter Lee Davis <wa...@wdstudio.com> wrote: > > On Mar 15, 2014, at 4:09 AM, Gurpreet Luthra wrote: > >> RubyMine gives a warning on any string that uses double quotes without >> interpolation... So I learnt to use single quotes when no interpolation, and >> double quotes only on interpolation. >> >> I would prefer using double quotes everywhere.. >> >> Regards >> Gurpreet > > I'm ashamed to admit this, but I come from PHP, where there is (or used to > be) a subtle performance hit when using double-quotes. It was explained to me > as being similar to the difference between a .html and .php file to the > Apache server -- the former requires no introspection, just find it and serve > it, while the latter requires careful inspection and delegation. I tend to > use single-quotes unless I want to use interpolation. > > Walter > >> >> >> >> On 15 March 2014 11:23, tamouse pontiki <tamouse.li...@gmail.com> wrote: >> On Thu, Mar 13, 2014 at 7:01 AM, Dave Aronson >> <googlegroups2d...@davearonson.com> wrote: >> > On Thu, Mar 13, 2014 at 12:52 AM, Brandon <wongw...@gmail.com> wrote: >> > >> >> I try to use single quote first as much as I can because I find the >> >> readability is better and it takes up less spaces each line. >> > >> > I've started doing the opposite. The tiny time savings in the >> > interpreter from not checking for interpolation, pale in comparison to >> > the human-time wasted by "why is it failing to do the interpolation I >> > added, oh, I didn't convert the quotes" and "why is it blowing up on >> > this perfectly innocent string, oh, I used a contraction inside >> > single-quotes so it thinks the string ends there" and whatever other >> > problems it causes. >> >> I can get behind this. My fingers tend to land on single quotes for >> certain things I have *never* used interpolation on, such as require >> names. Not that one couldn't, I just haven't (yet). I struggled with >> watching a senior dev experience this very thing and not feeling I >> should say anything to them. I finally decided I should. >> >> > Meanwhile, though, I'm curious. Can you articulate why you feel >> > single-quotes have better readability? >> >> I'm actually now thinking that the double quote marks out a string >> more easily visually, and so probably makes it more valuable for that. >> But not much. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-talk+unsubscr...@googlegroups.com. >> To post to this group, send email to rubyonrails-talk@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t8t6DKkpwTvkTgqttVos8Ji6%3DOTWENatM_56cXu4Sc2NA%40mail.gmail.com. >> For more options, visit https://groups.google.com/d/optout. >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-talk+unsubscr...@googlegroups.com. >> To post to this group, send email to rubyonrails-talk@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/CAHKR60yKeVwfvRTWdLrg64qA5EUTocAG%3Dsno496Gz5AG9CA2pQ%40mail.gmail.com. >> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscr...@googlegroups.com. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/01E4C7D3-90F2-44CC-AD1E-6F2E38A3938D%40wdstudio.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t-C0o_irFkkft0epQx%3DZBMju8woj2kzH6Z%3DXE3h0P-c%3Dg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.