Chapter 5. Learning to Write Conditional Code

Conditional code is the traffic cop of computer programs. Individual lines of code solve singular problems. A single statement can perform a calculation, store a customer’s name, or read an HTML file from the Internet. It is the orchestration of the individual statements that solve a complete, practical problem.

I like the traffic cop metaphor, but many metaphors work. You might prefer the orchestra conductor, air-traffic controller, or bus driver. All these concepts depict what conditional code does. Conditional code helps the program change course at an appropriate time so that the computer executes your lines of code in the right order.

You might ask, at this point, how there can be more than one ...

Get Sams Teach Yourself Microsoft 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.