1.6 Comment
Don't belabor the obvious.
BAD CASE
/*
n default
*/
default:
break;
/* return SUCCESS */
return SUCCESS;
zerocount++; /* Increment zero entry counter */
/* Initialize "total" to "number-received" */
node->total = node->number-recei ved ;
▲ All of these comments should be deleted; they're just clutter. Comments shouldn't report self-evident information.
Comment functions and global data.
Global variables have a tendency to crop up intermittently throughout a program;
a comment serves as a reminder to be referred to as needed.
GOOD CASE
struct State { /* prefix + suffix list */
char apref [NPREF]; /* prefix words */
Suffix asuf; /* list of suffixes */
State *next; /* next in hash table */
};
Don't comment bad code, rewrite it.
when the comment outweighs the code, the code probably needs fixing.
Don't contradict the code.
이 부분은 아직 이해 안된다
As much as possible, write code that is easy to understand; the better you do this, the
fewer comments you need. Good code needs fewer comments than bad code.
W O R D
belabor 장황하게 논하다
clutter (너무 많은 것을 어수선하게) 채우다, 잡동사니, 어수선함
pointless 무의미한, 할 가치가 없는
intermittently 간헐적으로
crop up 불쑥 나타나다, 발생하다
meant to ~할 셈이다
obvious 명백한
* the + 형용사 = 명사
self-evident 자명한, 따로 증명할 필요가 없는
genuinely 진정으로, 성실하게; 순수하게
valuable 귀중한, 귀한, 소중한, 유용한
muddle 혼합하다; 혼란시키다, 뒤섞어 놓다
idct
Negation 부정, 부인, 취소
contradict 부정〔부인〕하다, 반박하다; …와 모순되다; …에 반하는 행동을 하다
uninformative 정보 가치가 없는
needlessly 쓸데없이
protract 오래 끌게 하다, 연장하다
idiomatically 관용어적으로
carelessly 부주의하게
toss 던지다, 뒤적거리다, 뒤집다
blindly 맹목적으로, 무턱대고; 막다른 골목이 되어
peripheral 주위의, 주변의; 외면의; 그다지 중요하지 않은, 말초적인