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.


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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.