Practical techniques for writing code that is robust, reliable, and easy for team members to understand and adapt.
Summary
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.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
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.
Table of Contents
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
6 Avoid surprises
7 Make code hard to misuse
8 Make code modular
9 Make code reusable and generalizable
PART 3 UNIT TESTING
10 Unit testing principles
11 Unit testing practices
About the Author
Tom Long is a software engineer at Google. He works as a tech lead, mentoring and teaching professional coding practices to new graduates and beginner software engineers.
eBook License
End-User Warranty and License Agreement
1. Grant of License
Manning has authorized the download by you of anunrestricted number of copies of the electronic book (ebook) in any of theavailable formats. Manning grants you a nonexclusive, nontransferable licenseto use the ebook according to the terms and conditions herein. This LicenseAgreement permits you to install the ebook on any and all your devices for yourpersonal use only.
2. Restrictions
You shall not: (1) share, resell, rent, assign,timeshare, distribute, or transfer all or part of the ebook or any rightsgranted hereunder to any other person; (2) duplicate the ebook, except for asingle backup or archival copy; (3) remove any proprietary notices, labels, ormarks from the ebook; (4) transfer or sublicense title to the ebook to anyother party.
3. Intellectual Property Protection
The ebook is owned by Manning and is protected byUnited States and international copyright and other intellectual property laws.Manning reserves all rights in the ebook not expressly granted herein. Thislicense and your right to use the ebook terminate automatically if you violateany part of this Agreement. In the event of termination, you must remove theoriginal and any copies of the ebook from all your devices.
4. Source Code Supplementary Material
Any source code files provided as a supplement tothe book are freely available to the public for download. Reuse of the code ispermitted, in whole or in part, including the creation of derivative works,provided that you acknowledge that you are using it and identify the source:title, publisher and year.
5. Limited Warranty
Manning warrants that the ebook files, a copy ofwhich you are authorized to download, are free from defects in the operationalsense that they can be read by a PDF Reader or ePub reader, or other. EXCEPTFOR THIS EXPRESS LIMITED WARRANTY, MANNING MAKES AND YOU RECEIVE NO WARRANTIES,EXPRESS, IMPLIED, STATUTORY OR IN ANY COMMUNICATION WITH YOU, AND MANNINGSPECIFICALLY DISCLAIMS ANY OTHER WARRANTY INCLUDING THE IMPLIED WARRANTY OFMERCHANTABILITY OR FITNESS OR A PARTICULAR PURPOSE. MANNING DOES NOT WARRANTTHAT THE OPERATION OF THE EBOOK WILL BE UNINTERRUPTED OR ERROR FREE. If theebook was purchased in the United States, the above exclusions may not apply toyou as some states do not allow the exclusion of implied warranties. Inaddition to the above warranty rights, you may also have other rights that varyfrom state to state.
6. Limitation of Liability
IN NO EVENT WILL MANNING BE LIABLE FOR ANY DAMAGES,WHETHER ARISING FOR TORT OR CONTRACT, INCLUDING LOSS OF DATA, LOST PROFITS, OROTHER SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR INDIRECT DAMAGES ARISING OUT OFTHE USE OR INABILITY TO USE THE EBOOK.