Good Code, Bad Code, video edition

Video description

In Video Editions the narrator reads the book while the content, figures, code listings, diagrams, and text appear on the screen. Like an audiobook that you can also watch as a video.


A wealth of knowledge to sharpen your toolset.
Joe Ivans, California Regional MLS

Practical techniques for writing code that is robust, reliable, and easy for team members to understand and adapt.

In Good Code, Bad Code you'll learn how to:
  • Think about code like an effective software engineer
  • Write functions that read like well-structured sentences
  • Ensure code is reliable and bug-free
  • Effectively unit test code
  • Identify code that can cause problems and improve it
  • Write code that is reusable and adaptable to new requirements
  • Improve your medium and long-term productivity
  • Save yourself and your team time

The difference between good code or bad code often comes down to how you apply the established practices of the software development community. In Good Code, Bad Code you’ll learn how to boost your productivity and effectiveness with code development insights normally only learned through careful mentorship and hundreds of code reviews.

about the technology

Software development is a team sport. For an application to succeed, your code needs to be robust and easy for others to understand, maintain, and adapt. Whether you’re working on an enterprise team, contributing to an open source project, or bootstrapping a startup, it pays to know the difference between good code and bad code.

about the book

Good Code, Bad Code is a clear, practical introduction to writing code that’s a snap to read, apply, and remember. With dozens of instantly-useful techniques, you’ll find coding insights that normally take years of experience to master. In this fast-paced guide, Google software engineer Tom Long teaches you a host of rules to apply, along with advice on when to break them!

about the audience

For coders early in their careers who are familiar with an object-oriented language, such as Java or C#.

about the author

Tom Long is a software engineer at Google where he works as a tech lead. Among other tasks, he regularly mentors new software engineers in professional coding best practices.

Pragmatic advice and useful tips for a career in software development.
George Thomas, Manhattan Associates

A practical, informative book designed to help developers write high-quality, effective code.
Christopher Villanueva, Independent Consultant

Smart, well written, actionable information for creating maintainable code.
Hawley Waldman, Consultant

NARRATED BY JULIE BRIERLEY

Table of contents

  1. Part 1 - In theory
  2. Chapter 1 Code quality
  3. Chapter 1 The goals of code quality
  4. Chapter 1 The pillars of code quality
  5. Chapter 1 Make code hard to misuse
  6. Chapter 1 Make code testable and test it properly
  7. Chapter 2 Layers of abstraction
  8. Chapter 2 Why create layers of abstraction?
  9. Chapter 2 Layers of code
  10. Chapter 2 Classes, Part 1
  11. Chapter 2 Classes, Part 2
  12. Chapter 2 Interfaces
  13. Chapter 2 When layers get too thin
  14. Chapter 3 Other engineers and code contracts
  15. Chapter 3 How will others figure out how to use your code?
  16. Chapter 3 Code contracts
  17. Chapter 3 Don’t rely too much on small print
  18. Chapter 3 Checks and assertions
  19. Chapter 4 Errors
  20. Chapter 4 Robustness vs. failure
  21. Chapter 4 Don’t hide errors
  22. Chapter 4 Ways of signaling errors
  23. Chapter 4 Explicit: Nullable return type
  24. Chapter 4 Implicit: Promise or future
  25. Chapter 4 Signaling errors that a caller might want to recover from
  26. Chapter 4 Arguments for using explicit techniques
  27. Part 2 - In practice
  28. Chapter 5 Make code readable
  29. Chapter 5 Use comments appropriately
  30. Chapter 5 Don’t fixate on number of lines of code
  31. Chapter 5 Stick to a consistent coding style
  32. Chapter 5 Make function calls readable
  33. Chapter 5 Avoid using unexplained values
  34. Chapter 5 Use anonymous functions appropriately
  35. Chapter 5 Solution: Break large anonymous functions into named functions
  36. Chapter 6 Avoid surprises
  37. Chapter 6 Solution: Return null, an optional, or an error
  38. Chapter 6 Use the null object pattern appropriately
  39. Chapter 6 More complicated null objects can cause surprises
  40. Chapter 6 Avoid causing unexpected side effects
  41. Chapter 6 Beware of mutating input parameters
  42. Chapter 6 Avoid writing misleading functions
  43. Chapter 6 Future-proof enum handling
  44. Chapter 6 Beware of the default case
  45. Chapter 7 Make code hard to misuse
  46. Chapter 7 Solution: Set values only at construction time
  47. Chapter 7 Consider making things deeply immutable
  48. Chapter 7 Avoid overly general data types
  49. Chapter 7 Dealing with time
  50. Chapter 7 Have single sources of truth for data
  51. Chapter 7 Have single sources of truth for logic
  52. Chapter 8 Make code modular
  53. Chapter 8 Design code with dependency injection in mind
  54. Chapter 8 Beware of class inheritance
  55. Chapter 8 Solution: Use composition
  56. Chapter 8 Classes should care about themselves
  57. Chapter 8 Beware of leaking implementation details in return types
  58. Chapter 8 Beware of leaking implementation details in exceptions
  59. Chapter 9 Make code reusable and generalizable
  60. Chapter 9 Beware of global state
  61. Chapter 9 Use default return values appropriately
  62. Chapter 9 Keep function parameters focused
  63. Part 3 - Unit testing
  64. Chapter 10 Unit testing principles
  65. Chapter 10 What makes a good unit test?
  66. Chapter 10 Well-explained failures
  67. Chapter 10 Focus on the public API but don’t ignore important behaviors
  68. Chapter 10 Test doubles
  69. Chapter 10 Mocks
  70. Chapter 10 Mocks and stubs can be problematic
  71. Chapter 10 Fakes
  72. Chapter 10 Pick and choose from testing philosophies
  73. Chapter 11 Unit testing practices
  74. Chapter 11 Avoid making things visible just for testing
  75. Chapter 11 Test one behavior at a time
  76. Chapter 11 Use shared test setup appropriately
  77. Chapter 11 Shared configuration can be problematic
  78. Chapter 11 Use appropriate assertion matchers
  79. Chapter 11 Use dependency injection to aid testability
  80. Appendix B. Null safety and optionals

Product information

  • Title: Good Code, Bad Code, video edition
  • Author(s): Tom Long
  • Release date: August 2021
  • Publisher(s): Manning Publications
  • ISBN: None