Topics

Featured in Development

Peter Alvaro talks about the reasons one should engage in language design and why many of us would (or should) do something so perverse as to design a language that no one will ever use. He shares some of the extreme and sometimes obnoxious opinions that guided his design process.

Featured in AI, ML & Data Engineering

Today on The InfoQ Podcast, Wes talks with Katharine Jarmul about privacy and fairness in machine learning algorithms. Jarul discusses what’s meant by Ethical Machine Learning and some things to consider when working towards achieving fairness. Jarmul is the co-founder at KIProtect a machine learning security and privacy firm based in Germany and is one of the three keynote speakers at QCon.ai.

Featured in Culture & Methods

Organizations struggle to scale their agility. While every organization is different, common patterns explain the major challenges that most organizations face: organizational design, trying to copy others, “one-size-fits-all” scaling, scaling in siloes, and neglecting engineering practices. This article explains why, what to do about it, and how the three leading scaling frameworks compare.

Martin Fowler Discusses New Edition of Refactoring, along with Thoughts on Evolutionary Architecture

Martin Fowler chats about the work he’s done over the last couple of years on the rewrite of the original Refactorings book. He discusses how this thought process has changed and how that’s affected the new edition of the book. In addition to discussing Refactors, Martin and Wes discuss his thoughts on evolutionary architecture, team structures, and how the idea of refactors can be applied in larger architecture contexts.

Key Takeaways

Refactoring is the idea of trying to identify the sequence of small steps that allows you to make a big change. That core idea hasn’t changed.

Several new refactorings in the book deal with the idea of transforming data structures into other data structures, Combine Functions into Transform for example.

Several of the refactorings were removed or not added to the book in favor of adding them to a web edition of the book.

A lot of the early refactorings are like cleaning the dirt off the glass of a window. You just need them to be able to see where the hell you are and then you can start looking at the broader ones.

Evolutionary architecture is a broad principle that architecture is constantly changing. While related to Microservices, it’s not Microservices by another name. You could evolve towards or away from Microservices for example

Show Notes

01:48 Fowler's motivation for writing the second edition was because the first edition was really starting to show its age, especially the code samples. Also, the Java samples tended to lead to class-centered and object-oriented patterns, but refactoring is not limited to object oriented languages.

02:30 Fowler hopes the new book will also remain relevant for 20-years, because refactoring is a really important skill for programmers to have. The new book is almost a complete rewrite.

03:10 The new edition uses JavaScript for the examples. This was mainly because it was high on the list of languages that many developers can understand.

03:55 Fowler is still a big fan of objects. Sometimes, you want to refactor towards objects, while sometimes you may refactor away from objects. JavaScript provides the ability to express some of those refactorings.

04:48 The core idea of refactoring hasn't changes: a sequence of small things allows you to make a big change. Many of those "small things" are still the same, such as Extract Function.

05:30 Fowler has put more emphasis on Split Phase, which is the idea of dividing complicated computation into two distinct phases, with a data structure between them. This was a refactoring that he had been doing, but didn't know what it was called until discussing the idea with Kent Beck.

06:30 Publishing of all kinds, not just of technical books, has been dramatically impacted by the Web since the first edition was published. Although he's focused a lot of attention on martinfowler.com, the book was an opportunity to cover a lot of ground in a cohesive way, which is not possible on a web site.

07:32 Beginning in 2015, Fowler wrote a series of essays about refactoring, available on his home page. These served as the foundation for the book.

08:25 The web edition of the book is the canonical edition of the book, available if you purchase the printed book. This will allow Fowler to provide continual updates as well as additional refactorings that didn't make it into the book.

10:30 Some of the online refactorings include Remove Dead Code and others that are just about moving data around. These are all useful, but can seem too trivial to be put in the book.

11:27 An important refactoring is replacing loops with collection pipelines. Because of how languages evolved, this is now much more common than it was in 2000.

13:14 The book tries to take the approach of Fowler pairing with the reader, and explain what he would be thinking and saying about the code. This even includes when to commit to version control, since the role of version control also evolved.

14:45 The first edition had UML diagrams, but these have been removed. In most cases, just showing the code is more valuable than UML, and fewer people use UML than in 1999.

16:45 The highest priority is to make code comprehensible. Graphical notation can be helpful, but should be a secondary goal.

18:00 Ralph Johnston had a metaphor about early refactorings being like cleaning the dirt off of a window -- you need them just to be able to see where you are. Then you can start looking at the broader refactorings. Josh Kerievsky covered this really well in the Refactoring to Patterns book.

19:15 Fowler's general approach to refactoring is breaking complicated things down into smaller pieces, which makes them easier to move them around and reorganize them.

19:58 In 2014, Fowler wrote an essay known as "You must be this tall to use microservices." Although his focus on the book hasn't allowed him to keep up with all the tools that are "providing a box to stand on," the fundamental prerequisites still apply.

21:20 In a monolith, you don't expect in-process calls to fail. But with microservices you acknowledge that and have to think through how to handle failed requests. The fundamental complexity of distributed programming will not go away, regardless of the tools available.

24:50Evolutionary architectures, much like Extreme Programming, is an idea that a design is always changing, and doesn't have to be fully defined before beginning work. You should design your architecture with that change in mind.

26:38 Following Conway's Law, acknowledge that your team structure and your architecture will both evolve, and try to evolve them in a compatible way. The Inverse Conway Maneuver is when you restructure your team in a way that will encourage your architecture to follow it.

28:00 Fowler is a big fan of product-oriented teams, focused on a business capability, and not in favor of technology-oriented teams, such as a front-end team and a back-end team.

30:25 Now that the book has gone to the publisher, there's still more work to do, especially on the online version of the book.

31:15 The book will be available on December 31, 2018, possibly earlier. A rough cut is available now through Safari.

More about our podcasts

You can keep up-to-date with the podcasts via our RSS Feed, and they are available via SoundCloud and iTunes. From this page you also have access to our recorded show notes. They all have clickable links that will take you directly to that part of the audio.