Cyandie Posted June 7, 2012 Share Posted June 7, 2012 okay so whats the difference from such codes like this if (object == 1) then to if object == 1 then ? Link to comment
Al3grab Posted June 7, 2012 Share Posted June 7, 2012 there are no deference but the first one is more organised and its more like scripting style. Link to comment
Cyandie Posted June 7, 2012 Author Share Posted June 7, 2012 Alright thanks this explains it more Link to comment
Moderators IIYAMA Posted June 7, 2012 Moderators Share 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 > ( ) ? Link to comment
Callum Posted June 7, 2012 Share 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 Link to comment
myonlake Posted June 7, 2012 Share 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! Link to comment
Cyandie Posted June 7, 2012 Author Share Posted June 7, 2012 Cheers everyone for putting in your input Link to comment
Kenix Posted June 7, 2012 Share 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 Link to comment
myonlake Posted June 7, 2012 Share 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? Link to comment
Dev Posted June 7, 2012 Share Posted June 7, 2012 Erm, '()' take barely 4 bits. ( 1 byte = 8 bits ) Link to comment
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