reklama - zainteresowany?

The Art of Readable Code - Helion

The Art of Readable Code
ebook
Autor: Dustin Boswell, Trevor Foucher
ISBN: 978-14-493-1421-7
stron: 206, Format: ebook
Data wydania: 2011-11-03
Księgarnia: Helion

Cena książki: 101,15 zł (poprzednio: 117,62 zł)
Oszczędzasz: 14% (-16,47 zł)

Dodaj do koszyka The Art of Readable Code

As programmers, we’ve all seen source code that’s so ugly and buggy it makes our brain ache. Over the past five years, authors Dustin Boswell and Trevor Foucher have analyzed hundreds of examples of "bad code" (much of it their own) to determine why they’re bad and how they could be improved. Their conclusion? You need to write code that minimizes the time it would take someone else to understand it—even if that someone else is you.

This book focuses on basic principles and practical techniques you can apply every time you write code. Using easy-to-digest code examples from different languages, each chapter dives into a different aspect of coding, and demonstrates how you can make your code easy to understand.

  • Simplify naming, commenting, and formatting with tips that apply to every line of code
  • Refine your program’s loops, logic, and variables to reduce complexity and confusion
  • Attack problems at the function level, such as reorganizing blocks of code to do one task at a time
  • Write effective test code that is thorough and concise—as well as readable

"Being aware of how the code you create affects those who look at it later is an important part of developing software. The authors did a great job in taking you through the different aspects of this challenge, explaining the details with instructive examples."
—Michael Hunger, passionate Software Developer

Dodaj do koszyka The Art of Readable Code

 

Osoby które kupowały "The Art of Readable Code", wybierały także:

  • Windows Media Center. Domowe centrum rozrywki
  • Ruby on Rails. Ćwiczenia
  • DevOps w praktyce. Kurs video. Jenkins, Ansible, Terraform i Docker
  • Przywództwo w Å›wiecie VUCA. Jak być skutecznym liderem w niepewnym Å›rodowisku
  • Scrum. O zwinnym zarzÄ…dzaniu projektami. Wydanie II rozszerzone

Dodaj do koszyka The Art of Readable Code

Spis treści

The Art of Readable Code. Simple and Practical Techniques for Writing Better Code eBook -- spis treści

  • The Art of Readable Code
    • SPECIAL OFFER: Upgrade this ebook with OReilly
    • Preface
      • What This Book Is About
      • How to Read This Book
      • Using Code Examples
      • Safari Books Online
      • How to Contact Us
      • Acknowledgments
    • 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
    • I. Surface-Level Improvements
      • 2. Packing Information into Names
        • Choose Specific Words
          • Finding More Colorful Words
        • Avoid Generic Names Like tmp and retval
          • tmp
          • Loop Iterators
          • The Verdict on Generic Names
        • Prefer Concrete Names over Abstract Names
          • Example: DISALLOW_EVIL_CONSTRUCTORS
          • Example: --run_locally
        • Attaching Extra Information to a Name
          • Values with Units
          • Encoding Other Important Attributes
        • How Long Should a Name Be?
          • Shorter Names Are Okay for Shorter Scope
          • Typing Long NamesNot a Problem Anymore
          • Acronyms and Abbreviations
          • Throwing Out Unneeded Words
        • Use Name Formatting to Convey Meaning
          • Other Formatting Conventions
        • Summary
      • 3. Names That Cant Be Misconstrued
        • Example: Filter()
        • Example: Clip(text, length)
        • Prefer min and max for (Inclusive) Limits
        • Prefer first and last for Inclusive Ranges
        • Prefer begin and end for Inclusive/Exclusive Ranges
        • Naming Booleans
        • Matching Expectations of Users
          • Example: get*()
          • Example: list::size()
        • Example: Evaluating Multiple Name Candidates
        • Summary
      • 4. Aesthetics
        • Why Do Aesthetics Matter?
        • Rearrange Line Breaks to Be Consistent and Compact
        • Use Methods to Clean Up Irregularity
        • Use Column Alignment When Helpful
          • Should You Use Column Alignment?
        • Pick a Meaningful Order, and Use It Consistently
        • Organize Declarations into Blocks
        • Break Code into Paragraphs
        • Personal Style versus Consistency
        • Summary
      • 5. Knowing What to Comment
        • What NOT to Comment
          • Dont Comment Just for the Sake of Commenting
          • Dont Comment Bad NamesFix the Names Instead
        • Recording Your Thoughts
          • Include Director Commentary
          • Comment the Flaws in Your Code
          • Comment on Your Constants
        • Put Yourself in the Readers Shoes
          • Anticipating Likely Questions
          • Advertising Likely Pitfalls
          • Big Picture Comments
          • Summary Comments
        • Final ThoughtsGetting Over Writers 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
    • II. 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 do/while Loops
        • Returning Early from a Function
        • The Infamous goto
        • Minimize Nesting
          • How Nesting Accumulates
          • Removing Nesting by Returning Early
          • Removing Nesting Inside Loops
        • Can You Follow the Flow of Execution?
        • Summary
      • 8. Breaking Down Giant Expressions
        • Explaining Variables
        • Summary Variables
        • Using De Morgans Laws
        • Abusing Short-Circuit Logic
        • Example: Wrestling with Complicated Logic
          • Finding a More Elegant Approach
        • Breaking Down Giant Statements
        • Another Creative Way to Simplify Expressions
        • Summary
      • 9. Variables and Readability
        • Eliminating Variables
          • Useless Temporary Variables
          • Eliminating Intermediate Results
          • Eliminating Control Flow Variables
        • Shrink the Scope of Your Variables
          • if Statement Scope in C++
          • Creating Private Variables in JavaScript
          • JavaScript Global Scope
          • No Nested Scope in Python and JavaScript
          • Moving Definitions Down
        • Prefer Write-Once Variables
        • A Final Example
        • Summary
    • III. Reorganizing Your Code
      • 10. Extracting Unrelated Subproblems
        • Introductory Example: findClosestLocation()
        • Pure Utility Code
        • Other General-Purpose Code
          • Unexpected Benefits
        • Create a Lot of General-Purpose Code
        • Project-Specific Functionality
        • Simplifying an Existing Interface
        • Reshaping an Interface to Your Needs
        • Taking Things Too Far
        • Summary
      • 11. One Task at a Time
        • Tasks Can Be Small
        • Extracting Values from an Object
          • Applying One Task at a Time
          • Another Approach
        • A Larger Example
          • Further Improvements
        • Summary
      • 12. Turning Thoughts into Code
        • Describing Logic Clearly
        • Knowing Your Libraries Helps
        • Applying This Method to Larger Problems
          • An English Description of the Solution
          • Applying the Method Recursively
        • Summary
      • 13. Writing Less Code
        • Dont Bother Implementing That FeatureYou Wont Need It
        • Question and Break Down Your Requirements
          • Example: A Store Locator
          • Example: Adding a Cache
        • Keeping Your Codebase Small
        • Be Familiar with the Libraries Around You
          • Example: Lists and Sets in Python
          • Why Reusing Libraries Is Such a Win
        • Example: Using Unix Tools Instead of Coding
        • Summary
    • IV. Selected Topics
      • 14. Testing and Readability
        • Make Tests Easy to Read and Maintain
        • Whats Wrong with This Test?
        • Making This Test More Readable
          • Creating the Minimal Test Statement
          • Implementing Custom Minilanguages
        • Making Error Messages Readable
          • Using Better Versions of assert()
          • Hand-Crafted Error Messages
        • Choosing Good Test Inputs
          • Simplifying the Input Values
          • Multiple Tests of Functionality
        • Naming Test Functions
        • What Was Wrong with That Test?
        • Test-Friendly Development
        • Going Too Far
        • Summary
      • 15. Designing and Implementing a Minute/Hour Counter
        • The Problem
        • Defining the Class Interface
          • Improving the Names
          • Improving the Comments
        • Attempt 1: A Naive Solution
          • Is the Code Easy to Understand?
          • An Easier-to-Read Version
          • Performance Problems
        • Attempt 2: Conveyor Belt Design
          • Implementing the Two-Stage Conveyor Belt Design
          • Are We Done?
        • Attempt 3: A Time-Bucketed Design
          • Implementing the Time-Bucketed Design
          • Implementing TrailingBucketCounter
          • Implementing ConveyorQueue
        • Comparing the Three Solutions
        • Summary
    • A. Further Reading
      • Books on Writing High-Quality Code
      • Books on Various Programming Topics
      • Books of Historical Note
    • Index
    • About the Authors
    • Colophon
    • SPECIAL OFFER: Upgrade this ebook with OReilly

Dodaj do koszyka The Art of Readable Code

Code, Publish & WebDesing by CATALIST.com.pl



(c) 2005-2024 CATALIST agencja interaktywna, znaki firmowe należą do wydawnictwa Helion S.A.