DRY Principle

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2021 May 31 6:39
Editor
Edited
Edited
2026 Feb 13 19:22
Refs
Refs

Don't Repeat Yourself

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system

WET

Write Everything Twice. We Enjoy Typing. This is a flawed approach. Code should be synced in one place, not duplicated.
Why DRY is the most over-rated programming principle
I figured I'd kick off my new blog with the most click baity thing I could think of. I suspect any developer reading this is aware of the DRY principle because it is just so ubiquitous.

Standardize, Don’t Abstract

This explains the design principles (
Tenet
s) and recent engineering changes that make 1M+ Python LOC and 400+ model architectures "maintainable despite continuous additions." transformers aims to be the Source of Truth for each model implementation, prioritizing performance and reproducibility. Since users are mostly researchers/power users, code is the 'product' and must be easy to read, debug, and modify.
Standardize, Don't Abstract: only commonize infrastructure, keep model semantics inside model files. DRY*: deduplication isn't always good (
DRY Principle
* (DO Repeat Yourself). Strategic duplication is allowed for user readability and local semantics. The essence is: "Keep model seantics transparent in one file (for readability/hackability), while reducing maintenance burden through modular definitions and config-based composition."
huggingface.co
 
 

Recommendations