Control Flow

Branches, loops, and exceptions,
without braces around the condition clause (as in Python, Swift, Go, Ruby).

Conditional Branches

if a > b {
    // ...
}
if a > b {
    // ...
} else {
    // ...
}
if a > b {
    // ...
} else if a > c {
    // ...
} else {
    // ...
}

Chained comparison as in Cpp2 (Herb Sutter), Python, Julia

if 1 <= x <= 10 { ... }

Loops

Switch / Case

With implicit break, i.e break is the default, and it is not necessary to explicitly write it (like in Swift). Use fallthrough if necessary.

switch i {
case 1:
    print("1")
    // implicit break

case 2, 3:
    print("Either 2 or 3")
    // implicit break

case 4:
    // do something
    fallthrough
case 5:
    // do something more
    print("4 or 5")
    // implicit break

default:
    print("default")
}

Exceptions

try {
    // ...
} catch Exception ex {
    print(ex)
}
try {
    // ...
} catch Exception ex {
    print(ex)
} catch {
    print("An unknown exception has occurred")
}