Clean Code - Formatting Matters

Topics covered
Popular Clips
Episode Highlights
Horizontal
Horizontal formatting in code is crucial for readability. Alan Underwood shares his frustration with formatters that break strings after 80 characters, preferring scrollable strings instead 1. He advises limiting method chaining to two methods per line to avoid excessive horizontal length. Joe Zack highlights that 40% of lines in popular projects are between 20 and 60 characters, suggesting a natural tendency towards shorter lines 2.
Vertical
Vertical formatting focuses on minimizing the distance between related code elements. Michael Outlaw emphasizes avoiding unnecessary hopping around in source files 3. He also discusses the importance of organizing methods and properties logically within a class. Joe Zack prefers having constructors and public methods at the top, followed by other methods in a logical flow 4.
Related Episodes
Clean Code - How to Write Amazing Functions
Answers 383 questions

Clean Code - Comments Are Lies
Answers 383 questions

Clean Code - How to Write Classes the Right Way
Answers 383 questionsHow to be a Programmer
Answers 383 questions

Clean Code - How to Build Maintainable Systems
Answers 383 questions
Tackling Tough Developer Questions
Answers 383 questionsClean Code - Writing Meaningful Names
Answers 383 questions

Google’s Engineering Practices – Code Review Standards
Answers 383 questions86. Lightning Talks
Answers 383 questions

Clean Architecture - Are Microservices Truly Decoupled?
Answers 383 questions

Clean Architecture - Programming Paradigms
Answers 383 questionsHow to be an Advanced Programmer
Answers 383 questionsHow to be an Intermediate Programmer
Answers 383 questionsJavascript Promises and Beyond
Answers 383 questions

Google's Engineering Practices - What to Look for in a Code Review
Answers 383 questions
