Some say the price of holding heat is often too high
You either be in a coffin or you be the new guy
The one that’s too fly to eat shoe pie– MF DOOM
Suppose I am looping over a range of numbers to see if any of them matches some magic number:
for i in range(1_000_000_000):
if i == -1:
break
On my modest desktop, this takes 60 seconds to execute.
But as everyone knows, using magic numbers in code is bad. It would be clearer and more maintainable to express the value as a variable:
MAGIC_NUMBER = -1
for i in range(1_000_000_000):
if i == MAGIC_NUMBER:
break
On my modest desktop, this takes 70 seconds to execute. Ten seconds longer – that’s not great!
Okay, so forget about variables. A better form of abstraction