As a lot of you guys know, a proper if/then statement looks like this:
Or something along those lines. If you want to set a value for a variable, it can take at least 6 lines of code. In a long file, adding 6 lines of code every time you want to set a variable based on an if-statement can make your code very messy. For example, to set a simple yes/no off of a boolean takes this:
An efficient, concise alternative is to use this format condenses this code into one line:
This is a very simple, easy trick to greatly increase the readabitlity of your code. Instead of having an incredibely long file with lots of short lines, you can work horizontally and make use of your horizontal realistate.
This method is particularly useful when you need many if-statements in a row. Hope this help!