Last active
April 7, 2018 06:45
-
-
Save AlexPinhasov/ad750d7cdd1591f533d4becdf60eac0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Router Function | |
private func turnLights(on shouldTurnLightsOn: Bool) | |
{ | |
if shouldTurnLightsOn | |
{ | |
turnExteriorLightsOn() | |
checkForBurnedBulbs() | |
} | |
else { turnExteriorLightsOff() } | |
// When an if statment has only 1 thing to execute i like to write it | |
// at the same line with the "if" "else" word, it makes reading your code more fluent. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment