
Refactoring to Patterns
by Joshua Kerievsky · first published 2004
25mentions
15recommended by
22HN commenters
2009–2026first – last mentioned
68% recommend32% neutral
Why HN recommends it
Shows how to refactor existing code toward a goal pattern incrementally instead of over-engineering up front, tying together refactoring, TDD and design patterns; suits developers who have read Fowler's Refactoring.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.








…use IdentifiedSecurity when they could use Security; those are easily fixed on a case-by-case basis as needed. For more about incremental design, see Martin Fowler's _Refactoring,_ Joshua Kerievsky's _Refactoring to Patterns,_ or the "Incremental Design" chapter of my book (http://jamesshore.com/Agile-Book/incremental_design.html). You can also see me aggressively apply incremental design in my Let's Play TDD screencast,…
on “The Brittleness Of Type Hierarchies” ↗…Pragmatic Programmer (Hunt & Thomas) is the most all-around applicable and readable over a break. Of the rest, I'd recommend Refactoring (Fowler). Not on your list, but a good follow-on to Refactoring is Refactoring to Patterns (Joshua Kerievsky)
on “Ask HN: What software development book should I read over my winter break?” ↗…* Chaos: Making a New Science - James Gleick Programming: * Implementation Patterns - Kent Beck * Test-Driven Development, By Example - Kent Beck * Refactoring (both editions) - Martin Fowler * Refactoring to Patterns - Joshua Kerievsky * Practical Object Oriented Design - Sandi Metz * Functional Programming in Scala - Chiusano & Bjarnason * Growing Object-Oriented Software, Guided By Tests - Freeman & Pryce ("The…
on “Theory-building and why employee churn is lethal to software companies” ↗…the grocery store doesn't mean you should. I have seen my fare share of useless hard to understand and over engineered code in C, Groovy, Java and Lisp A good book about this by Joshua Kerievsky is Refactoring To Patterns he talks exactly about this, the dangers of using patterns and the dangers of not (yes he uses Java in his examples)
on “How (not) to write Factorial in Java” ↗…with some searching around for best practices for whatever specific framework/language/toolkit you are writing code with. Clean Code http://www.amazon.com/Clean-Code-Handbook-Software-Craftsman... Refactoring to Patterns http://www.amazon.com/Refactoring-Patterns-Joshua-Kerievsky/...
on “Ask HN: Recommended Books/Articles on clean code design.” ↗There's a great book called Refactoring to Patterns which I would suggest after GoF (and just overviewing the Refactoring book) http://www.amazon.com/Refactoring-Patterns-Joshua-Kerievsky/...
on “Ask HN: What's the best programming book you've read recently?” ↗not sure about "the best way", but besides the obvious cases ( factory, singleton ) i apply the Kerievsky's Refactoring To Patterns method. “Instead of thinking about a design that would work for every nuance of a system, test-first programming enabled me to make a primitive piece of behavior work correctly before evolving…
on “What is the best way to learn Design patterns and start applying them?” ↗Clean Architecture: A Craftsman's Guide to Software Structure and Design Refactoring to Patterns The Pragmatic Programmer
on “Ask HN: A Book or Course to Learn Code Quality/Structure?” ↗…Patterns (Gamma et al) - Site Reliability Engineering: How Google Runs Production Systems - Refactoring: Improving the Design of Existing Code (2nd Edition) (Addison-Wesley Signature Series (Fowler)) - Refactoring to Patterns - Patterns of Enterprise Application Architecture -Head First Design Patterns Building Extensible and Maintainable Object Oriented Software and I - https://www.youtube.com/watch?v=odxOPxYJdjg - "Architecture…
on “Ask HN: Must read applied system architecture articles?” ↗…Object-Oriented Design by Mauricio Aniche and Secure by Design by Dan Bergh Johnsson, Daniel Deogun, and Daniel Sawano. Both have a lot to offer in terms of software design and maintaining complexity. I also liked Refactoring to Patterns by Joshua Kerievsky.
on “How to Not Die by a Thousand Cuts. Or, How to Think About Software Quality” ↗An unsung hero for me is Refactoring to Patterns by Joshua Kerievsky. That one really shows how to tie it all together in my opinion.
on “Five Programming Books That Changed How I Think” ↗I would also add Refactoring to Patterns by Joshua Kerievsky.
on “The Programming Books That Meant The Most To Me” ↗Refactoring to Patterns by Joshua Kerievsky
on “Ask HN: What was a book that changed your life?” ↗…this is actually a skill, and unless you rewrite some of your own programs 5-10 times and compare their structure you won't learn it. I also recommend reading some classical books: SICP, Refactoring, Refactoring To Patterns, Effective Java, Programming Pearls. And the ultimate lessons come from maintaining your own code for a few years.
on “The Grep Test” ↗A lot of people misunderstand that book. Design Patterns reduce complexity when used correctly. A good book to understand that is Refactoring to Patterns http://industriallogic.com/xp/refactoring/. If you need your code to construct objects without knowing the type, then you need a factory (or other creation pattern). If you don't -- it's overkill.…
on “Ask HN: Suggested software /design/ books?” ↗