[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: single quotes vs. double quotes
- From: Duncan Cross <duncan.cross@...>
- Date: Mon, 12 Oct 2009 14:33:22 +0100
2009/10/12 Fernando P. García <firstname.lastname@example.org>:
> In most languages (not only scripting) the use of single quotes is faster
> than double quotes, does it is applicable in Lua? perhaps for the other ways
> define strings?
I don't know about *most* languages - there are a couple that have
variable interpolation in double-quoted strings but not single-quoted,
but it does not happen at all in Lua. In non-scripting languages it
seems like single characters are mainly used to delimit single
character values, not strings, so it's not really comparable.
Also, remember that Lua code is always compiled before it runs. As
long as you are not compiling your code constantly it would never
matter how string literals are defined anyway, they all become the
same thing in the bytecode.