易讀代碼的藝術

易讀代碼的藝術 pdf epub mobi txt 電子書 下載2025

出版者:東南大學齣版社
作者:Dustin Boswell,Trevor Foucher
出品人:
頁數:190
译者:
出版時間:2012-6
價格:39.00元
裝幀:
isbn號碼:9787564134471
叢書系列:
圖書標籤:
  • 編程
  • coding-style
  • 程序設計
  • Programming
  • 代碼優化
  • 軟件開發
  • 計算機
  • 代碼質量
  • 編程
  • 代碼
  • 可讀性
  • 軟件工程
  • 開發實踐
  • 編程風格
  • 高效開發
  • 代碼質量
  • 程序員成長
  • 技術藝術
想要找書就要到 小美書屋
立刻按 ctrl+D收藏本頁
你會得到大驚喜!!

具體描述

《易讀代碼的藝術(影印版)》分析瞭許多的“糟糕代碼”(這些代碼有很多是齣自於他們自己之手),他們試圖厘清為什麼這些代碼如此糟糕以及如何改進這些代碼。他們得齣的結論是:你必須寫齣讓他人(這裏也包括你自己)花費最少時間能夠理解的代碼。

著者簡介

博斯韋爾(Dustin Boswell),畢業於加州理工學院,在榖歌公司從事過五年的Web信息采集基礎設施和廣告營銷計劃的研究工作。他先後構建過多個Web站點,目前的主要研究興趣在於大數據的處理和機器學習領域的相關技術。

富徹(Trevor Foucher),過去十年中先後在微軟公司擔任Windows及安全相關産品的工程師、經理和技術領導者的職務,現任職於榖歌公司,主要從事榖歌廣告營銷計劃和搜索基礎設施的研究工作。

圖書目錄

PREFACE
1 CODE SHOULD BE EASY TO UNDERSTAND
What Makes Code "Better"?
The Fundamental Theorem of Readability
Is Smaller Always Better?
Does Time—Till—Understanding Conflict with Other Goals?
The Hard Part
Part One SURFACE—LEVEL IMPROVEMENTS
2 PACKING INFORMATION INTO NAMES
Choose Specific Words
Auoid Generic Names Like Imp and retual
Prefer Concrete Names ouer Abstract Names
Attaching Extra Information to a Name
How Lon.g Should a Name Be?
Use Name Formatting to Conuey Meaning
Summary
3 NAMES THAT CAN'T BE MISCONSTRUED
Example: Filter()
Example: Clip(text, length)
Prefer rain and max for (Inclusiue) Limits
Prefer first and last for Inelusiue Ranges
Prefer herin and end for.Inclusiue/Exclusiue Ranges
Naming Booleans
Matching Expectations of Users
Example: Eualuating Multiple Name Candidates
Summary
4 AESTHETICS
Why Do Aesthetics Matter?
BearranRe Line Breaks to Be Consistent and Compact
Use Methods to Clean Up Irregularity
Use Column Alignment When Helpful
Pick a Meaningful Order, and Use It Consistently
Organize Declarations into Blocks
Break Code into "Parafgraphs"
Personal Style uersus Consistency
Summary
5 KNOWING WHAT TO COMMENT
What NOT to Comment
Becording Your Thouyhts
Put Yourself in the Reader's Shoes
Final Thoughts——Getting Over Writer's Block
Summary
6 MAKING COMMENTS PRECISE AND COMPACT
Keep Comments Compact
Avoid Ambiguous Pronouns
Polish Sloppy Sentences
Describe Function Behavior Precisely
Use Input/Output Examples That Illustrate Corner Cases
State the Intent of Your Code
"Named Function Parameter" Comments
Use Information—Dense Words
Summary
Part Two SIMPLIFYING LOOPS AND LOGIC
7 MAKING CONTROL FLOW EASY TO READ
The Order of Arguments in Conditionals
The Order of if/else Blocks
The ?: Conditional Expression (a.k.a."Ternary Operator")
Avoid dogwhile Loops
Returning Early from a Function
The Infamous goto
Minimize Nesting
Can You Follow the Flow of Execution?
Summary
8 BREAKING DOWN GIANT EXPRESSIONS
Explaining Variables
Summary Variables
Using De Morgan's Laws
Abusing Short—Circuit Logic
Example: Wrestling with Complicated Logic
Breaking Down Giant Statements
Another Creative Way to Simplify Expressions
Summary
9 VARIABLES AND READABILITY
Eliminatinfg Variables
Shrink the Scope of Your Variables
Prefer Write—Once Variables
A Final Example
Summary
Part Three REORGANIZING YOUR CODE
10 EXTRACTING UNRELATED SUBPROBLEMS
Introductory Example: find Closest Loeation()
Pure Utility Code
Other General—Purpose Code
Create a Lot of General—Purpose Code
Project—Specific Functionality
Simplilying an Existing Interface
Reshaping an Interface to Your Needs
Taking Things Too Far
Summary
11 ONETASK ATA TIME
Tasks Can Be Small
Extracting Values from an Object
A Larger Example
Summary
12 TURNING THOUGHTS INTO CODE
Describing Logic Clearly
Knowing Your Libraries Helps
Applying This Method to Larger Problems
Summary
13 WRITING LESS CODE
Don't Bother Implementing That Feature——You Won't Need It
Question and Break Douan Your Requirements
Keeping Your Codebase Small
Be Familiar with the Libraries Around You
Example: Using Unix Tools Instead of Coding
Summary
Part Four SELECTED TOPICS
14 TESTING AND READABILITY
Make Tests Easy to Read and Maintain
What's Wrong with This Test?
Making This Test More Readable
Making Error Messages Readable
Choosing Good Test Inputs
Naming Test Functions
What Was Wrong with That Test?
Test—Friendly Deuelopment
Going Too Far
Summary
15 DESIGNING AND IMPLEMENTING A "MINUTE/HOUR COUNTER"
The Problem
Defining the Class Interface
Attempt 1: A Naiue Solution
Attempt 2: Conueyor Belt Design
Attempt 3: A Time—Bucketed Design
Comparing the Three Solutions
Summary
A FURTHER READING
INDEX
· · · · · · (收起)

讀後感

評分

每次碰到一本好书,总会觉得相见恨晚,无疑《The Art of Readable Code》是编写程序之路上越早看到越好的一本书。大神Donald E. Knuth曾经说过:“Instead of imagining that our main tasks is to instruct a computer what to do, let us concentrate rather on explaining t...  

評分

之前做重构项目的时候,就发现了代码质量的问题,一些老模块的代码写的简直令人发指,没有文档没有任何资料的情况下,只能人肉去读代码梳理功能,经历了各种痛苦,后来也不断在组内各种灌输代码质量的意识,在这方面做了一些推动。 偶然间翻了这本书,感觉一下找到了知己,命名...  

評分

细节决定成败,思路清晰、言简意赅的代码让程序员一目了然;而格式凌乱、拖沓冗长的代码让程序员一头雾水。除了可以正确运行以外,优秀的代码必须具备良好的可读性,编写的代码要使其他人能在最短的时间内理解才行。本书旨在强调代码对人的友好性和可读性。 本书关注编码的细节...  

評分

有一次在code review的时候,一个应届毕业生问我,代码为什么需要可读性。我和他讲代码的美感和优雅、可维护性、可测试性,他却说那有什么用,只要能跑起来,能够实现功能,不就是好代码么?我不能否认这一点,但只能实现功能的代码绝对称不上好代码,就像没杀过人的人就是好人...  

評分

这本书很有特点,配的漫画很幽默。 三个方面是,变量名,表达式和控制结构,最后是整体结构,包括分层和算法的可读性等。 希望能看到中文版。 还需要多少字啊? 请尊重创作者的劳动,勿提供下载信息、或转载他人的文章。 为了鼓励有益的分享, 少于50字的评论将在前页论坛...  

用戶評價

评分

思路清晰,言簡意賅

评分

2.0

评分

初級程序員必讀

评分

通俗易懂...慢慢學習中

评分

初級程序員必讀

本站所有內容均為互聯網搜索引擎提供的公開搜索信息,本站不存儲任何數據與內容,任何內容與數據均與本站無關,如有需要請聯繫相關搜索引擎包括但不限於百度google,bing,sogou

© 2025 book.quotespace.org All Rights Reserved. 小美書屋 版权所有