The Art of Programming

Learn to Program, Third Edition — by Chris Pine (9 / 116)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Installation and Setup | TOC | Chapter 1 Numbers 👉

An important part of programming is, of course, making a program that does what it’s supposed to do. In other words, it should have no bugs. You already know this. But focusing on correctness and bug-free programs misses a lot of what programming is all about. Programming isn’t only about the end product; it’s about the process that gets you there. (Anyway, an ugly process will result in buggy code. This happens every time.)

Programs aren’t built in one go. They are talked about, sketched out, prototyped, played with, refactored, tuned, tested, tweaked, deleted, rewritten….

A program isn’t built; it’s grown.

Because a program is always growing and changing, it must be written with change in mind. I know it’s not clear yet what this means in practical terms, but I’ll be discussing it throughout the book.

Probably the first, most fundamental rule of good programming is to avoid duplication of code at all costs. This is sometimes called the DRY rule: Don’t Repeat Yourself.

I usually think of it in another way: a good programmer cultivates the virtue of laziness. But not just any laziness. You must be aggressively, proactively lazy. Save yourself from doing unnecessary work whenever possible. If making a few changes now means you’ll be able to save yourself more work later…

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.