Learn eight principles to simplify your code and become a more effective (and successful) programmer.
Most software developers waste thousands of hours working with overly complex code. The eight core principles in The Art of Clean Coding will teach you how to write clear, maintainable code without compromising functionality. The book’s guiding principle is simplicity: reduce and simplify, then reinvest energy in the important parts to save you countless hours and ease the often onerous task of code maintenance.
Bestselling author Christian Mayer leverages his experience helping thousands perfect their coding skills in this new book. With expert advice and real-world examples, he’ll show you how to:
• Concentrate on the important stuff with the 80/20 principle -- focus on the 20% of your code that matters most
• Avoid coding in isolation: create a minimum viable product to get early feedback
• Write code cleanly and simply to eliminate clutter
• Avoid premature optimization that risks over-complicating code
• Balance your goals, capacity, and feedback to achieve the productive state of Flow
• Apply the Do One Thing Well philosophy to vastly improve functionality
• Design efficient user interfaces with the Less is More principle
• Tie your new skills together into one unifying principle: Focus
Author(s): Christian Mayer
Edition: 1
Publisher: No Starch Press
Year: 2022
Language: English
Commentary: Vector PDF
Pages: 176
City: San Francisco, CA
Tags: Unix; Software Engineering; Deployment; Design; Testing; Complexity; Software Development Life Cycle; Productivity; Metrics; Code Quality; Minimum Viable Product; Clean Code
Brief Contents
Contents in Detail
Foreword
Acknowledgments
Introduction
Who Is This Book For?
What Will You Learn?
Chapter 1: How Complexity Harms Your Productivity
What Is Complexity?
Complexity in a Project Life Cycle
Planning
Defining
Designing
Building
Testing
Deployment
Complexity in Software and Algorithmic Theory
Complexity in Learning
Complexity in Processes
Complexity in Your Daily Life, or Death by a Thousand Cuts
Conclusion
Chapter 2: The 80/20 Principle
80/20 Principle Basics
Application Software Optimization
Productivity
Success Metrics
Focus and the Pareto Distribution
Implications for Coders
A Success Metric for Programmers
Pareto Distributions in the Real World
Pareto Is Fractal
80/20 Practice Tips
Resources
Chapter 3: Build a Minimum Viable Product
A Problem Scenario
Loss of Motivation
Distraction
Running Over Time
Lack of Response
Wrong Assumptions
Unnecessary Complexity
Building a Minimum Viable Product
Four Pillars of Building a Minimum Viable Product
Advantages of the Minimum Viable Product
Stealth vs. Minimum Viable Product Approach
Conclusion
Chapter 4: Write Clean and Simple Code
Why Write Clean Code?
Writing Clean Code: The Principles
Principle 1: Think About the Big Picture
Principle 2: Stand on the Shoulders of Giants
Principle 3: Code for People, Not Machines
Principle 4: Use the Right Names
Principle 5: Adhere to Standards and Be Consistent
Principle 6: Use Comments
Principle 7: Avoid Unnecessary Comments
Principle 8: The Principle of Least Surprise
Principle 9: Don’t Repeat Yourself
Principle 10: Single Responsibility Principle
Principle 11: Test
Principle 12: Small Is Beautiful
Principle 13: The Law of Demeter
Principle 14: You Ain’t Gonna Need It
Principle 15: Don’t Use Too Many Levels of Indentation
Principle 16: Use Metrics
Principle 17: Boy Scout Rule and Refactoring
Conclusion
Chapter 5: Premature Optimization Is the Root of All Evil
Six Types of Premature Optimization
Optimizing Code Functions
Optimizing Features
Optimizing Planning
Optimizing Scalability
Optimizing Test Design
Optimizing Object-Oriented World Building
Premature Optimization: A Story
Six Tips for Performance Tuning
Measure First, Improve Second
Pareto Is King
Algorithmic Optimization Wins
All Hail the Cache
Less Is More
Know When to Stop
Conclusion
Chapter 6: Flow
What Is Flow?
How to Achieve Flow
Clear Goals
Feedback Mechanism
Balance Opportunity and Capacity
Flow Tips for Coders
Conclusion
Resources
Chapter 7: Do One Thing Well and Other Unix Principles
The Rise of Unix
Philosophy Overview
15 Useful Unix Principles
1. Make Each Function Do One Thing Well
2. Simple Is Better Than Complex
3. Small Is Beautiful
4. Build a Prototype as Soon as Possible
5. Choose Portability Over Efficiency
6. Store Data in Flat Text Files
7. Use Software Leverage to Your Advantage
8. Avoid Captive User Interfaces
9. Make Every Program a Filter
10. Worse Is Better
11. Clean Code Is Better Than Clever Code
12. Design Programs to Connect With Other Programs
13. Make Your Code Robust
14. Repair What You Can—But Fail Early and Noisily
15. Avoid Hand-Hacking: Write Programs to Write Programs If You Can
Conclusion
Resources
Chapter 8: Less Is More in Design
Minimalism in the Evolution of Mobile Phones
Minimalism in Search
Material Design
How to Achieve Minimalistic Design
Use Whitespace
Remove Design Elements
Remove Features
Reduce Variations of Fonts and Colors
Be Consistent
Conclusion
Resources
Chapter 9: Focus
The Weapon Against Complexity
Unifying the Principles
Conclusion
Letter from the Author
Index