Book description
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!
What's Inside
- Write functions that read like sentences
- Ensure your code stays bug-free
- How to sniff out bad code
- Save time for yourself and your team
About the Reader
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.
Quotes
A wealth of knowledge to sharpen your toolset.
- Joe Ivans, California Regional MLS
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
Table of contents
- Good Code, Bad Code
- Copyright
- contents
- front matter
- Part 1 In theory
- 1 Code quality
- 2 Layers of abstraction
- 3 Other engineers and code contracts
- 4 Errors
- Part 2 In practice
-
5 Make code readable
- 5.1 Use descriptive names
- 5.2 Use comments appropriately
- 5.3 Don’t fixate on number of lines of code
- 5.4 Stick to a consistent coding style
- 5.5 Avoid deeply nesting code
- 5.6 Make function calls readable
- 5.7 Avoid using unexplained values
- 5.8 Use anonymous functions appropriately
- 5.9 Use shiny, new language features appropriately
- Summary
- 6 Avoid surprises
- 7 Make code hard to misuse
-
8 Make code modular
- 8.1 Consider using dependency injection
- 8.2 Prefer depending on interfaces
- 8.3 Beware of class inheritance
- 8.4 Classes should care about themselves
- 8.5 Encapsulate related data together
- 8.6 Beware of leaking implementation details in return types
- 8.7 Beware of leaking implementation details in exceptions
- Summary
- 9 Make code reusable and generalizable
- Part 3 Unit testing
- 10 Unit testing principles
- 11 Unit testing practices
- Appendix A. Chocolate brownie recipe
- Appendix B. Null safety and optionals
- Appendix C. Extra code examples
- index
Product information
- Title: Good Code, Bad Code
- Author(s):
- Release date: August 2021
- Publisher(s): Manning Publications
- ISBN: 9781617298936
You might also like
book
The Art of Clean Code
Most software developers waste thousands of hours working with overly complex code. The eight core principles …
book
Code That Fits in Your Head: Heuristics for Software Engineering
How to Reduce Code Complexity and Develop Software More Sustainably “Mark Seemann is well known for …
book
Code like a Pro in C#
Build on your existing programming skills and upskill to professional-level C# programming. In Code Like A …
book
Clean Code Cookbook
Often, software engineers and architects work with large, complex code bases that they need to scale …