© Michael Stueben 2018
Michael StuebenGood Habits for Great Codinghttps://doi.org/10.1007/978-1-4842-3459-4_2

2. Coding Tricks

Michael Stueben1 
(1)
Falls Church, Virginia, USA
 
  • Mastering the skill of analyzing [chess positions] requires a massive amount of practice and hard work. But once you get it down, you will not regret the investment.—Joel Johnson (U.S. chess master) Formation Attacks (privately published, 2010), page 15.

This chapter will take a simple—almost trivial—function and write it in 12 different ways. Most of these tricks are not taught in school. You need to learn them on your own.

DEFINITION: The Fibonacci1 numbers are numbers in a sequence that begins 1, 1, … and thereafter each new number is the sum of the previous two numbers. ...

Get Good Habits for Great Coding: Improving Programming Skills with Examples in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.