1. 코드는 이해하기 쉬워야 한다.
가독성의 기본 정리
분량이 적으면 항상 좋은가? NO
// before : 짧지만 이해 하는데 시간 오래 걸림
if(!(bucket == FindBucket(key)) || !bucket.isOccupied() )
// after : 길지만 이해하는데 오래 걸리지 않음
bucket = FindBucket(key);
if(bucket != NULL || !bucket.isOccupied())이해를 위한 시간은 다른 목표와 충돌하는가?
Summary
Last updated
Was this helpful?