Community

개발자 99% 커뮤니티에서 수다 떨어요!

← Go back
Clean code #4
#clean_code
2년 전
350

오늘 읽은 범위

4장 주석

책에서 기억하고 싶은 내용을 써보세요.

  • 사실상 주석은 기껏해야 필요악이다
    Indeed, comments are, at best, a necessary evil

  • 함수나 변수로 표현할 수 있다면 주석을 달지 마라
    Don’t Use a Comment When You Can Use a Function or a Variable

  • 엔진 후드를 열어볼 필요가 없다며 고객에게 아양 떠는 중고차 판매원과 비슷하다
    It is rather like a gladhanding used-car salesman assuring you that you don’t need to look under the hood.

오늘 읽은 소감은? 떠오르는 생각을 가볍게 적어보세요

다른 사람이 써온 코드 또는 예제, 강의등에 있는 주석들을 보며

나도 저렇게 주석을 써야겠다고 생각해 흉내내면서 주석을 써본 적이 있었다

사실 내 코드를 읽는 사람이 이해할 수 없을까봐 내심 걱정이 되었나보다

이 책은 주석을 쓰지 않을 수 있는 방법을 찾으라고 한다

주석을 쓰는것도 시간이 필요하고 그 주석을 잘 쓰는것도 노력이 필요하기 때문에

차라리 그 시간에 코드를 깔끔히 쓰라는 것이다

주석은 코드를 읽는 것에 집중하는것을 방해한다

주석을 써야 할 때를 잘 구분하는것이 주석을 잘 쓰는 방법일지도

Once I wrote the comment because I read some comment in example codes or lectures

I just though 'they did it ( and they better coder than me )' I tried to copy their behavior

Honestly I worried about my code is so hard to understand that I need to write comments to help it

This book says "Find the way how to not write comment"

Just write clean code rather than writing comments

because writing comments is also take a time , even writing good comments need some effort

Comments disturb focusing to read code

Maybe knowing when I have to write comment and when is not is the best way to writing good comments