The essence of Class Names should be noun (类名应该是名词的本质).pdf
文本预览下载声明
Class Names should be noun phrases, method
The essence of names verb phrases
Use the same word for a concept consistently
Clean Code Use problem domain names for solution
domain concepts and technical terms for
solution domain concepts.
A heavily paraphrased summary of the book Dont be afraid to globally change bad names
Robert C. Martin: Clean Code: A Handbook of (including their uses, of course).
Agile Software Craftsmanship, Prentice Hall
2008, 431 pages
(Lutz Prechelt, 2013-2014) Ch. 3: Functions
Functions (methods) should be small and do
only one thing. All statements should be
Ch. 1: Clean Code exactly one level of abstraction below the
We will always develop on the code level concept represented by the function, that is,
because all the details matter. should be worth mentioning in a summary of
the implementation. This implies avoiding
Good, clean code matters: Bad code nested control structures, switch statements,
eventually brings a product down, because and most if-else-if chains.
during further development, productivity
Order the functions thus broken down in
gradually approaches zero.
depth-first order, so that the overall code can
Programmers must stand up for clean code be read top-to-bottom. It is hard to
just like managers stand
显示全部