Refactoring

In 'Refactoring', Martin Fowler unveils the transformative art of improving existing code without changing its external behavior. This essential guide reveals practical techniques and principles that empower developers to enhance code readability and maintainability, making it a pivotal resource for software engineering. Readers will discover the compelling reasons behind refactoring and the dramatic impact it has on long-term project success. By dissecting real-world examples, Fowler fosters a deeper understanding of code quality and design philosophy. Whether you're a novice or a seasoned pro, this book ignites a passion for clean code and continuous improvement.

By Martin Fowler

Published: 2018

"Refactoring is about improving the design of existing code without changing its behavior."

RefactoringBook binding

Start Listening

0:000:00

What Readers Say About This Book

"Whenever you read [Refactoring], it's time to read it again. And if you haven't read it yet, please do before writing another line of code." -David Heinemeier Hansson, Creator of Ruby on Rails, Founder & CTO at Basecamp Fully Revised and Updated--Includes New Refactorings and Code Examples "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." -M. Fowler (1999) For more than twenty years, experienced programmers worldwide have relied on Martin Fowler's Refactoring to improve the design of existing code and to enhance software maintainability, as well as to make existing code easier to understand. This eagerly awaited new edition has been fully updated to reflect crucial changes in the programming landscape. Refactoring, Second Edition, features an updated catalog of refactorings and includes JavaScript code examples, as well as new functional examples that demonstrate refactoring without classes. Like the original, this edition explains what refactoring is; why you should refactor; how to recognize code that needs refactoring; and how to actually do it successfully, no matter what language you use. Understand the process and general principles of refactoring Quickly apply useful refactorings to make a program easier to comprehend and change Recognize "bad smells" in code that signal opportunities to refactor Explore the refactorings, each with explanations, motivation, mechanics, and simple examples Build solid tests for your refactorings Recognize tradeoffs and obstacles to refactoring Includes free access to the canonical web edition, with even more refactoring resources. (See inside the book for details about how to access the web edition.)

Mike & Casey Show Logo

The Mike & Casey Show

Dive into captivating book discussions with our expert hosts

Key Points from Refactoring

About the Author

M

Martin Fowler

Martin Fowler is a renowned software engineer, author, and speaker, known for his contributions to the field of software development and design. He is the Chief Scientist at ThoughtWorks and has written several influential books, including "Refactoring: Improving the Design of Existing Code," "Patterns of Enterprise Application Architecture," and "Domain Specific Languages." His writing style is characterized by clarity and practical insights, making complex topics accessible to both novice and experienced developers. Fowler is also a thought leader in Agile methodology and continuous integration, advocating for best practices in modern software development.

Book Details

Key information about the book.

Authors
Martin Fowler
Published
November 2018
Publisher
Addison-Wesley Professional
ISBN
0134757599
Language
English
Pages
448
Genres
Software DevelopmentTechnology

Purchase Options

Amazon logoBuy on Amazon
BookShop logoBuy via BookShop

Support local bookstores: BookShop gives a portion of each sale to independent bookshops!

Similar books you might like →

Clean CodeBook binding

Clean Code

Robert C. Martin

The Pragmatic ProgrammerBook binding

The Pragmatic Programmer

Andrew Hunt, David Thomas

The Catcher in the RyeBook binding

The Catcher in the Rye

J.D. Salinger

Do LessBook binding

Do Less

Kate Northrup

WillBook binding

Will

Will Smith

Company of OneBook binding

Company of One

Paul Jarvis

The Art of Thinking ClearlyBook binding

The Art of Thinking Clearly

Rolf Dobelli

Washington's War on NicaraguaBook binding

Washington's War on Nicaragua

Holly Sklar

CodeBook binding

Code

Charles Petzold

PeoplewareBook binding

Peopleware

Tom DeMarco, Timothy R. Lister

Swimming to AntarcticaBook binding

Swimming to Antarctica

Lynne Cox

What Technology WantsBook binding

What Technology Wants

Kevin Kelly

Beyond the TreesBook binding

Beyond the Trees

Adam Shoalts

Girl Gone ViralBook binding

Girl Gone Viral

Arvin Ahmadi

Medieval Technology and Social ChangeBook binding

Medieval Technology and Social Change

Lynn White (Jr.)

Barbarian DaysBook binding

Barbarian Days

William Finnegan

Hacking DarwinBook binding

Hacking Darwin

Jamie Metzl

Dealers of LightningBook binding

Dealers of Lightning

Michael A. Hiltzik

Hacking SalesBook binding

Hacking Sales

Max Altschuler

Packing for Mars: The Curious Science of Life in the VoidBook binding

Packing for Mars: The Curious Science of Life in the Void

Mary Roach

Tuxedo ParkBook binding

Tuxedo Park

Jennet Conant

How Nature WorksBook binding

How Nature Works

Per Bak

Idea MakersBook binding

Idea Makers

Stephen Wolfram

Fighting PowerBook binding

Fighting Power

Martin Van Creveld

The Complete Idiot's Guide to the U.S. ConstitutionBook binding

The Complete Idiot's Guide to the U.S. Constitution

Tim Harper

The Midnight FoxBook binding

The Midnight Fox

Betsy Byars

Kill ProcessBook binding

Kill Process

William Hertling

Take your reading experience to the next level

Download our mobile app to enjoy your favorite books on the go. Get access to exclusive features, offline listening, and personalized recommendations.

Download on the App Store

Book Collections you might like →

Paul Graham's Book Recommendations

Paul Graham's Book Recommendations

Paul Graham is a prominent programmer, venture capitalist, and essayist known for his influential work in the tech startup ecosystem. He co-founded Viaweb, one of the first web-based applications, which was later acquired by Yahoo! and became Yahoo! Store. As a co-founder of Y Combinator, Graham has been instrumental in funding and mentoring numerous successful startups, including Dropbox, Airbnb, and Reddit. His essays, collected in books such as "Hackers & Painters," offer profound insights into technology, entrepreneurship, and philosophy, making significant contributions to modern literature on these subjects. Graham's blend of technical expertise and thought leadership has made him a pivotal figure in both the tech and literary communities.

View Collection
Satya Nadella's Book Recommendations

Satya Nadella's Book Recommendations

Satya Nadella is the CEO of Microsoft, a position he has held since 2014, significantly transforming the company into a leader in cloud computing and artificial intelligence. Under his leadership, Microsoft's market value has surged, and the company has embraced a more open and innovative culture. Nadella is also the author of "Hit Refresh," a book that explores the principles and strategies behind Microsoft's cultural and technological renaissance. His writings provide insights into leadership, empathy, and the impact of technology on society. Nadella's vision and guidance have positioned Microsoft at the forefront of the tech industry, making him a highly influential figure in modern business and technology discourse.

View Collection
Marty Cagan's Book Recommendations

Marty Cagan's Book Recommendations

Marty Cagan is a renowned product management expert and founding partner of the Silicon Valley Product Group (SVPG). He is best known for his influential book "Inspired: How To Create Products Customers Love," which has become a seminal text in the field of product management. With a career spanning decades, Cagan has held key leadership roles at tech giants such as Hewlett-Packard, Netscape Communications, and eBay. His contributions extend beyond authorship, as he frequently shares his expertise through speaking engagements, workshops, and advisory roles to help companies build successful product teams. Cagan's work has profoundly shaped modern product management practices and continues to inspire product leaders worldwide.

View Collection
David Heinemeier Hansson's Book Recommendations

David Heinemeier Hansson's Book Recommendations

David Heinemeier Hansson, also known as DHH, is a Danish programmer, entrepreneur, and author, best known as the creator of Ruby on Rails, a popular web application framework. Heinemeier Hansson is also a partner at Basecamp, a project management and collaboration software company he co-founded. His contributions to software development have earned him widespread recognition, with Ruby on Rails being used by thousands of developers and companies worldwide. Heinemeier Hansson is also a vocal advocate for remote work, simplicity in business, and sustainable work practices, ideas he explores in his bestselling books Rework and It Doesn’t Have to Be Crazy at Work. In addition to his work in tech, he is an accomplished race car driver, having competed in the 24 Hours of Le Mans. Heinemeier Hansson’s approach to work-life balance and entrepreneurship has made him a thought leader in the tech community, where he continues to challenge traditional business practices and advocate for more human-centered approaches to work

View Collection
Ryan Holiday's Book Recommendations

Ryan Holiday's Book Recommendations

Ryan Holiday is a bestselling author and media strategist known for his books on stoicism, including The Obstacle Is the Way and Ego Is the Enemy. He is a leading voice in modern stoic philosophy, teaching readers how to apply ancient wisdom to achieve personal and professional success. Holiday’s work emphasizes resilience, discipline, and humility as keys to navigating life’s challenges. He has consulted with major companies and individuals on marketing and strategy, blending stoic principles with contemporary business practices. His books have been translated into over 30 languages.

View Collection
Bret Victor's Book Recommendations

Bret Victor's Book Recommendations

Bret Victor is a renowned American interface designer and computer scientist celebrated for his innovative contributions to interactive design and human-computer interaction. He is best known for creating dynamic, explorable explanations, which have significantly influenced the way educational content is presented and understood. Victor's seminal work, "Inventing on Principle," advocates for the integration of immediate feedback in creative processes, inspiring a new wave of interactive programming environments. As a former member of the Apple Human Interface team, he played a pivotal role in shaping modern user interfaces. Through his organization, Dynamicland, Victor continues to explore and expand the boundaries of immersive, collaborative computing environments.

View Collection
Vinod Khosla's Book Recommendations

Vinod Khosla's Book Recommendations

Vinod Khosla is an Indian-American venture capitalist and co-founder of Sun Microsystems, one of the companies that helped drive the development of the internet. Khosla is the founder of Khosla Ventures, a venture capital firm that focuses on early-stage investments in technology and energy. He is known for his bold approach to investing, often backing companies working on breakthrough technologies in areas like renewable energy, healthcare, and artificial intelligence. Khosla is a vocal advocate for using technology to solve some of the world’s biggest problems. His visionary approach to investing has made him one of the most influential figures in Silicon Valley.

View Collection
Patrick Collison's Book Recommendations

Patrick Collison's Book Recommendations

Patrick Collison is an Irish entrepreneur and co-founder of Stripe, a global technology company that enables businesses to accept online payments. Along with his brother John, Patrick has transformed Stripe into one of the most valuable private tech companies in the world. Stripe’s innovative approach to online payments has made it a key player in the financial technology space. Collison is known for his deep interest in science, technology, and policy, often engaging in conversations about innovation, progress, and how to improve societal outcomes. He is an advocate for scientific advancement and the intersection of technology and public policy.

View Collection
Drew Houston's Book Recommendations

Drew Houston's Book Recommendations

Drew Houston is an accomplished American entrepreneur best known for co-founding Dropbox, a widely-used cloud storage service, in 2007. As the CEO, he has led the company to serve millions of users worldwide and become a key player in the tech industry. Although not primarily known for literature, Houston has shared his entrepreneurial insights and experiences through various interviews and public speaking engagements, offering valuable lessons to aspiring business leaders. His work has significantly influenced the way people and organizations manage and share digital content. Houston's innovative vision continues to shape the future of cloud computing and digital collaboration.

View Collection
Nassim Nicholas Taleb's Book Recommendations

Nassim Nicholas Taleb's Book Recommendations

Nassim Nicholas Taleb is a Lebanese-American author, scholar, and risk analyst, best known for his work on uncertainty, probability, and risk. His books, including The Black Swan and Antifragile, explore how rare and unpredictable events shape the world and how individuals and systems can become more resilient to shocks. Taleb’s insights on risk management have influenced fields ranging from finance to medicine, and he is known for his outspoken criticism of conventional wisdom. His ideas about randomness, decision-making, and the limitations of human knowledge have made him a leading thinker in modern economics and philosophy.

View Collection
Andrew Chen's Book Recommendations

Andrew Chen's Book Recommendations

Andrew Chen is a venture capitalist, entrepreneur, and thought leader in growth marketing, currently serving as a general partner at Andreessen Horowitz. Chen is known for his expertise in network effects, viral growth strategies, and marketplace dynamics, making him a sought-after advisor for startups looking to scale. Prior to joining Andreessen Horowitz, he worked in leadership roles at Uber, helping to grow the ride-sharing platform’s user base and develop key growth strategies. Chen is also a prolific writer, sharing his insights on growth, technology, and startups through his popular blog and newsletter, which has attracted a loyal following in the tech community. His work has helped shape how many startups approach user acquisition, retention, and product-market fit. As a venture capitalist, Chen focuses on early-stage companies in the consumer internet, SaaS, and marketplace sectors, and he has been involved in funding and advising several successful startups. His insights on technology and growth continue to influence both founders and investors alike.

View Collection
Brad Feld's Book Recommendations

Brad Feld's Book Recommendations

Brad Feld is a prominent American entrepreneur, venture capitalist, and author known for his influential work in the startup ecosystem. Co-founder of the Foundry Group, he has played a pivotal role in funding and mentoring early-stage technology companies. Feld is also a key figure behind the Techstars accelerator program, which has helped launch numerous successful startups. As an author, he has penned several essential books on entrepreneurship and venture capital, including "Venture Deals" and "Startup Communities," which provide invaluable insights for aspiring entrepreneurs and investors. His writings and active blogging have cemented his reputation as a thought leader in the tech and startup communities.

View Collection
David Deutsch's Book Recommendations

David Deutsch's Book Recommendations

David Deutsch is a British physicist and philosopher, widely known for his contributions to quantum mechanics, particularly in the area of quantum computation. He is the author of The Fabric of Reality and The Beginning of Infinity, where he explores the nature of knowledge, progress, and the future of human civilization. Deutsch’s work in quantum computing laid the groundwork for the development of quantum algorithms, positioning him as a pioneer in this emerging field. He is a proponent of the multiverse theory and has offered profound insights into the nature of reality, science, and human potential. Deutsch’s philosophical work emphasizes the power of reason and creativity in solving problems and expanding human understanding. His ideas have had a significant impact on the fields of theoretical physics and epistemology, making him a leading thinker on the future of science and technology. He continues to inspire both scientists and lay readers with his optimistic vision of a world shaped by knowledge and innovation.

View Collection
Elon Musk's Book Recommendations

Elon Musk's Book Recommendations

Elon Musk is an influential entrepreneur and innovator known for founding and leading several groundbreaking companies, including Tesla, SpaceX, Neuralink, and The Boring Company. He has played a pivotal role in advancing electric vehicles, space exploration, and renewable energy. Musk's vision extends to colonizing Mars and reducing the risk of human extinction through space travel. In addition to his technological contributions, he has co-authored the book "Spacex: Making Commercial Spaceflight a Reality," providing insights into his ambitious projects and vision for the future. Musk's relentless pursuit of innovation continues to shape the trajectory of multiple industries.

View Collection
Max Levchin's Book Recommendations

Max Levchin's Book Recommendations

Max Levchin is a Ukrainian-American computer scientist and entrepreneur, best known as one of the co-founders of PayPal, where he served as the Chief Technology Officer. He has made significant contributions to the field of digital finance and technology innovation. Levchin also founded the consumer finance company Affirm, which aims to revolutionize the credit industry with transparent lending practices. Additionally, he co-authored several technical papers on computer security and has been a prominent advocate for tech entrepreneurship. His work has not only shaped digital payment systems but also influenced modern approaches to financial technology.

View Collection
Martin Shkreli's Book Recommendations

Martin Shkreli's Book Recommendations

Martin Shkreli is an American businessman and former hedge fund manager best known for his role in the pharmaceutical industry. He gained notoriety as the CEO of Turing Pharmaceuticals, where he infamously raised the price of the life-saving drug Daraprim by over 5,000%. Despite his controversial business practices, Shkreli has contributed thought-provoking writings on the ethics of pharmaceutical pricing and the healthcare industry. His articles and essays have sparked widespread debate and discussion in both academic and public spheres. Shkreli's complex legacy continues to influence conversations about drug pricing and corporate responsibility.

View Collection
Jeff Atwood's Book Recommendations

Jeff Atwood's Book Recommendations

Jeff Atwood is an American software developer, writer, and co-founder of Stack Overflow, the largest online community for developers to share knowledge and collaborate on coding problems. Atwood is also known for his influential blog Coding Horror, where he writes about programming, technology, and software development practices. His work on Stack Overflow has revolutionized the way developers learn and share information, fostering a collaborative, open-source culture within the tech community. Atwood’s contributions to software development have made him a key figure in the tech industry, particularly in developer education and open knowledge sharing.

View Collection
Delian Asparouhov's Book Recommendations

Delian Asparouhov's Book Recommendations

Delian Asparouhov is a venture capitalist at Founders Fund and co-founder of Varda Space Industries, a company focused on manufacturing in space. As a prominent figure in the tech and space industries, Asparouhov is known for his investments in innovative startups and his work in advancing space manufacturing technology. He is a strong advocate for pushing the boundaries of technology and has been vocal about the potential of space as the next frontier for industrial production. His work has made him a key player in the emerging space economy.

View Collection
Ev Williams's Book Recommendations

Ev Williams's Book Recommendations

Ev Williams is an American entrepreneur, best known as the co-founder of Twitter and Medium. Williams has a long history in the tech industry, having co-founded Blogger, one of the first blogging platforms, which was later acquired by Google. His work has significantly shaped online communication, giving people platforms to share their thoughts and ideas globally. Williams’ focus on simplicity and user experience has been a hallmark of his career. He continues to lead Medium, a platform that champions quality content and thoughtful discourse.

View Collection
Garry Tan's Book Recommendations

Garry Tan's Book Recommendations

Garry Tan is a prominent entrepreneur and investor, best known for his influential role in the technology and startup ecosystem. Co-founder of Initialized Capital, Tan has played a pivotal role in funding and mentoring numerous successful startups. His contributions to literature primarily include insightful writings on technology, entrepreneurship, and venture capital, which are widely read and respected within the industry. Tan's blog posts and essays offer valuable guidance and have inspired many aspiring entrepreneurs. Additionally, his work at Y Combinator, where he previously served as a partner, further underscores his significant impact on the startup community.

View Collection

Refactoring is about improving the design of existing code without changing its behavior.

Refactoring

By Martin Fowler

Frequently Asked Questions