Data Science Desktop Survival Guide
by Graham Williams |
|||||
Layout |
20200105
Preferred
while (blue_sky())
{ open_the_windows() do_some_research() } retireForTheDay() Alternative |
while (blue_sky()) {
open_the_windows() do_some_research() } retireForTheDay()
If a code block contains a single statement, then curly braces remain useful to emphasise the limit of the code block; however, some prefer to drop them. Preferred |
while (blue_sky())
{ do_some_research() } retire_for_the_day()
Alternatives |
while (blue_sky())
do_some_research() retire_for_the_day()
|
while (blue_sky()) do_some_research()
retire_for_the_day()
|