Abstraction: The Rule Of Three - 0 views
-
Steven van Dijk on 12 Nov 12"I often hear people say something like "if you need it once, build it. If you need it twice, abstract it." People often say then in the context of the "DRY" - or Don't Repeat Yourself - principle. [..] The idea of DRY needs to be tempered with YAGNI - "You Aint Gonna Need It". With that, we end up with The Rule Of Three, and it clearly says that code can be copied once but the third time you need it, you should abstract it."