The Magic Number Antipattern
One antipattern I see often is the magic number. The magic number antipattern is a direct usage of a number in a function. Here is an example that comes from Refactoring by Martin Fowler. function potentialEnergy(mass, height) { return mass * 9.81 * height; } What the hell is 9.81? Yeah, I don’t know either. […]