読者です 読者をやめる 読者になる 読者になる


Stats of My Life

「リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック (Theory in practice)」読みました。(2017年15冊目)"Readable code - Simple practical technique for writing better code (Theory in practice)" I have read. (15th year of 2017)

リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック (Theory in practice)

リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック (Theory in practice)













第1章 理解しやすいコード


第2章 名称に情報を詰め込む


第3章 誤解されない名前


第4章 美しさ


第5章 コメントすべきことを知る


第6章 コメントは正確で簡潔に


第7章 制御フローを読みやすくする



第8章 巨大な式を分割する


第9章 変数と読みやすさ


第10章 無関係の下位問題を抽出する


第11章 一度に一つのことを


第12章 コードに思いを込める


第13章 短いコードを書く


第14章 テストと読みやすさ




Although it is a famous book among engineers, I have never read it properly

I tried reading it.


As impressions it was very easy to understand.
I should have read it earlier.


Incidentally, there is also a class of readable code on the school.
I think that understanding will deepen as you read it together.





Chapter 1: Easy to understand code

· The code must be written so that other people can understand in the shortest possible time


Chapter 2 Stuffing Information in a Name

· Choose clear words
· Avoid generic names
· Use concrete names rather than abstract names
· Add information using a suffix or prefix
· Decide the length of the name
· Tell information in format of name


Chapter 3 Misunderstanding Name

· Try to ask yourself a number of times that the name "will not be mistaken for other meanings?"


Chapter 4 Beauty

· Use a layout that is consistent with the pattern that the reader is accustomed to
· Similar code looks similar
· Block related codes together


Chapter 5 Knowing what to comment

· The purpose of the comment is to inform the reader of the intention of the writer


Chapter 6 Comments are accurate and concise

· Avoid synonyms such as "it" and "this" that may refer to multiple things
· Describe the intention of the code at a high level instead of the detail level


Chapter 7 Making Control Flow Readable

· The left side is an expression of "subject of investigation". Change
· The right side is the expression of "comparison target". It does not change

· Condition uses positive system rather than negative type
· Write simple conditions first.


Chapter 8 Split huge expressions

· Huge formula to split into easy-to-swallow size


Chapter 9 Variables and Readability

· If you do not add var to the variable definition in JavaScript, the variable gets global scope
It enters.


Chapter 10 Extracting irrelevant subordinate problems

· Separate generic code from project specific code


Chapter 11 One thing at a time

· Think about doing one task at a time


Chapter 12 Thinking about the code

· By explaining the program in simple terms, the code will become more natural


Chapter 13 Writing Short Code

· You have to keep the code light and light as small as possible.
· Create generic utility code and delete duplicate code
· Delete unused codes and unnecessary functions
· Make a project a subproject
· Conscious of the "weight" of the code. Keep light and agile


Chapter 14 Testing and Readability

· Provide a descriptive name for the test function to clarify what you are testing