lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Jun 13, 2014, at 8:49 AM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

>> Granted, your point about not having symbolic constants degrading the quality of code is true... however, this problem already exists for if-else statements as well [...]
> 
> Is the "perfomance degradation" of using names (variables) instead of
> constants in an if-chain similar to what it does in your switch statement?
> (You may try it with different kinds of variables.)
> 
> -- Roberto

What "performance degradation" do you mean? I thought we were commenting on the degradation of code readability by the use of "magic numbers" instead of symbolic constants?

In an if-chain you have to use variables, how would you use constants without a variable to compare it to? What different kinds of variables do you mean?

I guess I do not understand what you mean by your above comments, sorry. :(

~pmd