Chapter 5. Developer As Traffic Cop

There are many ways to conceptualize the job of a software programmer. One is that we sit around and play logic puzzles all day long—and get paid for it! Another is that we perform translation services between “normal people” and computers.

Yet another way to look at what we do is that we control the flow of data traffic between users and semiconductors. This is a very important job. If we let a chunk of data make a right turn when it should make a left turn—watch out! Someone could get fired when he or she should get promoted. A stock price could dive when it should rise slightly, and so on.

In this chapter I explore best practices related to the constructs that Oracle PL/SQL offers to control the flow of processing in your programs; these are presented in the following sections:

Best Practices for Conditional and Boolean Logic

Presents best practices for using the IF and CASE statements.

Best Practices for Loop Processing

Presents best practices for using FOR, WHILE, and simple loops.

Best Practices for Branching Logic

Presents best practices for using the GOTO and CONTINUE statements.

These constructs are relatively straightforward in syntax and usage. There are, however, several best practices you should take into account when you work with these kinds of statements.

Best Practices for Conditional and Boolean Logic

Follow the best practices in this section when you are using PL/SQL’s IF and CASE statements. Ah, perhaps you didn’t even know that PL/SQL ...

Get Oracle PL/SQL Best Practices, 2nd Edition 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.