Skip to Main Content
Becoming a Better Programmer
book

Becoming a Better Programmer

by Pete Goodliffe
October 2014
Intermediate to advanced content levelIntermediate to advanced
362 pages
7h 49m
English
O'Reilly Media, Inc.
Content preview from Becoming a Better Programmer

Chapter 12. Coping with Complexity

Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better.

Edsger Dijkstra

Code is complex. Complexity is a battle that we all have to fight daily.

Of course, your code is great, isn’t it? It’s other people’s code that is complex.

Well, no. Not always. Admit it. It’s all too easy to write something complicated. It happens when you’re not paying attention. It happens when you don’t plan ahead sufficiently. It happens when you start working on a “simple” problem, but soon you’ve discovered so many corner cases that your simple algorithm has grown to reflect a labyrinth, ready to entrap an unwary programmer.

My observation is that software complexity stems from three main sources. Blobs. And lines.

bbpg 12in01

And what you get when you combine them: people.

bbpg 12in02

In this chapter, we’ll take a look at each of these and see what we can learn about writing better software.

Blobs

The first part of software complexity we should consider relates to blobs: that is, the components we write. The size and number of those blobs determine complexity.

Some software complexity is a natural consequence of size; the larger a project becomes, the more blobs we need, the harder it ...

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

How Functional Programming Can Improve Testing, Reuse, and Maintenance in Your Current Codebase

How Functional Programming Can Improve Testing, Reuse, and Maintenance in Your Current Codebase

Eric Normand

Publisher Resources

ISBN: 9781491905562Errata Page