Skip to content

Instantly share code, notes, and snippets.

@xb4dc0d3
Created March 19, 2020 06:50
Show Gist options
  • Save xb4dc0d3/85346e722688b2536317e321cefa2f07 to your computer and use it in GitHub Desktop.
Save xb4dc0d3/85346e722688b2536317e321cefa2f07 to your computer and use it in GitHub Desktop.
# Bad
def getPotentialEnergy(mass, height):
return mass * 9.8 * height
# Good
GRAVITATIONAL_CONSTANT = 9.8
def getPotentialEnergy(mass, height):
return mass * GRAVITATIONAL_CONSTANT * height
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment