4 ms·
> Sometimes it's best to be DRY right from the start. Never zealously adopt a programming practice that can be summarized in a headline!
by klyrs 2y ago
> Sometimes it's best to be DRY right from the start.
Never zealously adopt a programming practice that can be summarized in a headline!
- OJFord 2y agoYeah, don't be DRY from the start, YAGNI.
- barfbagginus 2y agoI feel like the "sometimes" suggests that in most cases we should zealously not dry things, but in some cases we might want to. Doesn't that make you curious what cases those might be?
- klyrs 2y ago> Doesn't that make you curious what cases those might be? I've been programming for nigh on 40 years; I'm not terribly curious because I've seen successes and failures of pretty much every development paradigm firsthand. But since you ask, my comment above was a self-referential whimsicalism. I DRY my code in phases. A rule of 3 is decent (e.g., if you've copied a chunk of code three times, give it a think; if you've copied it 9 times, give it a good hard stare).