代码整洁之道pdf

下载地址:网盘下载

 

 

 

 

内容简介 · · · · · ·

作者简介  · · · · · ·

Rober C.Martin,Object Mentor公司总裁。面向对象设计、模式、UML、敏捷方法学和极限编程领域的资深顾问。他是Designing Object-Oriented C++Applications Using the BoochMethod以及Jolt获奖图书Agile SoftwareDevelopment,Principles,Pattems,and Practices(中译版《敏捷软件开发:原则、模式与实践》)等畅销书作者。

目录  · · · · · ·

Chapter I: Clean Code
There Will Be Code
Bad Code
The Total Cost of Owning a Mess
The Grand Redesign in the Sky
Attitude
The Primal Conundrum
The Art of Clean Code?
What Is Clean Code?
Schools of Thought
We Are Authors
The Boy Scout Rule
Prequel and Principles
Conclusion
Bibliography
Chapter 2: Meaningful Names
Introduction
Use Intention-Revealing Names
Avoid Disinformation
Make Meaningful Distinctions
Use Pronounceable Names
Use Searchable Names
Avoid Encodings
Hungarian Notation
Member Prefixes
Interfaces and Implementations
Avoid Mental Mapping
Class Names
Method Names
Don't Be Cute
Pick One Word per Concept
Don't Pun
Use Solution Domain Names
Use Problem Domain Names
Add Meaningful Context
Don't Add Gratuitous Context
Final Words
Chapter 3: Functions
Small!
Blocks and Indenting
Do One Thing
Sections within Functions
One Level of Abstraction per Function
Reading Code from Top to Bottom: The Stepdown Rule
Switch Statements
Use Descriptive Names
Function Arguments
Common Monadic Forms
Flag Arguments
Dyadic Functions
Triads
Argument Objects
Argument Lists
Verbs and Keywords
Have No Side Effects
Output Arguments
Command Query Separation
Prefer Exceptions to Returning Error Codes
Extract Try/Catch Blocks
Error Handling Is One Thing
The Error. java Dependency Magnet
Don't Repeat Yourself
Structured Programming
How Do You Write Functions Like This?
Conclusion
Setup Teardown Includer
Bibliography
Chapter 4: Comments
Comments Do Not Make Up for Bad Code
Explain Yourself in Code
Good Comments
Legal Comments
Informative Comments
Explanation of Intent
Clarification
Warning of Consequences
TODO Comments
Amplification
Javadocs in Public APIs
Bad Comments
Mumbling
Redundant Comments
Misleading Comments
Mandated Comments
Journal Comments
Noise Comments
Scary Noise
Don't Use a Comment When You Can Use a
Function or a Variable
Position Markers
Closing Brace Comments
Attributions and Bylines
Commented-Out Code
HTML Comments
Nonlocal Information
Too Much Information
Inobvious Connection
Function Headers
Javadocs in Nonpublic Code
Example
Bibliography
Chapter 5: Formatting
The Purpose of Formatting
Vertical Formatting
The Newspaper Metaphor
Vertical Openness Between Concepts
Vertical Density
Vertical Distance
Vertical Ordering
Horizontal Formatting
Horizontal Openness and Density
Horizontal Alignment
Indentation
Dummy Scopes
Team Rules
Uncle Bob's Formatting Rules
Chapter 6: Objects and Data Structures
Data Abstraction
Data/Object Anti-Symmetry
The Law of Demeter
Train Wrecks
Hybrids
Hiding Structure
Data Transfer Objects
Active Record
Conclusion
Bibliography

 

 

 

下载地址: 网盘下载

 

转载于:https://www.cnblogs.com/long12365/p/9730713.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值