Tip 6Be Stylish
White Belt[​​White Belt] Writing code with good style helps well before the professional world.

These two functions do exactly the same thing:

 uint64_t
 fibonacci(​unsigned​ ​int​ n)
 {
 if​ (n == 0 || n == 1) {
 return​ n;
  }
 else​ {
 uint64_t​ previous = 0;
 uint64_t​ current = 1;
 
 while​ (--n > 0) {
 uint64_t​ sum = previous + current;
  previous = current;
  current = sum;
  }
 
 return​ current;
  }
 }
 unsigned​ ​long​ ​long​ fbncci(​unsigned​ ​int​ quux) { ​if
 (quux == 0 || quux == 1) { ​return​ quux; } ​else​ {
 unsigned​ ​long​ ​long​ foo = 0; ​unsigned​ ​long​ ​long​ bar
 = 1; ​

Get New Programmer's Survival Manual now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.