热点推荐

查看: 4467|回复: 8

代码整洁之道

[复制链接]

1418

主题

1532

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
39191
发表于 2018-2-4 11:18:55 | 显示全部楼层 |阅读模式




内容简介  · · · · · ·

《代码整洁之道(英文版)》提出一种观念:代码质量与其整洁度成正比。干净的代码,既在质量上较为可靠,也为后期维护、升级奠定了良好基础。作为编程领域的佼佼者,《代码整洁之道(英文版)》作者给出了一系列行之有效的整洁代码操作实践。这些实践在《代码整洁之道(英文版)》中体现为一条条规则(或称“启示”),并辅以来自现实项目的正、反两面的范例。只要遵循这些规则,就能编写出干净的代码,从而有效提升代码质量。

软件质量,不但依赖于架构及项目管理,而且与代码质量紧密相关。这一点,无论是敏捷开发流派还是传统开发流派,都不得不承认。

《代码整洁之道(英文版)》阅读对象为一切有志于改善代码质量的程序员及技术经理。书中介绍的规则均来自作者多年的实践经验,涵盖从命名到重构的多个编程方面,虽为一“家”之言,然诚有可资借鉴的价值。





作者简介  · · · · · ·

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
……
· · · · ·


下载链接回复可见:
游客,如果您要查看本帖隐藏内容请回复


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

0

主题

225

帖子

771

积分

永久VIP会员

Rank: 3Rank: 3

积分
771
发表于 2018-5-18 11:26:27 | 显示全部楼层
gggggggggggg
回复

使用道具 举报

0

主题

4

帖子

10

积分

Lv1码农小白

Rank: 1

积分
10
发表于 2018-6-27 09:53:05 | 显示全部楼层
gggggggggggg
回复

使用道具 举报

1

主题

80

帖子

431

积分

永久VIP会员

Rank: 3Rank: 3

积分
431
发表于 2018-8-23 09:57:27 | 显示全部楼层
代码整洁之道6666666
回复

使用道具 举报

0

主题

93

帖子

337

积分

永久VIP会员

Rank: 3Rank: 3

积分
337
发表于 2019-1-29 17:27:06 | 显示全部楼层
感谢分享。
回复

使用道具 举报

0

主题

23

帖子

53

积分

Lv1码农小白

Rank: 1

积分
53
发表于 2019-9-15 10:45:48 | 显示全部楼层
6666666666666666
回复

使用道具 举报

0

主题

5

帖子

124

积分

永久VIP会员

Rank: 3Rank: 3

积分
124
发表于 2020-5-5 23:11:26 | 显示全部楼层
是中文版吗?
回复

使用道具 举报

发表于 2020-9-28 22:38:13 | 显示全部楼层
1111111111111111111111111111
回复

使用道具 举报

0

主题

264

帖子

687

积分

永久VIP会员

Rank: 3Rank: 3

积分
687
发表于 2020-12-17 02:40:09 | 显示全部楼层
higgggggg滚滚滚
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

快速回复 返回顶部 返回列表