John Siracusa wrote: > On 12/21/07 5:54 AM, Larry Wall wrote: >> To you and me, the fact that there are single quotes means there's >> something there to hide. But other people think the other way and >> see double quotes as indicating there's something to interpolate. >> I think PBP comes down on that side, but to me, single quotes are a >> little harder to see. And maybe there's some bias from seeing double >> quotes used non-interpolatively in American English. > > FWIW, my reasoning in this area is based on Laziness: single quotes mean I > don't have to scan the string looking for interpolated stuff when reading > code. Double quotes mean I do, and I'm annoyed at the waste of time when I > scan and find nothing. "Why didn't this guy just use singles here?" It's > (mildly) misleading. > > (There are obviously edge cases, even in Perl 5, but even naive adherence to > this guideline is a good first approximation, with a second look only > required in the rarest of cases.)
Normally I'd go on the side of the reader and say yes, when writing code you should be picky about what quotes you use. But in this case I find that, on the writing side, I find it a common annoyance when I chuck a variable into a string and then only realize afterwards that it's not interpolating. On the reading side, I find visually scanning for $ in strings easy and I guess I assume everyone else does, too. -- We do what we must because we can. For the good of all of us, Except the ones who are dead. -- Jonathan Coulton, "Still Alive"