| | | 易讀代碼的藝術(影印版) | 該商品所屬分類:計算機/網絡 -> 計算機原理 | 【市場價】 | 356-516元 | 【優惠價】 | 223-323元 | 【介質】 | book | 【ISBN】 | 9787564134471 | 【折扣說明】 | 一次購物滿999元台幣免運費+贈品 一次購物滿2000元台幣95折+免運費+贈品 一次購物滿3000元台幣92折+免運費+贈品 一次購物滿4000元台幣88折+免運費+贈品
| 【本期贈品】 | ①優質無紡布環保袋,做工棒!②品牌簽字筆 ③品牌手帕紙巾
| |
版本 | 正版全新電子版PDF檔 | 您已选择: | 正版全新 | 溫馨提示:如果有多種選項,請先選擇再點擊加入購物車。*. 電子圖書價格是0.69折,例如了得網價格是100元,電子書pdf的價格則是69元。 *. 購買電子書不支持貨到付款,購買時選擇atm或者超商、PayPal付款。付款後1-24小時內通過郵件傳輸給您。 *. 如果收到的電子書不滿意,可以聯絡我們退款。謝謝。 | | | | 內容介紹 | |
-
出版社:東南大學
-
ISBN:9787564134471
-
作者:(美)博斯韋爾//富徹
-
頁數:190
-
出版日期:2012-06-01
-
印刷日期:2012-06-01
-
包裝:平裝
-
開本:16開
-
版次:1
-
印次:1
-
字數:250千字
-
作為程序員,我們經常看到一些充滿Bug、讓我們頭痛不已的丑陋代碼。在過去五年中,《易讀代碼的藝術(影印版)》的作者博斯韋爾(Dustin Boswell)和富徹(Trevor Foucher)分析了許多這樣的“糟糕代碼”(這些代碼有很多是出自於他們自己之手),他們試圖釐清為什麼這些代碼如此糟糕以及如何改進這些代碼。他們得出的結論是:你必須寫出讓他人(這裡也包括你自己)花費*少時間能夠理解的代碼。
-
PREFACE CODE SHOULD BE EASY TO UNDERSTAND What Makes Code "Better"? The Fundamental Theorem of Readability Is Smaller Always Better? Does Time-TilI-UnderstandinR Conflict with Other Goals? The Hard Part Part One SURFACE-LEVEL IMPROVEMENTS PACKING INFORMATION INTO NAMES Choose Specific Words Auoid Generic Names Like Imp and retual Prefer Concrete Names ouer Abstract Names Attachin9 Extra Information to a Name How Lon.g Should a Name Be? Use Name Formatting to Conuey Meaning Summary NAMES THAT CAN'T BE MISCONSTRUED Example: FilterO Example: Clip(text, length) Prefer rain and max for (Inclusiue) Limits Prefer first and last for Inelusiue RanRes Prefer herin and end for.lnclusiue/Exclusiue RanRes NaminR Booleans MatchinR Expectations of Users Example: EualuatinR Multiple Name Candidates Summary AESTHETICS Why Do Aesthetics Matter? BearranRe Line Breaks to Be Consistent and Compact Use Methods to Clean Up IrreRularity Use Column AliRnment When Helpful Pick a MeaninRful Order, and Use It Consistently OrRanize Declarations into Blocks Break Code into "Parafgraphs" Personal Style uersus Consistency Summary KNOWING WHAT TO COMMENT What NOT to Comment Becordin9 Your Thouyhts Put Yourself in the Reader's Shoes Final Thoughts--Getting Over Writer's Block Summary 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 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 BREAKING DOWN GIANT EXPRESSIONS Explainin9 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 VARIABLES AND READABILITY Eliminatinfg Variables Shrink the Scope of Your Variables Prefer Write-Once Variables A Final Example Summary Part Three REORGANIZING YOUR CODE EXTRACTING UNRELATED SUBPROBLEMS Introductory Example: findClosestLoeationO 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 ONETASK ATA TIME Tasks Can Be Small Extracting Values from an Object A Larger Example Summary TURNING THOUGHTS INTO CODE Describing Logic Clearly Knowing Your Libraries Helps Applying This Method to Larger Problems Summary 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 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 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 FURTHER READING INDEX
| | | | | |