Cyandie Posted June 7, 2012 Posted June 7, 2012 okay so whats the difference from such codes like this if (object == 1) then to if object == 1 then ?
Al3grab Posted June 7, 2012 Posted June 7, 2012 there are no deference but the first one is more organised and its more like scripting style.
Moderators IIYAMA Posted June 7, 2012 Moderators Posted June 7, 2012 and if you write it like this: if object == 2 or (object == 1) then Will it first check 1 and than it will check 2? or still 2 > 1. In math first thing to do > ( ) ?
Callum Posted June 7, 2012 Posted June 7, 2012 None, though I use the 2nd style - it makes the code less ugly and doesn't give such a confusing luck (and you save 2 bytes!) This if var then is the same as if ((((((((((var))))) == (((((var2)))))))))) then
myonlake Posted June 7, 2012 Posted June 7, 2012 None, though I use the 2nd style - it makes the code less ugly and doesn't give such a confusing luck (and you save 2 bytes!)This if var then is the same as if ((((((((((var))))) == (((((var2)))))))))) then Exactly, save two bytes is saving! Recycle!
Kenix Posted June 7, 2012 Posted June 7, 2012 I always not use this because someone can confusing with this. For example if i write some big condition. IIYAMA, '( )' working only in arithmetic but not in imparity! If you confusing use lua demo. http://www.lua.org/cgi-bin/demo
myonlake Posted June 7, 2012 Posted June 7, 2012 I don't use it at all. I only use it when it's needed, which means for example math. We all know when we need brackets in math, no?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now