Big-O notation can be applied to measure code coupling by counting the number of edits required when making changes. The DRY principle aims for O(1) edits where changes happen in one place, while duplicated code creates O(n) coupling requiring changes across multiple locations. O(1) coupling with small constants (2-3 edits) is

16m read time From blog.ploeh.dk
Post cover image
Table of contents
Widening the scope of big-O analysis #Don't Repeat Yourself #Small values of 1 #Test-specific equality #Maintaining Fake objects #Large values of 1 #Layers #Linear edits #Linear test coupling #Two kinds of coupling #Not all edits are equally difficult #Limitations #Conclusion #

Sort: