Author Topic: Don't get Else If  (Read 2424 times)

if(%b){do_b();}
else{echo("no");}
easier to read.
These two things do not line up with eachother.

These two things do not line up with eachother.
I formatted it weird. It can be expanded.

I formatted it weird. It can be expanded.
Wait you actually meant the latter one was easier to read? Thought that was referring to the else-if one, which is definitely more appropriate. Else-if is much better once you throw %c, %d, and %e into the mix, because the first one stays coherent and simply grows longer in a similar manner while the latter turns into a trainwreck of embedded ifs and elses.

Wait you actually meant the latter one was easier to read? Thought that was referring to the else-if one, which is definitely more appropriate. Else-if is much better once you throw %c, %d, and %e into the mix, because the first one stays coherent and simply grows longer in a similar manner while the latter turns into a trainwreck of embedded ifs and elses.
I was saying else if is easier to read. :P

To represent more than 1 else if will increase the complexity of the code, you'll have tons of embedded elses and ifs. if, else if, and else makes it much clearer to anyone reading the code.

Okay guys I get what else if is, I just don't know what to continue to learn after.... the site I was looking at only have 3 tutorials :I... Any suggestions?

Okay guys I get what else if is, I just don't know what to continue to learn after.... the site I was looking at only have 3 tutorials :I... Any suggestions?
If you haven't already, check out Iban's Torquescript tutorial. After that you can probably start looking at simple add-ons (things like votekick or RP chat, not guns/vehicles) and dissecting them.