Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (condition) then
- {
- // do stuff
- }
- else
- {
- // do other stuff
- }
- if (!condition) then
- {
- // do other stuff
- {
- else
- {
- // do stuff
- }
- if (condition)
- return;
- DoSomething();
- bool MyFunc(variable) {
- if (variable != something_i_want)
- return false;
- // a large block of code
- // ...
- return true;
- }
- if (!some_function_that_could_fail())
- {
- // Error handling code
- }
- else
- {
- // Success code
- }
- if (somePositiveCondition)
- else {
- //stuff
- }
- if DataIsGood() then
- DoMyNormalStuff
- else
- TakeEvasiveAction
- if SomeErrorTest then
- TakeSomeEvasiveAction
- else if SomeOtherErrorCondition then
- CorrectMoreStupidUserProblems
- else if YetAnotherErrorThatNoOneThoughtOf then
- DoMoreErrorHandling
- else
- DoMyNormalStuff
- if (blah == false)
- {
- return; // perhaps with a message
- }
- // do rest of code here...
- if (not_dead) {
- } else {
- }
- if (alive) {
- } else {
- }
- if (!alive) {
- } else {
- }
- if (dead || (!dead && sleeping)) {
- } else {
- }
- if (dead || sleeping) {
- } else {
- }
- if( common ) {
- // pass
- }
- else {
- // great big block of exception-handling folderol
- }
- if( ! common ) {
- // great big block of except-handling folderol
- }
- if (!PreserveData.Checked)
- { resetfields();}
- if (!widget.enabled()) {
- // more common
- } else {
- // less common
- }
- if (widget.disabled()) {
- // more common
- } else {
- // less common
- }
- if (expected)
- {
- //expected path
- }
- else
- {
- //fallback other odd case
- }
- unless ($foo) {
- $bar;
- }
- //if you must have multiple exit points, put them first and make them clear
- if TerminatingCondition1 then
- Exit
- if TerminatingCondition2 then
- Exit
- //now we can progress with the usual stuff
- if NormalThing then
- DoNormalThing
- else
- DoAbnormalThing
- unless (alive) {
- go_to_heaven;
- } else {
- say "MEDIC";
- }
Add Comment
Please, Sign In to add comment