| ▲ | dualvariable 2 hours ago | |
I think the usable counterpoint here is that you can refrain from excessively DRY'ing code up and defer it until later. There's a huge cost to Clean-Code-style DRY'ing of your codebase which is that you wind up creating all kinds of little functions that all add cognitive overhead to reading your codebase, and that premature DRY'ing can lead to picking the wrong abstractions. If you can tolerate a bunch of copypasta, you can sit back after you've written 5,000 or 10,000 lines of code and can look at the actual result, instead of speculating, and make better-informed decisions about how to clean the codebase up. If you're making those decisions the first time you copy a bit of code around, you can wind up making a worse mess, since you often don't know where you're going. | ||
| ▲ | clintonb an hour ago | parent [-] | |
My threshold is three. The third time I duplicate code/behavior is when I start to think about DRYing said code/behavior. | ||