Flow Control

Flow control refers to the logic you use in a program to make decisions. One of the functions of a program is to contain logic to make decisions, and these statements provide a logical way of expressing that logic. Expressions in flow control are contained within blocks, delimited by curly braces (“{“, ”}”). Although there are certain conditions in which the braces are optional (e.g., a one-line check), I have always found it best to include them for readability, if not your own, then for the next person who sits down with your code.

if..else

This is a simple construct for checking conditions within a block of code. With this syntax, you check for explicit conditions to be met. Using this construct, every condition will be evaluated. ...

Get Beginning Facebook Game Apps Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.