The software engineering rule of 3

1 · Erik Bernhardsson · Aug. 29, 2017, 4 a.m.
Here’s a dumb extremely accurate rule I’m postulating* for software engineering projects: you need at least 3 examples before you solve the right problem. This is what I’ve noticed: Don’t factor out shared code between two classes. Wait until you have at least three. The two first attempts to solve a problem will fail because you misunderstood the problem. The third time it will work. Any attempt at being smart earlier will end up overfitting to coincidental patterns. (Note that #1 and #2 are ...