You care about code. You’re passionate about programming. You’re the kind of developer who likes to craft truly great software. And you’ve picked up this book because you want to do it even better. Good call.
This book will help you.
The aim is to do exactly what it says on the cover: help you become a better programmer. But what does that mean exactly?
Pretty early in any programmer’s career comes the realisation that there’s more to being a great coder than a simple understanding of syntax and a mastery of basic design. The awesome programmers, those productive people who craft beautiful code and work effectively with other people, know far more. There are methods of working, attitudes, approaches, idioms, and techniques you learn over time that increase your effectiveness. There are useful social skills, and a whole pile of tribal knowledge to pick up.
And, of course, you need to learn syntax and design.
That is exactly what this book is about. It’s a catalogue of useful techniques and approaches to the art and craft of programming that will help you become better.
I won’t pretend that this is an exhaustive treatise. The field is vast. There’s always more to learn, with new ground being claimed every day. These chapters are simply the fruit of more than 15 years of my work as a professional programmer. I’ve seen enough code, and made enough mistakes. I won’t claim I’m an expert; I’m just well seasoned. If you can learn from the mistakes I’ve made and garner inspiration from what I’ve experienced, then you’ll gain a leg up in your own development career.
The topics covered in this book run the whole gamut of the software developer’s life:
There’s no particular language or industry bias here.
Whether you’re an industry expert, a seasoned developer, a neophyte professional, or a hobbyist coder—this book will serve you.
Becoming a Better Programmer aims to help programmers at any level improve. That’s a grand claim, but there’s always something we can learn, and always room for improvement, no matter how experienced a programmer you are. Each chapter provides the opportunity to review your skills and work out practical ways to improve.
The only prerequisite for making use of this book is that you must want to become a better programmer.
The information in this book is presented in a series of simple, self-contained chapters, each covering a single topic. If you’re a traditionalist, you can read them in order from front to back. But feel free to read chapters in any order you want. Go straight to what seems most pertinent to you, if that makes you most happy.
The chapters are presented in five parts:
More important than the order you consume these chapters is how you approach the material. In order to actually improve, you have to apply what you read practically. The structure of each chapter is designed to help you with this.
In each chapter, the topic at hand is unpacked in flowing prose with stark clarity. You’ll laugh; you’ll cry; you’ll wonder why. The conclusion of each chapter includes the following subsections:
Throughout each chapter, there are particularly important key points. They are highlighted so you don’t miss them.
This is a key point. Take heed.
As you work through each chapter, please do spend time considering the questions and the Try this… challenges. Don’t gloss over them. They’re an important part of Becoming a Better Programmer. If you just flick through the information in each chapter, then it will be just that: information. Hopefully interesting. No doubt informative. But unlikely to make you a much better programmer.
You need to be challenged, and absorb what you read to your programming skillset. These closing exercises won’t take you too long. Honestly. And they will really help cement each chapter’s theme in your mind.
This book has been designed to work as a valuable tool for mentoring fellow programmers. You can use it one-on-one or in a study group.
The best approach to this material is not to methodically work through each section together. Instead, read a chapter separately, and then get together to discuss the contents. The questions really work as a springboard for discussion, so it’s a good idea to start there.
Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.
Safari Books Online offers a range of product mixes and pricing programs for organizations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and dozens more. For more information about Safari Books Online, please visit us online.
Please address comments and questions concerning this book to the publisher:
|O’Reilly Media, Inc.|
|1005 Gravenstein Highway North|
|Sebastopol, CA 95472|
|800-998-9938 (in the United States or Canada)|
|707-829-0515 (international or local)|
We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://bit.ly/becoming_a_better_programmer.
To comment or ask technical questions about this book, send email to firstname.lastname@example.org.
For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
Writing a book is a surprisingly large undertaking: one that tends to take over your life and suck other people into the maelstrom on the way. There are many people who have in some way contributed to the state of this book, from the very early drafts of this material right through until it became the complete tome that rests on your (potentially digital) bookshelf.
My wonderful wife, Bryony, has patiently supported (and put up with) me whilst my finger has been in this pie, alongside the many other pies my other fingers find. I love you, and I appreciate you very much. Alice and Amelia have provided many welcome distractions; you make life fun!
Some parts of this book originated in articles I wrote over the last few years. Steve Love, the esteemed editor of ACCU’s C Vu magazine, has contributed valuable feedback on many of these, and his encouragement and sage opinion has always been appreciated. (If you don’t know about ACCU, it is an awesome organisation for programmers who care about code.)
Many friends and colleagues have contributed valuable inspiration, feedback, and critique. These include my Akai family: Dave English, Will Augar, Łukasz Kozakiewicz, and Geoff Smith. Lisa Crispin and Jon Moore provided insight from the QA perspective, Greg Law taught me facts about bugs, whilst Seb Rose and Chris Oldwood offered much-appreciated and timely reviews.
The technical reviewers—Kevlin Henney, Richard Warburton, and Jim Brikman—provided much valuable feedback and helped shape the text you’re reading. I am grateful for their expert input.
The excellent O’Reilly team of editors and production geniuses have worked hard on this book, and I’m grateful for their skillful attention. In particular, Mike Loukides and Brian MacDonald’s early formative work helped shape the material considerably.
Lorna Ridley drew a chicken, single-handedly preventing this book from being fowl.