티스토리 뷰
Object Oriented Programming/Coding Practice 101
Take favour read-time convenience over write-time convenience
Kaboomba 2022. 2. 7. 05:06Favor read-time convenience to write-time convenience. Code is read far more times than it's written, even during initial development. Favoring a technique that speeds write-time convenience at the expense of read-time convenience is a false economy. This is especially applicable to creation of class interfaces. Even if a routine doesn't quite fit the interface's abstraction, sometimes it's tempting to add a routine to an interface that would be convenient for the particular client of a class that you're working on at the time. But adding that routine is the first step down a slippery slope, and it's better not to take even the first step.
Code Complete, Steve McConnell
'Object Oriented Programming > Coding Practice 101' 카테고리의 다른 글
Tiny example - how immutable/readonly class helps OOP (0) | 2022.03.13 |
---|
댓글