The Pragmatic Programmer
your journey to mastery
by Dave Thomas, Andy Hunt
Version: P1.0 (September 13, 2019)
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. "The Pragmatic Programmer" and the linking g device are trademarks of The Pragmatic Programmers, LLC.
The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.
For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at .
For government sales inquiries, please contact
Library of Congress Control Number: 2019944178
Copyright 2020 Pearson Education, Inc.
Cover images: Mihalec/Shutterstock, Stockish/Shutterstock
All rights reserved. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, request forms and the appro- priate contacts within the Pearson Education Global Rights & Permissions Department, please visit www.pearsoned.com/permissions.
ISBN-13: 978-0-13-595705-9
ISBN-10: 0-13-595705-2
For Juliet and Ellie,
Zachary and Elizabeth,
Henry and Stuart
Table of Contents
Copyright 2020 Pearson Education, Inc.
Praise for the second edition of The Pragmatic Programmer
Some say that with The Pragmatic Programmer , Andy and Dave captured lightning in a bottle; that its unlikely anyone will soon write a book that can move an entire industry as it did. Sometimes, though, lightning does strike twice, and this book is proof. The updated content ensures that it will stay at the top of best books in software development lists for another 20 years, right where it belongs.
VM (Vicky) Brasseur |
Director of Open Source Strategy, Juniper Networks |
If you want your software to be easy to modernize and maintain, keep a copy of The Pragmatic Programmer close. Its filled with practical advice, both technical and professional, that will serve you and your projects well for years to come.
Andrea Goulet |
CEO, Corgibytes; Founder, LegacyCode.Rocks |
The Pragmatic Programmer is the one book I can point to that completely dislodged the existing trajectory of my career in software and pointed me in the direction of success. Reading it opened my mind to the possibilities of being a craftsman, not just a cog in a big machine. One of the most significant books in my life.
Obie Fernandez |
Author, The Rails Way |
First-time readers can look forward to an enthralling induction into the modern world of software practice, a world that the first edition played a major role in shaping. Readers of the first edition will rediscover here the insights and practical wisdom that made the book so significant in the first place, expertly curated and updated, along with much thats new.
David A. Black |
Author, The Well-Grounded Rubyist |
I have an old paper copy of the original Pragmatic Programmer on my bookshelf. It has been read and re-read and a long time ago it changed everything about how I approached my job as a programmer. In the new edition everything and nothing has changed: I now read it on my iPad and the code examples use modern programming languagesbut the underlying concepts, ideas, and attitudes are timeless and universally applicable. Twenty years later, the book is as relevant as ever. It makes me happy to know that current and future developers will have the same opportunity to learn from Andy and Daves profound insights as I did back in the day.
Sandy Mamoli |
Agile coach, author of How Self-Selection Lets People Excel |
Twenty years ago, the first edition of The Pragmatic Programmer completely changed the trajectory of my career. This new edition could do the same for yours.
Mike Cohn |
Author of Succeeding with Agile , Agile Estimating and Planning, and User Stories Applied |
Foreword
I remember when Dave and Andy first tweeted about the new edition of this book. It was big news. I watched as the coding community responded with excitement. My feed buzzed with anticipation. After twenty years, The Pragmatic Programmer is just as relevant today as it was back then.
It says a lot that a book with such history had such a reaction. I hadthe privilege of reading an unreleased copy to write this foreword, andI understood why it created such a stir. While its a technical book,calling it that does it a disservice. Technical books often intimidate.Theyre stuffed with big words, obscure terms, convoluted examples that,unintentionally, make you feel stupid. The more experienced the author,the easier it is to forget what its like to learn new concepts, to be abeginner.
Despite their decades of programming experience, Dave and Andy have conquered the difficult challenge of writing with the same excitement of people whove just learned these lessons. They dont talk down to you. They dont assume you are an expert. They dont even assume youve read the first edition. They take you as you areprogrammers who just want to be better. They spend the pages of this book helping you get there, one actionable step at a time.
To be fair, theyd already done this before. The original release was full of tangible examples, new ideas, and practical tips to build your coding muscles and develop your coding brain that still apply today. But this updated edition makes two improvements on the book.
The first is the obvious one: it removes some of the older references, the out-of-date examples, and replaces them with fresh, modern content. You wont find examples of loop invariants or build machines. Dave and Andy have taken their powerful content and made sure the lessons still come through, free of the distractions of old examples. It dusts off old ideas like DRY (dont repeat yourself) and gives them a fresh coat of paint, really making them shine.
But the second is what makes this release truly exciting. After writing the first edition, they had the chance to reflect on what they were trying to say, what they wanted their readers to take away, and how it was being received. They got feedback on those lessons. They saw what stuck, what needed refining, what was misunderstood. In the twenty years that this book has made its way through the hands and hearts of programmers all over the world, Dave and Andy have studied this response and formulated new ideas, new concepts.