代码整洁之道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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/414732.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

苹果 ios 微信浏览器界面 ajax 提交带 file 的 form 总是走error方法

1. 问题 问题出在微信端,而且是苹果机的微信端(苹果你咋这么矫情,安卓正常).;代码还是之前的代码,貌似是苹果升级系统后部分版本出现的 BUG,后来证明确实跟 ios 版本有关,网上也找过类似的解决措施&#xf…

前端学习(2748):uniapp创建项目和演示

1创建项目 2运行项目 3配置在微信小程序注意 配置路径 4注意开启端口号

HttpServletResponse.getWriter().print乱码,request.getHeader乱码,解决方法

1、添加响应类型即可 //这句话的意思,是让浏览器用utf8来解析返回的数据 response.setHeader("Content-type", "text/html;charsetUTF-8"); 添加前后: 如果是header参数乱码,解决方法如下: HTTP H…

设计图与html 对比

简易打开旧版火狐 网页版火狐添加组件 新版有时也会没有 谷歌是腾讯的转载于:https://www.cnblogs.com/byksj/p/8426291.html

jsr-303 参数校验-学习(转)

1、是什么? JSR303 是一套 JavaBean 参数校验的标准,它定义了很多常用的校验注解,比如:------------------------------------------------- NotNull(message"名字不能为空") private String userName; Max(value90,mes…

URLEncoder 、URLDecoder 对中文转码解码使用

URLEncoder 、URLDecoder 转码解码使用 传递参数,转码传递 String encodeStr null; try { encodeStr URLEncoder.encode("aabb22中国", "utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } System.out.pr…

SQLServer DBA 三十问(加强版)

SQLServer DBA 三十问(加强版) 原文链接:http://www.cnblogs.com/fygh/p/3288701.html距离最初发布SQLServer DBA 三十问 已有一年多了,大家对其中的某些问题讨论比较激烈,要回答出来这些问题需要比较扎实的SQLServer …

jsr-303 参数校验—自定义校验注解

1、为什么要自定义? 通过上篇学习,了解到很多常用注解了,但是呢,总是有那么些需求....2、案例分析(手机号格式) 2.1、需要验证的实体 Bean public class LoginVo {NotNullIsMobile //自定义的注解private String mobile;NotNullLe…

关于Apache Tomcat解决localhost was unable to start within 45 seconds

关于重装myeclipse启动服务超时问题解决方法: 1.打开安装或解压了Tomcat的根目录 (1)temp(项目临时缓存文件) 里面的文件全部删除,不要犹豫,这是之前在对项目进行操作的时候,所产生…

[译]SQL SERVER 2016 – Temporal Tables

原文 Temporal Table是SQL Server2016的新特性。能存储你表里面任意时间点的数据信息。 换句话说,如果你针对一张表执行任何更新或者删除操作,老数据会被新数据覆盖,下次查询的时候是查的最新的数据,但如果使用了temporal table你…

拦截器、过滤器、@Aspect 区别

1、需求场景 之前也有在文章写道 “拦截器\过滤器" 的区别,文章链接,在实际开发过程中,我们可能会遇到拦截请求参数的需求,在这我举个场景。某一个接口的请求参数都是加密的,而请求参中还有一些跟业务无关的数据&…

工作231:给input动态赋值

这个应该是不可以的,必须重新使用用文件对话框选择。 这是处于安全的考虑,不能直接对input typefile的类型赋值,因为直接用JS就可以将你本地文件直接取到指定地点,就没有安全性可言。 因此必须对一个input typefile设置一个按钮来…

MyEclipse2015Stable2.0安装破解

java开发者不可避免需要使用到的开发工具——myeclipse2015。下载安装直接打开使用的话,使用期为30天,之后如果没有注册吗注册,就使用不了了。即使卸载重装还是提示试用期期限超限,无法打开使用。 于是就有了破解myeclipse2015方…

laravel5.5中间件

目录 1. 中间件知识1. artisan 命令2. 文件内容3. 前置中间件和后置中间件4. 使用中间件2. 控制器中间件1. 中间件知识 1. artisan 命令 php artisan make:middleware CheckAge 2. 文件内容 <?phpnamespace App\Http\Middleware;use Closure;class CheckAge {public functi…

JAVA spring 常用包作用详解(转)

转载地址&#xff1a;https://www.cnblogs.com/Tmc-Blog/p/6093162.html <project xmlns"http://maven.apache.org/POM/4.0.0" xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation"http://maven.apache.org/POM/4.0.0 http:…

关于HttpUrlConnection网络请求之返回结果的中文乱码解决方法

解决方法&#xff1a; 原使用 StringBuffer改为使用StringBuilder即可 /** * 获取响应码 200成功 * 当响应成功&#xff0c;获取响应的流 */ int res conn.getResponseCode(); if(res…

日志汇总:logging、logger

目录 1、日志输出到文件 2、日志输出到屏幕 3、设置输出等级 4、设置多个日志输出对象 5、日志的配置 6、记录异常 7、设置日志输出样式1、日志输出到文件basicConfig()提供了非常便捷的方式让你配置logging模块并马上开始使用。什么都不配置直接使用默认值在控制台中打log&…

1、jeecg 笔记开篇

1. 前言 终究还是入了 jeecg 的 "坑"&#xff0c;国庆后公司采用该框架开发&#xff0c;故开篇记录。 虽说入"坑"&#xff0c;但不得不承认 jeecg 确实是一个非常强大的平台。 其实近几年凡是知名的开源框架都是采用代码生成器了&#xff0c;所以 jeecg 同…