in reply to In Love With Double Quotes
Your argument that perl needs to do more work is a non-argument. If that difference is important to you you ought to be programming in C directly, as using perl makes C do more work than when you programmed in C directly.
But for engineering reasons, it's better to use double quotes in a string that doesn't contain dollar (or at) signs or backslashes. The only case where the kind of quotes you use matters is if you need to change them. When would you need to change the quotes of "This hot Perlistic string" to single quotes? When you change it to something like 'This hot Perlistic string costs $100' - although you could still write "This hot Perlistic string costs \$100". But when would you need to change 'This hot Perlistic string'? For instance, if you change it into "This hot Perlistic string\n", or "This hot Perlistic $noun". And then there isn't a single keystroke alternative available that leaves in the single quotes. The latter kind changes are far more common than the former kind. Hence, it's better to use double quotes than single quotes - programmer time is more important than CPU time. (If CPU time was more important, you should have written it in C anyway). Oh, and anyone complaining he gets confused when seeing a double quoted string that doesn't have a variable inside it ought to be fired.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: In Love With Double Quotes
by Tanktalus (Canon) on Aug 08, 2005 at 16:19 UTC | |
by Anonymous Monk on Aug 09, 2005 at 08:49 UTC |