lua-users home
lua-l archive

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


wini a écrit :
If you prefer EncodeRedirectURL i.e. with a starting capital letter, how would you name a one-word variable name?
Would you name it encode or Encode?
>
> I was thinking that all variables should start with lowercase, which
> makes sense for one-word variable names i.e. encode, redirect, etc. and
> two word variable names follow the same convention, but with the second
> word uppercase i.e. encodeRedirectURL.

Uh? EncodeRedirectURL is a function or a method, at least that's what I thought. I write these starting with a verb and an initial capital, a quite common convention, except in the Java world (but at my work, they kept this convention, coming from C++ (or is it just MFC? :-) ) for our large Java application).

Indeed, all my variable names start with an initial lowercase: encoded, encodedURL.
Now, in Lua, the distinction is fuzzy, of course...

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --