Skip to Main Content
The Rules of Programming
book

The Rules of Programming

by Chris Zimmerman
December 2022
Beginner content levelBeginner
343 pages
7h 36m
English
O'Reilly Media, Inc.
Audiobook available
Content preview from The Rules of Programming

Rule 11. Is It Twice as Good?

Every project eventually hits the natural limits of its architecture—you hit some problem that just doesn’t fit the way things work. Maybe you need to add a feature that can’t be expressed in your paradigm. Say you’ve got a filtering mechanism that lets you specify a set of criteria that all need to be met, and you run into a case where you need to OR some criteria instead of ANDing them.

Or the shape of the data has changed. You built the system to solve problems of some size, and over time it starts to be applied to problems of a different size or shape, and you’re running into existential performance problems.

It could be that things are just getting tangled. Your paradigm provides ways to tweak the core behavior of the system in special cases, which is one of the reasons it’s lasted as long as it has. But now the extension mechanism is used in every single case, not just special ones. Every use of the system is a hopscotch through different exceptional cases, and it’s hard for people to figure out whether something new works, much less how it works.

Maybe some bit of code is old enough that it just doesn’t fit with the rest of your codebase. You’ve got a bit of C code in your fairly forward-thinking C++ project, and you recoil at all of its hand-rolled pointer structures. It represents an older, alien way of thinking, and everyone wants to rewrite it in a more modern paradigm.

This sort of thing is natural and inevitable, and shouldn’t cause you ...

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 Programmer's Brain

The Programmer's Brain

Felienne Hermans
Design It!

Design It!

Michael Keeling
The Art of Clean Code

The Art of Clean Code

Christian Mayer

Publisher Resources

ISBN: 9781098133108Errata PageSupplemental Content