Skip to Content
Good Code, Bad Code
book

Good Code, Bad Code

by Tom Long
August 2021
Intermediate to advanced
376 pages
11h 2m
English
Manning Publications
Content preview from Good Code, Bad Code

9 Make code reusable and generalizable

This chapter covers

  • How to write code that can be safely reused
  • How to write code that can generalize to solve different problems

Chapter 2 discussed how, as engineers, we often solve a high-level problem by breaking it down into a series of subproblems. As we do this on one project after another, we often find that the same subproblems come up again and again. If we or other engineers have already solved a given subproblem, then it makes sense to reuse that solution. It saves us time and reduces the chance of bugs (because the code is already tried and tested).

Unfortunately, just because a solution to a subproblem already exists, it doesn’t always mean that we can reuse it. This can happen if the solution ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Art of Clean Code

The Art of Clean Code

Christian Mayer
Clean Code Cookbook

Clean Code Cookbook

Maximiliano Contieri
Five Lines of Code

Five Lines of Code

Christian Clausen

Publisher Resources

ISBN: 9781617298936Publisher SupportOtherPublisher WebsitePurchase Link