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 2. Keeping Up Appearances

Appearances are deceptive.

Aesop

No one likes working with messy code. No one wants to wallow in a mire of jagged, inconsistent formatting, or battle with gibberish names. It’s not fun. It’s not productive. It’s the programmer’s purgatory.

We care about good code. And so we naturally care about code aesthetics; it is the most immediate determinant of how easy a section of code will be to work with. Practically every book about programming has a chapter on presentation. Oh look, this one does, too. Go figure.

Sadly, programmers care so much about code presentation that they end up bickering about it. This is the stuff that holy wars are made of. That, and which editor is best.footnote::[Vim is. That is all.] Tabs versus spaces. Brace positioning. Columns per line. Capitalisation. I’ve got my preferences. You have yours.

Godwin’s law states that as any discussion on the Internet grows longer, the probability of a comparison to the Nazis or Hitler approaches one. Goodliffe’s law (unveiled here) states that as any discussion about code layout grows, the probability of it descending into a fruitless argument approaches one.

Good programmers care deeply about good code presentation. But they rise above this kind of petty squabble. Let’s act like grown-ups.

Key

Stop fighting over code layout. Adopt a healthy attitude to your code presentation.

Our myopic focus on layout is most clearly illustrated by the classic dysfunctional code review. When given ...

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