Anti-Patterns

Summarized using AI

The Timeless Way of Building

John Athayde • March 17, 2014 • Earth

In the talk titled "The Timeless Way of Building," John Athayde explores the origins and significance of design patterns, beginning with their roots in architecture, particularly through the work of Christopher Alexander. He highlights that design patterns, commonly referenced in software development, mirror those in architectural design, offering frameworks for problem-solving across creative domains.

Key points discussed include:

- Definition and Structure of Design Patterns: Athayde describes patterns as systematic solutions to recurring problems, comprising a name, the problem to be addressed, the solution, and consequences of using the pattern.
- Influence of Christopher Alexander: Alexander's contributions to architecture laid the groundwork for understanding patterns. His books, particularly "A Pattern Language" and "The Timeless Way of Building," delve into how design principles can guide both architecture and software development.

- Architecture’s Historical Context: The talk references how architectural principles from the 17th and 18th centuries influenced modern design patterns, with examples from notable architects like Palladio and Jefferson, showcasing the evolution of design ideas while adhering to core principles.

- Practical Application in Software Development: Athayde emphasizes the application of architectural principles in software, demonstrating how understanding patterns can facilitate the creation of efficient and user-centered software structures.

- Anti-patterns: He also warns about the risks of misusing patterns without a solid understanding, which can lead to antipatterns—poor design choices that can negatively affect a project's outcome.

- Holistic Understanding of Design: The importance of grasping the underlying 'why' behind design patterns rather than simply following 'how' to implement them is reiterated, advocating for a holistic approach to design that stems from community understanding and knowledge.

In conclusion, Athayde encourages developers to engage with Alexander's works to foster deeper insights into design principles, ultimately leading to more thoughtful and impactful software creations. He invites further discussion on these concepts, recognizing the complexity and richness of the discourse around patterns and their application in both architecture and software development.

The Timeless Way of Building
John Athayde • March 17, 2014 • Earth

"Design patterns" is a common phrase that is often spoken in the course of design and development of web applications. But it's genesis is not from programming, but Architecture. They come from a trio of books in the 1970s by Christopher Alexander, the most famous of which is the middle book: "A Pattern Language". The issue arises that Pattern Languages, much like spoken languages, are most effective when the speaker is fluent.
We'll look at the origin of pattern languages and why they can be dangerous and even detrimental tools in the hands of the inexperienced designer and developer through examples of bad grammar and poor idiomatic choices(aka antipatterns), and perhaps some architecture as well.

Help us caption & translate this video!

http://amara.org/v/FG2J/

MountainWest RubyConf 2014

00:00:25.680 Hi everybody, I'd like to thank the Mountain West crew for having me here. I'd also like to thank Ernie Miller for swapping with me yesterday since I was delirious in bed with the stomach flu. I'm feeling so much better today. Today we're going to talk about the Timeless Way of Building.
00:00:39.040 A little background on me, just so you understand where I'm coming from: I actually have my master's in architecture, of the building variety—not of the software variety. I've been doing design and code since the HyperCard days. I currently do freelance design and front-end work through Meticulous, which is my own company. I'm also the head of design for Cargo Sense, a new startup that Bruce Williams, Rich Kilmer, myself, and about three other people are working on.
00:01:05.119 Bruce and I also wrote this book, The Rails View, which some of you may have read. If you haven't, we have a discount code. But I should mention that with the rise of all the JavaScript frameworks, the book is a little out of date now.
00:01:21.079 What we're going to cover today includes a discussion on patterns and what they mean. We're exploring the architecture of buildings and the origins of pattern languages in history. We will also look at anti-patterns from a software perspective and apply some of Christopher Alexander's theories to what we're doing, examining them from a new angle.
00:01:35.560 When we talk about patterns in software, what exactly do we mean? Many of you may have heard of the Gang of Four book, which is commonly referenced in this context. How many of you have seen it, read it, or used it? Okay, good. This book introduced many programmers to the concepts of patterns and pattern languages.
00:02:09.200 They define a pattern language as a structure that systematically names, motivates, and explains general designs that solve recurring design problems. A pattern language is made up of four parts: the pattern name, the problem it addresses, the solution (which details the components that make up the design, including their relationships and responsibilities), and the consequences, which explain what one gains or loses by using this pattern. The Gang of Four argue that design patterns help you identify less obvious abstractions and the objects that can be captured.
00:02:37.040 For example, objects that represent a process or algorithm don't necessarily occur in nature, but they are crucial for flexible designs. Back when the Gang of Four discussed these ideas, most programming was done with statically typed languages. A good example from their book is the iterator pattern.
00:03:06.239 Doing this in C++ or Java can be painful and time-consuming. However, in Ruby, many of these wonderful concepts have already been handled for us by Matz and the countless contributors to the Ruby codebase over the years, so we don’t have to deal with some of those painful patterns at the core level.
00:03:33.000 Now, let’s look at where these patterns come from. They're not about surface details like interior decorating; they originate from architecture. This is Christopher Alexander, an architectural theorist who has been influential for longer than I've been alive. He authored three well-known books, and today we'll focus on the first.
00:03:48.080 The Pattern Language, published in 1977, is 1,170 pages long. Brevity is not his forte, to say the least, but he dives deep into patterns as a sort of construction kit. The Timeless Way of Building, on the other hand, explores the origins of patterns and the reasons we utilize them.
00:04:11.139 One of Alexander's primary quests is how to distribute responsibility for design through various levels of a large hierarchy while maintaining consistency and harmony in the overall design. While he addresses architecture, this concept easily applies to software development and essentially any creative pursuit.
00:04:30.480 So how do we, as developers with disparate experiences, collaborate on code and move in the same direction? To illustrate, Alexander tried to design a college campus during the Oregon Experiment, considering how to accommodate the diverse needs of students and professors. Each of us has encountered certain use cases in our lives, but we can't possibly know every scenario, unless you have a magic time machine.
00:05:05.360 This limitation also applies to the often daunting task of understanding clients and customers. How can we engage deeply with that community and their needs? Simply delegating design to the end users usually doesn't yield good results, as they lack the expertise in software development or, in this case, architecture.
00:05:46.480 Some patterns can be challenging to grasp initially. For example, the concept of a transition space between the street and a front door aims to ease the abrupt transition from public to private space. The street represents the public realm, while the house is private. A transition space allows visitors to move into a semi-public area before accessing the private home.
00:06:08.680 However, when discussing this pattern, we don’t refer to it as a foyer or something similar. Instead, we think about the transition itself. The consequences of this design include potentially reducing available space on the street, as adding a stoop encroaches on the sidewalk.
00:06:44.080 Patterns themselves contain other patterns. This concept applies universally, from the overall layout of a town to the finer details of architecture. As we explore principles, we might realize that what we refer to as principles are actually patterns; for example, "Don't Repeat Yourself" is a well-known design pattern.
00:07:12.479 Thinking about other patterns, you may have heard of the Single Responsibility Principle—the idea that a class should only have one responsibility. Then you have the Open/Closed Principle, stating that software entities should be open for extension but closed for modification. The Liskov Substitution Principle indicates that objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
00:07:39.760 These principles can be combined into new principles. Alexander notes that general principles stem from more specific patterns, leading to a hierarchy of design decisions. Patterns themselves came from architectural traditions during the 17th and 18th centuries, particularly through the use of pattern books.
00:08:07.440 Pattern books were effectively an architect's portfolio, showcasing various sketches and structures they designed. For example, Robert and James Adam were prominent Neoclassical architects who published illustrations of structures they’d built, as photography wasn't readily available at the time.
00:08:48.360 As we progress, we transition from macro ideas to micro details. Looking at their work reveals that while different designs may not be identical, they often share similar characteristics and elements, applied in comparable ways. Andrea Palladio's four books on architecture were also crucial in shaping architectural thought, as seen in the Villa Cornaro he designed.
00:09:24.520 Thomas Jefferson's design for Monticello showcases some similarities but also key differences from Palladio’s work. Jefferson’s adaptation of classic elements reflects how architectural expressions evolve while still adhering to foundational principles.
00:09:55.360 While Palladio's architectural orders exemplify classical design, Alexander sought to abstract these ideas further, aiming to distill principles into more generic concepts. One of Alexander's central themes involves how light interacts within spaces.
00:10:33.480 For instance, consider the difference between light coming from two sides of a room versus one side. This shift dramatically alters the ambiance, creating stark contrasts with stronger shadows and distinct vibes throughout different times of the day.
00:11:10.280 Another example involves architectural details, such as Amish barns—historically built without formal architecture, where community knowledge would dictate construction. In those settings, individuals understood how to cooperate effectively, leading to practical, functional structures.
00:11:43.760 In modern contexts, we must translate this craftsmanship into software. Developers often pride themselves on being builders, akin to how architects approach their work. As Glenn Vanderburg insightfully noted, engineers often make significant decisions based on incomplete information.”
00:12:30.079 Patterns empower developers to draw from best practices available for problem-solving, although there's a common misconception that design patterns are plug-and-play solutions. Many mistakenly treat design patterns like templates, thinking they can apply them without deeper understanding.
00:13:30.000 Design patterns are merely guides that suggest approaches seen in real-world practice. The goal should not be to follow patterns blindly but to find eloquent solutions, similar to how a master chess player intuitively moves pieces instead of calculating every possible outcome.
00:14:18.560 As we explore the character of spaces that have no name, we must acknowledge that design patterns emerge from this larger framework of knowledge, context, and community understanding. Alexander emphasized this holistic approach, encouraging developers to perceive the underlying principles instead of only focusing on individual patterns.
00:14:54.600 Drawing from architectural principles enhances our ability to craft effective software, transcending mere technical skills. Therefore, I encourage you to read Alexander's works that provide deeper insight into the why behind these principles rather than merely the how.
00:15:14.560 Understanding this 'why' is essential as we navigate our software architectures and codebases. A well-rounded comprehension of design principles leads to creating software that resonates with its users while fostering a more profound appreciation for the craftsmanship involved.
00:15:41.040 Thank you for your attention. If you’re interested in the book, there’s a discount code available. We have about three minutes left, and I’d be happy to discuss any disagreements, ideas, or insights you'd like to share. There's so much written about these concepts, and I’d love to engage further on this topic.
Explore all talks recorded at MountainWest RubyConf 2014
+12