- Structured languages have banned GOTOs and multiway conditional branches by replacing them with the simple IF-THEN-ELSE structure. The new C compiler for the ARM Cortex-M4 has the following new statements that satisfy the rules of structured programming and provide a more powerful programming environment:
- WHAT IF
- Used in simulation languages. Branches before evaluating the test condition.
- OR ELSE
- Conditional threat as in: "Add these two numbers OR ELSE"
- WHY NOT
- Executes the code that follows in a devil-may-care fashion
- WHO ELSE
- Used for polling during I/O operations
- This is where your program really is when you think it's here
- GOING GOING GONE
- For writing unstructured programs. Takes a random branch to another part of your program.
Does the work of a hundred GOTOs
- JUST IN CASE
- For handling afterthoughts and fudge factors.
Allows you to multiply by zero to correct for accidently dividing by zero
- BRIEF CASE
- To encourage portable software
- OPEN AND SHUT CASE
- No proof of correctness is necessary with this one
- IN ANY CASE
- This one always works
- HOPELESS CASE
- This one never works
- BASKET CASE
- A really HOPELESS CASE
- DON'T DO WHILE NOT
- The loop is not executed if the test condition is not false (or it's Friday afternoon)
- DIDN'T DO
- The loop executes once and hides all traces
- WON'T DO
- The program stops because it doesn't like the code inside the loop.
Execution can be resumed by typing "MAY I" at the command line
- MIGHT DO
- Depends on how the program is feeling.
Executed if the CPU is "up", not executed if the CPU is "down" or if its feelings have been hurt
- DO UNTO OTHERS
- Used to write the main loop for operating systems to antagonize all programs in a uniform manner
- DO WAH
- Used to write loops for computer generated music (e.g. Rag Timing)
· Views: 17530