Continued Learning: The Beauty of Maintenance - Kent Beck - DDD Europe 2020

Domain-Driven Design Europe
12 Oct 202055:35

Summary

TLDRIn this insightful keynote, the speaker reflects on their first encounter with Domain-Driven Design (DDD), sharing anecdotes from the dot-com era. They delve into the nuances of software design, focusing on the importance of coupling and cohesion in maintaining a manageable codebase. The speaker emphasizes the need to make change easy by altering system structures to facilitate behavior changes, advocating for short feedback loops and the DDD community's role in promoting adaptive and responsive design practices.

Takeaways

  • 🎤 The speaker emphasizes the importance of public speaking and overcoming nervousness by reframing physical sensations as excitement rather than anxiety.
  • 📚 The speaker reflects on their first encounter with Domain-Driven Design (DDD) and the evolution of their understanding of DDD principles over time.
  • 🔄 The discussion highlights the concepts of coupling and cohesion in software design, noting that these terms are often used with varying interpretations.
  • 🔗 The original definition of coupling is presented as a relationship between software elements where a change in one necessitates a change in another.
  • 💡 The speaker introduces the idea of using the 'parallel change' pattern to manage changes in systems with high coupling, allowing for staged updates.
  • 📈 The cost of software development is likened to the cost of change, with coupling being a significant factor in the expense of making updates to a system.
  • 🔍 The speaker discusses the subtleties of coupling, including unexpected forms of coupling that can arise in complex systems.
  • 📦 Cohesion is described as the degree to which sub-elements within a single element must change together, promoting a more manageable change process.
  • 👷‍♂️ The speaker advocates for making changes easy by adjusting the system's structure to facilitate future behavior changes, a concept they relate to the 'tidy first' approach.
  • 🔁 The script touches on the cyclical nature of software development, where behavior changes lead to more behavior changes, influenced by the underlying system structure.
  • 🚫 The speaker warns against the resurgence of waterfall-style development, advocating for the DDD community to uphold principles of feedback and iterative design.

Q & A

  • What is the main theme of the speaker's keynote at the conference?

    -The main theme of the speaker's keynote is exploring the concepts of coupling and cohesion in software design, and how these concepts relate to the cost of change in software development.

  • Why did the speaker choose such a generic title for his talk?

    -The speaker chose a generic title so that he could adapt the content of his talk based on the conversations and interactions he had with people at the conference.

  • What was the speaker's first introduction to Domain-Driven Design (DDD)?

    -The speaker's first introduction to DDD was through working with Eric Evans in 2000 on a project during the dot-com era, which involved planning for retail purchasing.

  • How does the speaker relate the concept of performance anxiety in music to public speaking?

    -The speaker uses the concept of performance anxiety in music to illustrate that the physical sensations of nervousness can be reframed as excitement, which can help in overcoming stage fright during public speaking.

  • What is the original definition of coupling as discussed in the 'Green Book' of structured design?

    -In the 'Green Book', coupling is defined as the degree to which a change in one element (such as a variable, function, or module) necessitates a change in another element.

  • What is the relationship between coupling and the cost of change in software?

    -The cost of change in software is closely related to coupling; the higher the coupling, the more likely changes will propagate and increase the cost of making those changes.

  • What is the speaker's view on the resurgence of waterfall-style development?

    -The speaker views the resurgence of waterfall-style development as a step back, despite it being practiced by smart people trying to solve real problems. He emphasizes that it doesn't work because it lacks the necessary feedback loops.

  • How does the speaker suggest separating behavior changes from structural changes in software development?

    -The speaker suggests separating behavior changes from structural changes by making them in different pull requests (PRs). This allows for different standards to be applied to reversible (structural) and irreversible (behavioral) changes.

  • What is the significance of the speaker's slogan 'Make change easy, then make easy change'?

    -The slogan emphasizes the importance of structuring the system in a way that facilitates easy changes. It suggests that developers should focus on making the process of change easy before implementing the changes themselves.

  • What is the '3x model' mentioned by the speaker and how does it relate to innovation?

    -The '3x model' stands for Explore, Expand, and Extract. It is a model the speaker observed at Facebook to describe how innovation happens, and it suggests a cycle of exploration, growth, and refinement in the development process.

Outlines

00:00

🎤 First DDD Conference Experience

The speaker expresses excitement about attending their first DDD (Domain-Driven Design) conference, reflecting on their initial encounter with DDD through a project with Eric Evans in 2000 during the dot-com era. They delve into the complexity of retail purchasing planning and share their experience of the dot-com crash. The speaker also discusses their approach to public speaking, drawing a parallel between stage fright and the anticipation of giving a keynote, highlighting the importance of reframing nervousness as excitement.

05:00

🎼 Overcoming Performance Anxiety

The speaker shares insights on dealing with performance anxiety, inspired by their background in music and a book titled 'The Soprano on Her Head.' They discuss an exercise from the book that involves recognizing the physical sensations associated with nervousness and excitement, suggesting that the perception of these sensations as nervousness is a choice. The speaker recalls a memorable instance from 1987 when they reframed their nerves into excitement before presenting with Ward Cunningham, which helped them overcome their anxiety.

10:01

🔍 The Essence of Coupling and Cohesion

The speaker delves into the concepts of coupling and cohesion, emphasizing their importance in software design and how they are often misunderstood. They recount their experience on a panel celebrating the 30th anniversary of 'Structured Design,' also known as the green book, which introduced these concepts. The speaker clarifies the original definitions of coupling and cohesion, explaining that coupling refers to the necessity of changing one element when another changes, while cohesion pertains to the interrelatedness of sub-elements within a larger element. They advocate for returning to these precise definitions to improve communication and understanding in software design.

15:01

🔗 Understanding Coupling in Software Design

The speaker provides a detailed explanation of coupling in software design, using the original definition that relates coupling to the necessity of making a change in one element requiring a change in another. They discuss the implications of coupling for the cost of software maintenance and how reducing coupling can decrease the cost of changes over time. The speaker also introduces a practical example of how changing a parameter name in one service can necessitate changes across multiple services, creating a distributed monolith and the challenges that come with it.

20:05

🛠 Techniques for Managing Change in Software

The speaker introduces a design pattern called 'parallel' to manage changes in software systems, which involves introducing a new element alongside the existing one to avoid the need for simultaneous changes across multiple services. They discuss the importance of staging changes to avoid deploying all modifications at once, which can be challenging. The speaker also touches on the broader life lesson that change often gets worse before it gets better, emphasizing the importance of embracing this process in software design.

25:05

💡 The Impact of Coupling on Change Cost

The speaker explores how coupling affects the cost of change in software development, explaining that the cost is often tied to the cascading effect of changes due to high coupling. They liken the distribution of change costs to a power law, where most changes are small and inexpensive, but a few are large and very costly. The speaker emphasizes the importance of reducing coupling to manage these extreme costs and to maintain the ability to evolve software systems over time.

30:06

🌐 Unseen Couplings and Design Principles

The speaker discusses the subtle and often unseen couplings in software systems, using an example of two services inadvertently coupled through a shared network switch. They highlight the importance of design principles that can help reduce such couplings, such as avoiding global state and being explicit about data flow. The speaker also introduces the concept of cohesion in relation to coupling, explaining how a cohesive element contains sub-elements that are all likely to change together, which can be beneficial in managing changes.

35:11

🔍 The Challenge of Cohesion and Coupling in Large Systems

The speaker addresses the challenge of managing cohesion and coupling in large-scale systems, such as those found at Facebook or Gusto. They discuss the difficulty of identifying what to decouple in a large system and the high cost of doing so. However, they also highlight the benefits of improving cohesion, which can be achieved by grouping elements that change together into their own elements, making it easier to manage changes locally without needing to understand the entire system.

40:12

🤔 The Tidy First Approach to Software Design

The speaker introduces the concept of 'tidy first,' where they advocate for improving the structure of the code before making behavioral changes. They argue that making changes easy should be the priority, followed by making the easy changes. The speaker suggests that programmers often focus on the immediate change rather than preparing the system to accommodate future changes easily. They propose a recursive approach to making changes easy by considering the system's structure and how it can be altered to simplify future modifications.

45:12

🔄 The 3x Model: Explore, Expand, Extract

The speaker presents a model for innovation that they observed at Facebook, which they call 'Explore, Expand, Extract' (3x Model). They discuss the resurgence of waterfall-style development and criticize its ineffectiveness, despite being adopted by smart people trying to solve real problems. The speaker emphasizes the importance of feedback loops and the need to avoid long feedback cycles, suggesting that the DDD community is well-positioned to counteract the tendency towards waterfall development by insisting on shorter feedback loops and iterative refinement.

50:13

⚠️ The Resurgence of Waterfall Development

In the concluding remarks, the speaker warns against the resurgence of waterfall development, which they describe as a cycle that needs to be stopped. They express concern over the return of long feedback cycles and the lack of shame associated with having large specifications without feedback. The speaker calls for the DDD community to leverage its analytical strengths to resist this trend and to advocate for shorter, more iterative feedback loops to ensure that software development remains adaptive and responsive to change.

Mindmap

Keywords

💡DDD (Domain-Driven Design)

Domain-Driven Design (DDD) is a software development methodology that emphasizes the importance of the domain model, the model of the subject area of the problem space, in the design and implementation of software. In the video, the speaker reflects on his first encounter with DDD and its influence on his approach to software design, highlighting the community's evolution and practice over the past 20 years.

💡Coupling

Coupling refers to the degree of direct dependence between software modules; a measure of how interconnected they are. The script discusses the original definition of coupling from structured design and its importance in software design to reduce the cost of change. The speaker uses examples from his experience to illustrate how changes in one part of a system can necessitate changes in another, affecting the system's maintainability.

💡Cohesion

Cohesion is the degree to which the elements inside a module or component are related to each other. The video script explains that high cohesion means that if one element changes, all related elements must change together, which can simplify the process of making changes. The speaker contrasts coupling and cohesion, emphasizing the value of reducing the former and increasing the latter for better software design.

💡Change Management

Change management in the context of the video refers to the strategies and practices for dealing with modifications in software systems. The speaker discusses the cost of change and how it is closely tied to the concepts of coupling and cohesion. By managing how changes are made, particularly through reducing coupling and increasing cohesion, the impact and cost of future changes can be minimized.

💡Public Speaking

Public speaking is the act of performing a speech to an audience, which is a skill the speaker discusses in relation to handling nervousness and framing emotions. The video script shares a personal anecdote about the speaker's approach to public speaking, using the concept of excitement over nervousness to manage performance anxiety, which serves as a metaphor for handling challenges in software design.

💡Feedback Loops

Feedback loops are the process of receiving and incorporating responses back into the development cycle. The speaker criticizes the resurgence of long feedback loops, akin to waterfall development, and emphasizes the importance of short, iterative feedback to adapt to changes and improve outcomes. The video encourages the use of feedback to inform design decisions and avoid the pitfalls of rigid, long-cycle development.

💡Waterfall Model

The waterfall model is a traditional software development process that moves sequentially from one phase to the next without iteration. The script points out the resurgence of this model despite its known limitations, such as the inflexibility to changes and the lack of early feedback incorporation. The speaker calls for the DDD community to counteract this trend by advocating for more agile, feedback-driven practices.

💡Design Patterns

Design patterns are reusable solutions to common software design problems. The speaker mentions his work with Eric Evans and the development of design patterns in the late 1980s. The script uses design patterns as an example of how the speaker and his colleagues approached complex problems in software design, emphasizing the importance of reusability and modularity.

💡Refactoring

Refactoring is the process of restructuring existing computer code without changing its external behavior to improve nonfunctional attributes of the software. The video script describes a student's refactoring process, illustrating how creating cohesive elements can simplify the task of making changes and highlight the importance of this practice in software maintenance.

💡Software Maintenance

Software maintenance involves modifying a software system after it has been delivered to correct faults, improve performance, or add functionality. The speaker discusses the high costs associated with software maintenance, particularly due to the cascading effects of change when coupling is high. The script emphasizes the need for design practices that reduce these costs over time.

💡Tidy First

The concept of 'tidy first' suggests improving the structure of the code before making functional changes to simplify the process. The speaker introduces this idea in the context of writing a book and discusses it as a strategy to make future changes easier. The script uses this concept to highlight the importance of considering the system's structure in software design and development.

Highlights

Introduction to the speaker's first DDD conference and their initial exposure to DDD concepts in 2000.

The speaker's reflection on the intersection of their work and DDD, and how they have been informed by DDD without strictly following it.

The importance of public speaking and overcoming performance anxiety by reframing nervousness as excitement.

The concept of coupling and cohesion in software design, and their foundational role in the work of software designers.

The original definitions of coupling and cohesion from the 'Structured Design' book and their precision in describing maintainable software.

The evolution and misuse of the terms 'coupling' and 'cohesion' over time, leading to confusion in the software community.

The practical implications of coupling on the cost of software maintenance and the importance of decoupling to reduce change costs.

A real-world example of service coupling through parameter names and the challenges it presents for making changes.

The 'Parallel Change' pattern as a method to decouple services and manage changes without simultaneous deployments.

The subtle nature of coupling and the potential for unexpected 'action at a distance' effects in complex systems.

Strategies for reducing coupling, such as avoiding global state and being explicit about data flow in code.

The definition of cohesion and its role in reducing the scope of coupling by grouping elements that change together.

The benefits of creating cohesive elements for easier maintenance and the practice of 'cohesivating' code for clarity.

The distinction between 'lumpers' and 'splitters' in design philosophy and the speaker's preference for smaller, interacting pieces.

The importance of making structural changes before behavior changes to facilitate easier future modifications.

The '3X Model' of explore, expand, extract as a framework for understanding innovation in software development.

A critique of the resurgence of waterfall-style development and the need to counteract long feedback cycles with shorter, iterative processes.

The unique opportunity for the DDD community to advocate for shorter feedback loops and iterative development practices.

Transcripts

play00:00

[Music]

play00:13

thank you very much

play00:15

it's very bright up here in case uh you

play00:18

didn't uh

play00:19

pick that up right away i'm i'm so glad

play00:22

to be here

play00:23

uh i have this is my first ddd

play00:26

conference of

play00:26

any sort i was reflecting

play00:30

on my uh i

play00:33

sort of my world and the ddd world sort

play00:36

of bump into each other but

play00:37

uh but don't really overlap a whole lot

play00:40

i was thinking about

play00:42

when i first heard about ddd

play00:45

um i had actually worked with eric

play00:48

uh in 2000 um

play00:52

and i'm not going to ask who here was

play00:53

born in 2000 because it'd be too

play00:55

depressing

play00:57

um and we we worked on a project

play01:01

that also included some other uh

play01:03

notables this was the the whole dot-com

play01:05

era when we were all going to get rich

play01:08

didn't didn't happen um

play01:12

and uh it was a interesting domain

play01:16

the domain was uh planning for retail

play01:18

purchasing which

play01:20

it's one of those things where you say

play01:22

how many times have i said this as a

play01:23

programmer

play01:24

how complicated can that be and the

play01:27

answer is always

play01:28

is really complicated but

play01:32

uh the team and and eric included really

play01:34

dug

play01:35

into what it meant to do a better job of

play01:38

retail purchasing

play01:40

and then the dot com crash happened and

play01:42

everybody scattered to the winds

play01:44

but that was the first introduction that

play01:46

i had to it and then when the book

play01:48

came out i read it and

play01:52

thought hmm interesting ideas it's a

play01:54

little different than my

play01:56

approach to it but i'll be informed by

play01:58

this in the future but i've never been a

play02:00

follower or an applier of ddd

play02:03

like straight out of the book so it was

play02:05

interesting to get

play02:07

for me to get this invitation and have a

play02:09

chance to come and see

play02:11

what had happened to the community and

play02:13

the community of practice

play02:16

over over the past 20 years

play02:22

extreme programming uh has its own

play02:25

community practice it's also

play02:27

grown and adapted um i had a

play02:30

conversation with eric

play02:31

a couple of days ago about our different

play02:34

approaches

play02:34

to our community so he has stayed very

play02:37

involved

play02:38

i've kind of pulled back and done other

play02:40

things

play02:42

and uh so it's not often you get a

play02:44

chance to talk to somebody

play02:47

in in that similar kind of situation

play02:49

having started something

play02:50

having seen a big community grow and

play02:52

well how do you manage that

play02:55

as somebody who likes to start stuff

play02:58

and isn't so good at finishing things

play03:00

that would be me

play03:02

so um when i got the invitation

play03:05

to come and speak i thought what in the

play03:08

world am i going to

play03:09

uh to talk to you folks about i thought

play03:12

i know what i'm gonna do

play03:14

i'm gonna have a title that's so generic

play03:17

that i could fit

play03:18

absolutely anything into it

play03:21

and then i'll just go talk to people and

play03:24

i'll see

play03:24

what it is i think i need to say given

play03:28

the people that i've talked

play03:29

to and so that's what i'll be doing um

play03:32

i don't i can't you'll see in a second i

play03:34

hand draw my slides i don't have

play03:35

prepared slides so

play03:37

i have an opportunity to kind of come up

play03:40

with

play03:40

things in the moment which i really

play03:42

appreciate and uh

play03:44

i hope that you will too and and if you

play03:47

don't

play03:47

you'll probably tell me about it so

play03:49

that's okay

play03:50

so um first thing i wanted to share

play03:54

was uh it's not about programming at all

play03:57

it's about

play03:58

public speaking somebody asked me in the

play04:01

elevator this morning

play04:03

are you getting nervous about giving

play04:05

your keynote

play04:06

and i said well i wasn't until you asked

play04:08

me

play04:10

so no that's not what i said it's not

play04:14

true but it would be a really good

play04:16

response

play04:17

so no what i said was uh um

play04:21

no not really but there's actually more

play04:24

to this story

play04:25

there's a reason that i don't get

play04:27

nervous when i speak

play04:29

when i was in college the american

play04:31

school system is

play04:33

weird like everything american but one

play04:36

of the things about it is you don't get

play04:38

stuck in a track i think there are

play04:40

educational systems where

play04:42

very early you decide what you're going

play04:44

to study and that's the one thing that

play04:45

you study and you

play04:47

stay focused on it in america is a

play04:49

little loosey-goosey so

play04:52

my first year i was a computer science

play04:54

student

play04:55

the second year i was a music student

play04:57

because of course

play05:00

and then i missed programming so then i

play05:01

was a computer science student and then

play05:03

i was a music student and i did my

play05:05

senior recital

play05:06

then i did my master's in computer

play05:08

science and i just ended on the wrong

play05:10

year

play05:11

so here i am speaking at a computer

play05:13

conference

play05:19

so one of the things about music though

play05:22

is you have to deal with performance

play05:24

anxiety everybody feels some anxiety

play05:27

around performance

play05:28

and uh there's a beautiful book called

play05:31

the soprano on her head

play05:34

about dealing with performance anxiety

play05:36

and the

play05:37

the story from the title is a there was

play05:40

a soprano

play05:41

had a beautiful voice had so much

play05:43

anxiety she just couldn't sing anymore

play05:45

so the

play05:46

teacher had her stand on her head and

play05:48

sing

play05:50

and it was just beautiful again like all

play05:52

of the

play05:53

anxiety went away of course she couldn't

play05:55

do that on stage because that would

play05:56

really look weird but

play05:58

it was it was it's like a an example

play06:01

like no you

play06:02

you can still sing that's the as a

play06:05

musician you're like

play06:06

maybe my fingers won't work this time or

play06:08

something like that

play06:09

they usually do so that's okay but there

play06:12

was an exercise in that book

play06:14

and it went like this it said imagine

play06:16

yourself going up on stage

play06:19

and performing now take an inventory of

play06:22

your physical sensations at that moment

play06:25

your stomach's queasy your palms are

play06:27

sweaty

play06:29

your breathing is up in your chest and

play06:31

shallow

play06:33

okay so that's what that's what

play06:35

nervousness feels like right

play06:37

now imagine yourself christmas morning

play06:41

as a kid you're about to go in and open

play06:44

the presents

play06:46

imagine that moment and take an

play06:48

inventory of your

play06:49

physical sensations at that moment

play06:52

your palms are sweaty your stomach's a

play06:54

little queasy

play06:55

you're breathing shallow high up in your

play06:58

chest

play06:59

and you're excited so

play07:03

the same sensations you say well i'm

play07:06

feeling

play07:07

nervous that tag of nervousness applied

play07:11

to those sensations

play07:12

is a choice that you make and you could

play07:15

say

play07:17

i'm excited at that moment now then i

play07:20

remembered

play07:21

the first time we ever uh ward

play07:23

cunningham and i ever presented about

play07:25

patterns

play07:26

1987 we're in a workshop

play07:30

um we had done our first experiments

play07:34

with patterns

play07:34

things had gone exceedingly well we had

play07:37

a little write-up

play07:38

and i was gonna get up and present and

play07:40

around the table were

play07:41

all the heavy hitters of the day

play07:44

grady booch was there a very young

play07:46

jeanette wing was there adele goldberg

play07:49

and i was just getting nervous as i'll

play07:52

get out my

play07:53

my time slot was in the afternoon of

play07:55

course so i had

play07:56

all day and i remember about mid-morning

play08:00

i was just getting exhausted because i

play08:02

was

play08:03

i was feeling so so nervous

play08:08

and then i remembered this book and i

play08:11

said to myself

play08:12

i am really excited

play08:17

and the the negative experience of all

play08:20

of those

play08:21

physical sensations just went away

play08:24

i and it was just a change of my frame

play08:27

so in answer to the elevator question

play08:32

are you nervous no i'm excited

play08:35

i feel some of the same sensations as

play08:38

when i feel nervous

play08:40

but i just choose to frame them as wow

play08:42

i've got something to talk to you about

play08:44

that i really want to talk to you about

play08:46

so now if you don't

play08:50

care at all about the technical content

play08:53

i've just given you something that you

play08:55

can take away and use regardless of

play08:57

of what else it is that you do you're

play08:59

welcome

play09:05

okay on to the geeky stuff

play09:09

so here's what i noticed

play09:12

most about the conversations that i've

play09:14

had over the last couple of days

play09:17

there are a lot of people talking about

play09:21

coupling and cohesion yeah

play09:24

important concepts really the foundation

play09:27

of the work we do as software designers

play09:31

but the other thing i noticed is

play09:34

everybody means something a little bit

play09:37

different

play09:38

when they say coupling and cohesion

play09:40

sometimes it's a big concept

play09:42

comes out of a small concept it goes in

play09:43

slightly different directions

play09:46

maybe 10 years ago i was on a panel

play09:50

celebrating the 30th anniversary of the

play09:53

publication

play09:54

of structured design the green book how

play09:57

many people have read structured design

play10:01

okay cool the rest of you are in for a

play10:05

treat

play10:06

this is a book that ed jordan

play10:10

uh a blessed memory and larry

play10:12

constantine had written

play10:14

describing their experience with a whole

play10:16

range of software

play10:18

written in the early days of programming

play10:20

they what they did was they looked at

play10:22

the software and they said

play10:24

uh of the programs that were hard

play10:27

to change what features do they have in

play10:31

common and of the programs that were

play10:33

easy to change

play10:34

what features did they have in common

play10:36

can we see any patterns

play10:39

in how the software is constructed and

play10:41

the answer was

play10:42

yes and they came up with these concepts

play10:45

coupling and cohesion

play10:48

just to describe the common properties

play10:50

of programs

play10:51

that are cheap to change now back in the

play10:55

early early days

play10:57

the thought was that we would build

play10:59

programs

play11:00

and then just run them like uh

play11:02

manufacturing you build a car

play11:05

yeah maybe there's a little bit of

play11:06

maintenance but you don't like rebuild

play11:08

the car

play11:09

now it turned out the software wasn't

play11:11

like that we fought against that for a

play11:12

long time

play11:14

you know people would say i remember the

play11:16

breathless we spend

play11:18

70 percent of our development budget on

play11:20

maintenance

play11:21

isn't that awful doesn't that show what

play11:23

a horrible job we're doing

play11:25

and that's true if you had a car and you

play11:27

spent seventy percent

play11:29

thirty percent buying the car and

play11:31

seventy percent maintaining it

play11:33

you would not be a very good car but the

play11:35

thing about software is

play11:37

the very uh presence of the software as

play11:41

soon as the software comes into being

play11:44

the needs that it addresses change

play11:48

so by its very nature software changes

play11:52

itself you know you people see

play11:56

some feature and they say oh i'd like

play11:57

this other feature too they would

play11:59

never have thought of that until they'd

play12:00

seen that first feature

play12:02

that was a big surprise so

play12:06

these concepts of coupling and cohesion

play12:09

were laid out very precisely

play12:12

in the green book the structured design

play12:16

book now

play12:16

i had had structured design as a

play12:19

textbook when i was in college

play12:22

and so when i went to sit on this panel

play12:25

i

play12:26

realized that i should actually read the

play12:28

green book

play12:29

for the first time because you know it

play12:31

was a college text it's not like i read

play12:33

it

play12:35

so i read it and i was just i was so

play12:39

excited i mean there's some weird stuff

play12:41

in there like a

play12:42

very thoughtful discussion about

play12:44

assembly language versus higher level

play12:46

languages

play12:47

you know which was an open question at

play12:49

that time

play12:50

and and something about punched cards

play12:53

and paper tape and i'm like

play12:55

so that part aged

play12:59

quickly but the part that didn't age

play13:02

at all was were these concepts of

play13:04

coupling and cohesion and the

play13:06

definitions are very precise in that

play13:09

book

play13:09

since then we've come up with other uses

play13:13

for those words so what i'd like to do

play13:16

is go back to those original definitions

play13:18

and say here's

play13:20

a meaning here's a concept

play13:23

of coupling in this very particular way

play13:26

i'm talking about it

play13:28

and and you can apply whatever word you

play13:31

want to

play13:33

to to it but that concept is really

play13:36

valuable and important

play13:38

so we should separate that i think this

play13:40

is the

play13:41

message i bring to you separate that

play13:43

concept from other concepts that we may

play13:46

also apply the word coupling to

play13:48

we should probably find other words for

play13:50

those things because this thing i'm

play13:52

talking about is very important

play13:55

and worth focusing on as a designer

play13:59

so uh

play14:02

first software is built out of elements

play14:06

and when i say element i mean things at

play14:09

all different scales

play14:11

so variables or elements and statements

play14:14

or elements and expressions or elements

play14:16

and functions and classes and modules

play14:20

and services all these things are

play14:22

elements repositories are elements

play14:26

so when i say

play14:29

i have two elements a and b

play14:32

and i say that they're coupled what does

play14:34

that mean

play14:37

so it means

play14:40

that if i change a

play14:43

i also have to change b

play14:47

so here's the in in something that looks

play14:49

a little more like a

play14:51

a mathematical notation

play14:56

a and b are coupled with respect to a

play14:59

particular change

play15:01

so coupling is always with respect to a

play15:03

particular change

play15:06

if changing a

play15:09

implies changing b

play15:13

that's the original definition of

play15:14

coupling

play15:16

so if if i have two services and one

play15:19

service calls the other

play15:20

those services are not coupled by this

play15:22

definition they have some relationship

play15:25

and we should have a word for that

play15:26

relationship but it's not coupling

play15:29

unless changing one service means that

play15:32

we have to change the other service

play15:34

too in order for the system to stay in a

play15:38

in a working state

play15:41

so an example that came up yesterday in

play15:45

conversation was

play15:48

here i have a service it takes in some

play15:56

some parameters and there's a parameter

play15:58

a

play15:59

and a parameter b and i want to change

play16:01

the name of b

play16:02

to c but i pass

play16:06

this to another service that expects

play16:08

parameters a

play16:10

and b and connects it i think the number

play16:12

that was quoted to me was seven

play16:14

this thing is passed through seven

play16:17

layers of services

play16:18

all of which expect the names to be

play16:20

sorry a

play16:21

and b

play16:25

so these services are coupled with

play16:28

respect

play16:29

to name changes of the

play16:32

parameters i can i can go

play16:36

inside of a service i can go inside this

play16:38

service and make all the changes i want

play16:41

as long as i don't change the name of

play16:42

the parameters neither the other

play16:44

services have to change

play16:47

so uh for those kind of changes there

play16:51

the services aren't coupled but for

play16:54

purposes of

play16:55

of these names that they are coupled

play16:58

and the complaint was wow if i have to

play17:01

change one

play17:02

then i have to change all of them and my

play17:05

best

play17:05

bet is then i have to deploy all the

play17:07

services at exactly the same time and

play17:10

make sure there aren't any requests

play17:12

in flight so

play17:15

like it and you you have a distributed

play17:17

monolith

play17:19

which is worse than a monolith

play17:22

um so how would you

play17:26

how would you go about making this kind

play17:28

of change so

play17:31

in my kind of design world i use a

play17:34

pattern called parallel where you have

play17:37

briefly you have

play17:38

two implementations of the same thing so

play17:41

if i want to change b to c

play17:44

i'm going to add a c here and make sure

play17:46

that always contains the same value as b

play17:50

now i can deploy this nobody else is

play17:52

looking for c so they don't care

play17:55

then i can add

play17:58

c here and now i can start using c

play18:03

because i know it has exactly the same

play18:06

thing as b

play18:08

and as soon as i'm done with that as

play18:10

soon as i know that this service doesn't

play18:12

use b

play18:12

anymore to read it i can stop passing it

play18:17

then i can make this change too so i

play18:20

don't actually have to deploy

play18:22

all of these changes at exactly the same

play18:24

time

play18:26

by going through a little bit of this uh

play18:29

making things worse and then making them

play18:31

better

play18:32

i have a chance to uh decouple the ch

play18:35

changes i can stage the the changes

play18:41

so that's a trick that always seems to

play18:43

bother a lot of people

play18:44

because it makes things worse i have

play18:47

duplication i have more duplication

play18:49

and then it makes things better but

play18:52

there is

play18:52

another life lesson for you rule number

play18:55

one is

play18:56

things always get worse before they get

play18:58

better and rule number two is you can

play19:01

you can do it that's uh so

play19:06

i thought this was going to be a

play19:07

programming talk with some

play19:09

little life lessons and it may be the

play19:11

other way around by the time we're done

play19:13

but we got a half an hour so let's see

play19:14

what happens

play19:17

okay so that's coupling coupling means i

play19:20

have these two

play19:21

elements if i change this one i have to

play19:23

change that one too

play19:26

why is that important it's important

play19:28

because

play19:30

uh cost the cost of software

play19:35

is roughly equivalent to the cost

play19:38

of change

play19:41

that's that observation about we spend

play19:44

most of the money in software

play19:45

development on maintenance

play19:48

which is just in the xp world we took

play19:51

this

play19:51

entirely all the way and said instead of

play19:54

spending

play19:55

70 on maintenance what if we spent 99 on

play19:58

maintenance that seems like a good

play19:59

number

play20:01

we'll just get it in production and then

play20:04

build it up from there and then we're

play20:08

mostly making changes but

play20:10

the cost of change all changes don't

play20:13

cost the same amount

play20:15

the cost of change is approximately

play20:18

equal and i'll explain why in just a

play20:19

second

play20:20

to the cost of big changes

play20:26

and what do i mean by big changes

play20:31

if you made a histogram of the cost of

play20:35

changes this is the count of the number

play20:38

of changes that you make

play20:40

and this is the cost

play20:43

that's supposed to be a euro sign

play20:47

the minus of handwriting slides is my my

play20:50

drawing handwriting sucks so

play20:54

oh well so if we make a histogram what

play20:57

it's going to look like

play20:58

is this

play21:02

we're going to have lots and lots of

play21:05

little changes that are cheap and we're

play21:07

going to have a few

play21:09

changes that are really expensive what

play21:11

are those

play21:12

what's the nature of those changes

play21:15

here's where coupling

play21:16

as defined just here is really helpful

play21:20

what makes changes really expensive is

play21:23

not

play21:24

just the change it's i change this

play21:27

so i have to change those so i have to

play21:30

change

play21:30

those so i have to change those

play21:33

it's this cascading effect now if you

play21:37

looked at complexity theory

play21:39

you're going to recognize a power law

play21:40

distribution here

play21:43

and it's the exact same mechanism

play21:46

as causes avalanches and hurricanes

play21:49

you know most avalanches is is just one

play21:52

snowflake

play21:53

falls over and that's it and nothing

play21:55

else happens

play21:57

but there's a non-zero chance that one

play21:59

snowflake falling over is going to cause

play22:01

two more snowflakes to fall over

play22:03

and each of those has a non-zero chance

play22:06

of causing two more

play22:07

and more and more so if you make a

play22:10

histogram of the size of

play22:12

avalanches most of them are just going

play22:13

to be one snowflake

play22:15

falling over and that's that and there's

play22:17

a bajillion of those

play22:18

happening all the time and you don't

play22:20

really notice

play22:22

but you notice the one that comes

play22:23

sweeping through the village

play22:25

and wipes everything off the map and

play22:28

those happen

play22:29

every once in a while the more changes

play22:32

the more extreme both of the ends of

play22:35

this are going to be

play22:38

so when we have way more changes we're

play22:41

going to have many many more small

play22:43

changes

play22:44

and the most expensive change is going

play22:46

to be much much more expensive

play22:50

in software what conducts

play22:54

the cost of of a change is exactly

play22:58

coupling

play23:00

if a and b are coupled then when i

play23:02

change a i have to change b

play23:04

and if b is coupled to c and d then i'm

play23:07

going to have to

play23:08

change c and d and and and and and

play23:11

thing about power law distributions is

play23:14

a big percentage of the cost is in this

play23:17

tail

play23:18

even though this is a small number of

play23:21

changes

play23:22

in the absolute number the cost of that

play23:26

compared to the cost of all the rest of

play23:28

it that

play23:29

tail is really expensive so

play23:33

coupling is important because

play23:36

the less coupled your system is the less

play23:40

likely the changes are to propagate

play23:43

the less extreme the cost of these

play23:46

most expensive changes is

play23:49

the longer you can last uh

play23:53

continuing to change the software

play23:56

so that's where that

play24:00

definition of coupling gets us it's

play24:02

important because

play24:04

decoupling things reduces the cost of

play24:07

making changes

play24:08

over time a coupling can be uh

play24:12

can be quite subtle uh i was at facebook

play24:16

for seven years if you feel the need to

play24:18

blame me for

play24:19

like the destruction of democracy go

play24:21

right ahead

play24:23

um whoops

play24:33

[Applause]

play24:38

i remember once there were two services

play24:41

now you might think well coupling that's

play24:44

like if this function calls that

play24:45

function

play24:46

and they're coupled with respect to the

play24:48

parameters to the functions that

play24:50

okay that's fine but if i have two

play24:53

services

play24:54

that have nothing in common then they're

play24:56

not coupled right

play24:57

well no there's a non-zero chance that

play25:01

any change you make is going to break

play25:04

something

play25:05

somewhere else and the more complicated

play25:07

the system

play25:08

the more likely that you're going to

play25:10

have these crazy action at a distance

play25:13

effects so there were two services

play25:16

they happened to be deployed on the same

play25:18

physical rack

play25:20

so each uh computer has its own network

play25:24

interface card

play25:25

they all flow up to a switch on the top

play25:28

and network switch on the top of the

play25:29

rack

play25:31

so one of the services changed its

play25:33

backup

play25:35

procedures to do all the backups at once

play25:38

once a week and

play25:42

that saturated that switch that rack

play25:44

switch

play25:46

the other service suddenly couldn't

play25:48

communicate to the rest of the world

play25:50

and it failed but

play25:53

so these two services are coupled with

play25:56

respect

play25:57

to changes to the backup procedures

play26:01

who knew right everything

play26:05

can be coupled to everything else

play26:09

and the bigger and more complicated the

play26:11

system

play26:12

the more likely you are to find these

play26:14

kind of weird

play26:16

action at a distance couplings and then

play26:19

what do you do

play26:20

so as a designer

play26:24

there are some principles that you can

play26:26

use

play26:27

that help to reduce that kind of

play26:30

coupling

play26:32

the principles at the very finest grain

play26:35

at the level of code are the sorts of

play26:37

things that i wrote about in the small

play26:38

talk best practice patterns

play26:40

and then the java version of that the

play26:42

implementation patterns book

play26:44

which is just here's some habits

play26:47

that expert programmers use

play26:51

so that they communicate to other

play26:53

programmers

play26:54

the most expensive coupling isn't the

play26:56

coupling that you

play26:57

that you actually see it's the couplings

play27:00

that you

play27:01

don't see where like this these two

play27:04

services sharing a rack switch

play27:06

that's coupling nobody even knew existed

play27:08

until there was a disaster

play27:11

so expert programmers just have some

play27:14

habits

play27:14

at the at the lowest layer

play27:17

like not using global state is a really

play27:20

simple one just be explicit about the

play27:22

data that goes in and data that comes

play27:24

out

play27:25

and if you're explicit about the

play27:28

as my father would call them the

play27:30

gosintas and the gazotas

play27:33

then if you want to analyze the

play27:35

situation you can

play27:36

see okay here's what goes in here's what

play27:38

comes out i'm not making any changes to

play27:40

global state that's just a habit

play27:42

if you can follow that habit it'll be

play27:44

easier for you to identify coupling

play27:48

so

play27:54

so the there's a there's an

play27:57

inverse of coupling so this other word

play28:00

cohesion that people talk about

play28:02

yeah and it's another word that has

play28:06

in the original definition has a very

play28:09

precise definition but that's not a

play28:11

definition that

play28:12

seems to have carried out over time

play28:15

so here's the original definition of

play28:17

cohesion

play28:20

if here i have an element

play28:23

and it has sub elements

play28:26

this element e is cohesive

play28:31

to the degree that its sub elements are

play28:34

coupled

play28:36

that means is if i have to change one of

play28:40

these

play28:40

i'm going to have to change all the

play28:42

others at the same time

play28:45

that makes e cohesive

play28:52

now i read this in the green book

play28:56

i'm like well isn't that bad to have all

play28:59

of your

play29:00

sub elements coupled to each other

play29:03

and as always the answer is compared to

play29:06

what

play29:08

if let's say we have

play29:12

a another situation

play29:15

i think of these things kind of an

play29:17

abstract way

play29:21

let's say i have these two elements are

play29:23

coupled but these

play29:24

others other two aren't and i need to go

play29:26

make a change to e

play29:28

so i so i make a change to this element

play29:30

so i

play29:31

make a change to that element but i'm

play29:33

gonna have to at least look at these

play29:34

others

play29:35

let's say this is four functions in a

play29:37

file and i if i change

play29:38

one if i change the writer i have to

play29:41

change the reader two and then there's

play29:42

some other functions and i don't have to

play29:44

touch those

play29:45

now i might say well that's good that i

play29:48

only have to look at part of this

play29:50

file in order to make the changes but

play29:53

there's an even

play29:54

better solution which is

play29:57

to have this element be broken into two

play30:03

where these things are coupled with

play30:06

respect to the change

play30:07

and i don't have to even think about

play30:09

this part

play30:11

now this uh what e sub 1

play30:16

this is more cohesive

play30:19

than e was originally because if i

play30:22

change

play30:22

one of these i'm always going to have to

play30:24

change the other

play30:26

and here's the beauty of cohesion like

play30:28

eliminating coupling is hard

play30:31

always you have this trade-off do you

play30:33

know this the international

play30:34

symbol for trade-offs

play30:38

yes some places if you walk around and

play30:40

you go ah

play30:41

other people will flash that sign back

play30:43

to you and

play30:44

it's what geeks do instead of being cool

play30:47

come on

play30:50

so there is always a trade-off between

play30:52

the cost of coupling

play30:54

the cost of coupling is these rippling

play30:56

changes

play30:57

so you got that cost and if you have a

play30:59

lot of coupling then the cost of

play31:01

rippling changes is really high and if

play31:03

you have

play31:04

hardly any coupling at all then the cost

play31:06

of rippling changes is low

play31:08

but you also have the cost of decoupling

play31:12

and they'll always be some coupling in

play31:14

your systems

play31:16

if you think there isn't any coupling

play31:18

today tomorrow somebody's gonna ask

play31:21

for some change to the system that will

play31:24

reveal oh we do have coupling here after

play31:26

all

play31:27

so you're always as a designer you're

play31:30

always

play31:31

balanced i was going to say precariously

play31:33

balanced but it's not really precarious

play31:35

it's just like this is what we do

play31:37

you're always balanced between the costs

play31:40

of the coupling that you're experiencing

play31:42

because of the changes you're having to

play31:43

make

play31:44

and the cost of decoupling and this is

play31:46

these this is this moment where you say

play31:49

i'm writing a book right now called tidy

play31:51

first question mark

play31:54

because all developers all the time

play31:57

have this experience multiple times a

play31:59

day this code is ugly

play32:01

but i have to change it should i tidy

play32:04

first

play32:06

and that is exactly this moment of

play32:08

software design where you're saying

play32:10

okay there's there's some kind of i can

play32:13

either reduce coupling or improve

play32:15

cohesion

play32:18

but do i do that or do i just make the

play32:22

change to the ugly code

play32:24

and it's a legit trade-off you can do

play32:27

the one you can do the other

play32:30

and you have to that i mean that's why

play32:32

you get paid as a designer you

play32:33

you have to make this call about what

play32:35

you're going to do what you're going to

play32:37

do

play32:37

so here's the beauty about co of

play32:40

cohesion

play32:41

coupling is a n squared problem you have

play32:43

n

play32:44

elements they could all be coupled to

play32:46

all the other n

play32:47

elements in your system and that

play32:51

n gets to be really large if you're

play32:52

talking about facebook scale

play32:54

or even my current employer gusto

play32:58

where we do small business payroll and

play33:00

benefits in the u.s

play33:02

turns out there's lots of small

play33:04

businesses

play33:05

also turns out that tax authorities

play33:09

and benefits providers have no incentive

play33:12

to make

play33:13

things simple so they're they're just

play33:16

spewing complexity

play33:17

and the beauty of of what we do at gusto

play33:21

is we take that complexity and we give

play33:23

the employer

play33:24

and their employees a simpler view of

play33:27

what it means to get paid

play33:29

we make sure that forms get filed on

play33:30

time and all that

play33:32

but in order to digest all that

play33:34

complexity is really really hard

play33:37

and no matter how good you make the code

play33:41

some joker in uh the oregon

play33:44

workers compensation tax authority

play33:48

is going to send you a new set of of

play33:51

specifications for the new regulations

play33:54

for

play33:55

if you have more than five employees

play33:57

which you think would be simple to

play33:59

calculate but it's not

play34:01

then you have to deduct this percentage

play34:04

which you would think would be simple

play34:05

but it's

play34:06

not and then six months later they say

play34:09

oh wait sorry we realized that what we

play34:12

sent you was impossible to implement

play34:14

so here's the new regulations

play34:17

and here's how you're going to

play34:19

retroactively apply them to all of the

play34:22

forms that you already oh my lord

play34:25

all of our data fits on a thumb drive

play34:27

all of our customer data

play34:30

carrying around in my pocket the

play34:31

complexity is all in this

play34:34

incredibly complicated rich domain

play34:38

and number two we can't screw up at

play34:40

facebook i worked on facebook messenger

play34:42

for quite a while

play34:44

and he always had some slack you know

play34:46

just like no this isn't going to work

play34:49

ah that's fine the little button that

play34:50

says uh i was unable to send

play34:53

try again you know that was always an

play34:57

option and we don't have that option at

play34:59

gusto

play35:00

it's not like uh i was unable to make

play35:02

things right with the irs for you

play35:05

try again

play35:10

does not work that way um

play35:14

so what we do really matter and and if

play35:16

we screw up badly enough

play35:17

we literally can go to jail i mean we

play35:20

can go to jail

play35:21

not our clients so

play35:24

um we have this big domain we have a

play35:28

bunch of code to support it

play35:30

which is grown organically people use

play35:33

organic as some kind of pejorative

play35:35

some kind of a oh this system just grew

play35:38

organically

play35:39

what is your other option

play35:44

i mean we're all carbon-based life forms

play35:47

right so

play35:48

i don't get it anyway where's

play35:52

what was i talking about i'm gonna get i

play35:54

have four topics to discuss and i'm

play35:56

gonna get through one of them today

play35:58

so um coupling and cohesion i think i'm

play36:02

almost there

play36:02

here's the thing about cohesion though

play36:06

coupling is this n squared problem and

play36:08

you think about n

play36:09

at a place like facebook or and at a

play36:11

place like gusto

play36:13

the number of repositories

play36:17

and services and functions and

play36:20

variables and database tables and and

play36:23

and

play36:24

is very very large that n is big

play36:28

and then every a change to every single

play36:31

one of them

play36:32

could break every single other one of

play36:34

them in some way that

play36:35

is going to really surprise you at 3am

play36:38

so

play36:40

that's an intractable problem as a

play36:42

designer

play36:43

you don't get to work from a clean sheet

play36:45

of paper you

play36:46

you walk in and you've got a system and

play36:48

it's already running and you need to

play36:50

make it better

play36:51

in some kind of way how do you reduce

play36:55

coupling you remember that cost of

play36:57

decoupling over here

play36:58

that's really really enormous so it can

play37:02

be

play37:03

challenging it can be nearly impossible

play37:05

as a designer to identify

play37:07

what you even want to decouple

play37:10

but here's the good news you can always

play37:14

find things to make more cohesive

play37:18

seeing things that are cohesive that is

play37:21

that are going to change at the same

play37:23

time

play37:24

and putting them in their own element

play37:27

that's something you can do just

play37:29

analyzing locally you don't have to know

play37:31

about

play37:31

all of everything i realized

play37:35

this as a habit when i watched one of my

play37:38

students

play37:39

refactoring he needed to change two

play37:41

lines of code in the middle of a big

play37:43

function

play37:45

and he the first thing he did just as a

play37:48

reflex didn't even

play37:50

think about it he extracted those two

play37:52

lines

play37:53

into their own helper function he

play37:56

changed the two lines he made sure that

play37:58

the tests

play37:59

passed and then he inlined that little

play38:02

helper function back into the original

play38:05

i thought wow that's a that's a waste

play38:07

that's like

play38:08

you could have just edited those two

play38:10

lines in the middle of the function

play38:13

but instead he created a cohesive

play38:15

element

play38:17

this function that would have to the

play38:19

whole thing would have to be replaced if

play38:20

any of the statements in it

play38:22

changed all of the statements and it had

play38:24

to change and then

play38:26

that was a much easier task what are the

play38:29

what's the state that i have to worry

play38:32

about while i'm

play38:33

in these two lines and i don't have to

play38:35

think about all the stuff that came

play38:37

before

play38:37

all the stuff that comes after all i

play38:39

have to think about is

play38:40

what goes into this and what needs to

play38:42

come out and that's

play38:44

easier that's a cohesive element edit it

play38:47

boom and then and then you can inline

play38:50

it again or not your choice but that

play38:53

moment of

play38:55

now there's not a good verb for this so

play38:58

i've invented cohesivating

play39:03

which somebody's going to come up with a

play39:04

better option than that it's

play39:07

is it maybe this is a an application of

play39:09

cunningham's law

play39:11

you know cunningham's law if you want a

play39:13

good answer to a question

play39:15

on the internet you don't post the

play39:17

question you post a bad answer

play39:20

and somebody will correct you

play39:24

most often a guy but

play39:27

that's a whole different set of

play39:28

political problems okay

play39:30

um

play39:33

no it's a guy if you don't want the

play39:35

answer changed

play39:38

um so you you can always make things

play39:40

that are cohesive

play39:43

uh it turns out there's two styles of

play39:45

designers

play39:46

lumpers and splitters you know about

play39:50

this

play39:50

i am definitely a splitter i like lots

play39:52

of little pieces

play39:53

that are interacting with each other in

play39:56

fairly

play39:57

simple straightforward ways um other

play40:00

people

play40:01

want to have big giant functions and big

play40:03

giant

play40:04

tables and big giant uh

play40:09

objects so that they can see everything

play40:11

all at one glance

play40:13

and i think this is a legit difference

play40:15

in thinking styles

play40:16

um this is one where i'm not going to

play40:19

say my way is just

play40:20

strictly speaking better

play40:23

uh so in this

play40:27

in this uh goal of reducing coupling

play40:31

over time

play40:33

if you can't get rid of it putting all

play40:36

the

play40:37

as we would say on the farm manure in

play40:40

one pile

play40:42

is better than having it spread all over

play40:43

the place

play40:45

that is this moment of creating cohesion

play40:47

where you're saying

play40:49

well we have all this code scattered all

play40:51

over the place that does

play40:53

i don't know authorization let's put it

play40:56

all in one place

play40:58

and it won't be any easier to change in

play41:00

that one place

play41:01

except that at least we know where to go

play41:04

to look so that's this moment of

play41:07

creating cohesion which tends to reduce

play41:10

coupling

play41:11

you can't always know that you're doing

play41:14

it but at least

play41:15

it gives you a path forward so there's

play41:18

the original definitions of coupling and

play41:20

cohesion

play41:21

coupling is if i change this i have to

play41:23

change that

play41:24

with respect to a particular change and

play41:27

cohesion

play41:27

says if i change one of these things

play41:30

then all of my siblings have to change

play41:32

too which is a way of reducing the scope

play41:36

of coupling

play41:43

now i am the sort of person who

play41:45

generates lots of ideas

play41:47

and i've been thinking out about a bunch

play41:49

of stuff lately

play41:53

some of which ties together and some of

play41:54

which i'm not going to be able to even

play41:56

come up with a plausible story for how

play41:58

it goes together but here's a

play42:00

here's an observation that i made the

play42:02

other day

play42:03

um writing this tidy first book

play42:08

so there's a loop that goes

play42:12

somebody has an idea for how the

play42:15

behavior

play42:16

of a system needs to change and they

play42:19

change the behavior

play42:21

and that gives them more ideas for how

play42:22

to change the behavior of the system

play42:25

and so this is your user

play42:28

sees your systems like this that behave

play42:31

like this yesterday it behaves like this

play42:33

today

play42:34

we're hoping that that's a happy change

play42:37

sometimes it is but as

play42:40

a developer or a designer

play42:44

you know that there's another loop

play42:46

that's going on underneath the surface

play42:48

you know the story about the swan at the

play42:51

swan

play42:52

up above it's all beautiful and majestic

play42:54

and it just glides smoothly along

play42:57

if you look under the water there's

play42:59

these feet that are paddling and poop

play43:00

coming out

play43:02

so software development is like the swan

play43:07

except the graceful and beautiful above

play43:09

the surface part

play43:15

thank you very much so the other thing

play43:17

that's going on is

play43:18

you you can't just change the behavior

play43:21

you also have to

play43:22

change the structure of the system too

play43:26

and how the system is structured

play43:31

effects profoundly affects whether or

play43:33

not you can make the behavior changes

play43:35

that you want

play43:36

because of coupling exactly because of

play43:38

coupling you say well

play43:41

i could add this database but then i'd

play43:43

have to go change these 20 places so i'm

play43:45

going to take all those 20

play43:47

places and i'm going to put them in one

play43:49

object

play43:50

and now it's easy for me to change the

play43:52

database that's a kind of structural

play43:54

change

play43:56

that you can do before you make a

play43:58

behavior change and that's exactly this

play44:00

tidy first moment

play44:02

that i'm writing about where you say

play44:04

okay

play44:06

yes i want the behavior system to change

play44:09

like this but

play44:10

first i'm going to change the structure

play44:13

um i came up with the slogan

play44:16

uh let's see i just i shortened it this

play44:20

morning over breakfast

play44:22

make change easy then make easy change

play44:26

there you go that's your next t-shirt

play44:28

idea

play44:30

um and this is as programmers

play44:34

we can be pretty massive massac yeah

play44:36

masochistic sometimes like

play44:37

the pain of programming is a badge of

play44:39

honor

play44:41

where oh this is going to be really hard

play44:43

it might not work at all

play44:45

and we think that's a good moment i go

play44:48

good

play44:49

i get to now use my wizard-like powers

play44:51

as a programmer

play44:53

well maybe that's the moment that we're

play44:54

really screwing up

play44:56

maybe that's a moment where we say well

play44:58

making this change would really be

play45:00

really hard

play45:01

what would the system have to look like

play45:04

in order for this change to be easy

play45:07

i want to make the change easy then make

play45:09

the easy change

play45:12

well then you're just well actually

play45:14

making the change easy can be hard

play45:17

too so you have to reply recursively

play45:19

because i am a computer scientist

play45:21

i did take those three years in college

play45:23

of computer science

play45:25

where it's kind of like a zipper you say

play45:27

well

play45:29

if the system was like this then this

play45:31

change would be easy but to get the

play45:33

system like this

play45:34

is going to be hard but if the system

play45:36

was like this then making that change

play45:37

would be easy and if the system

play45:39

zip zip zip and then you can make the

play45:42

easy change

play45:45

but that means that you're spending your

play45:47

brain power

play45:49

on making the next change easy not on

play45:53

making the next change

play45:55

and that can be uh that's a hard moment

play45:58

uh like the

play46:02

the people observing these behavior

play46:04

changes

play46:06

this is an artist's rendition of an

play46:07

eyeball very interested eyeball

play46:10

whoops what go

play46:15

oh jesus now what if

play46:18

anybody no connection

play46:23

does anybody have any idea how to get

play46:24

rid of this

play46:33

yeah this thing here that isn't moving

play46:46

all right all right what is the

play46:48

collective salary of this room right now

play46:56

i don't even all right

play47:00

no not last cast the

play47:03

all right there

play47:12

can't even my operate my own damn

play47:14

computer

play47:15

well it's not really my computer apple

play47:16

keeps doing things to it

play47:18

um where was i

play47:22

so from from the uh the outside observer

play47:26

who just wants

play47:27

the new report to be printed or the new

play47:30

interactive

play47:31

video thing to pop up when you don't

play47:34

want it

play47:36

uh that's where all the pressure

play47:40

is i want to see the change of the

play47:42

behavior

play47:43

but as professionals we understand

play47:46

that the structure matters to making the

play47:49

next behavior change and even making

play47:50

this behavior change and sometimes

play47:53

it's important to do a little more now

play47:57

so that we can continue making the kind

play47:59

of changes that we want to make

play48:03

i'm going to as i said i had to skip

play48:05

some topics

play48:06

oh

play48:10

this is so frustrating

play48:13

here's a experiment to try and then i'll

play48:15

get to my i'll

play48:16

conclude the experiment to try is to

play48:20

carefully separate behavior changes and

play48:22

structure changes

play48:25

um like put them in different pr's

play48:29

oftentimes you're programming away you

play48:32

say oh and i need to rename this

play48:35

oh and i need to add an if statement

play48:36

here oh and i need to extract the helper

play48:40

don't do that go back

play48:43

and either do the do those in one order

play48:46

or the other where you make the

play48:47

structural changes the name

play48:49

changes introducing new sub elements

play48:54

make those changes that's one pr

play48:57

finished done shouldn't change the

play48:59

behavior of the system at all

play49:01

and then make you the behavior change or

play49:03

do the hacky behavior change first

play49:06

and then do a second pr to do the

play49:09

cleanup

play49:10

to make those structural changes the

play49:13

reason

play49:14

i think underlying reason for separating

play49:17

behavior changes and structure changes

play49:19

like this

play49:20

is that behavior changes in general are

play49:23

irreversible that is if we s

play49:27

augusto if we send out a wrong tax form

play49:30

we can't take it back so you have to be

play49:34

very

play49:34

careful about irreversible decisions but

play49:37

you don't have to be so careful about

play49:39

reversible decisions and all structure

play49:41

changes are reversible

play49:42

if we extract out a helper we can just

play49:44

inline it

play49:46

right that's that's not a big deal you

play49:49

don't need to apply the same level of

play49:51

rigor

play49:52

to reversible changes as you do to

play49:54

irreversible changes

play49:55

by separating structure and behavior

play49:57

changes

play49:58

give yourself a chance to apply

play50:01

different standards

play50:02

to what are very different sets of

play50:05

decisions

play50:06

the structure changes you can undo

play50:08

easily the behavior changes

play50:09

not so much so there's an experiment to

play50:12

try

play50:13

when you go back now here's the message

play50:17

that i thought i was going to come

play50:20

with to you and this is a big surprise

play50:23

to me

play50:25

something that sparked my interest

play50:28

in uh what i call a 3x model explore

play50:31

expand extract

play50:33

that i came up with to describe

play50:36

uh how innovation happened on facebook

play50:40

[Music]

play50:43

and

play50:48

it is the resurgence of waterfall-style

play50:52

development

play50:54

exactly how stupid is that

play50:58

well it's not actually stupid stupid

play51:01

smart people

play51:02

trying to solve real problems in a way

play51:05

that just doesn't work

play51:07

and we know it doesn't work but that

play51:09

doesn't stop them

play51:11

now we could have an interesting

play51:14

discussion about the

play51:15

psychological motivations for doing

play51:17

waterfall development when you know it's

play51:19

not going to work

play51:20

but the fact is if you go out there

play51:24

in the wild you see people saying stuff

play51:28

that's very waterfally

play51:30

now i at one point said there are no big

play51:33

changes they're only big feedback loops

play51:36

and i believe that applies to waterfall

play51:39

when you've specified one thing

play51:41

it's just so tempting to go and specify

play51:43

the next thing without getting feedback

play51:45

on those first set of decisions

play51:47

it doesn't work because one we can't

play51:50

predict

play51:51

and two the very act of making a change

play51:53

in the world causes the world to change

play51:57

which makes the next thing different

play52:01

so the waterfall doesn't work it never

play52:04

did

play52:04

it still doesn't it you know this time

play52:07

is different

play52:08

it's not different and yet

play52:11

there are people saying very waterfally

play52:14

things

play52:15

and we'd at least introduced shame to

play52:18

the equation

play52:19

20 years ago or be able to go well i

play52:22

have this big spec

play52:26

and they'd feel bad about it now now no

play52:29

it's like i have a big speck

play52:31

what do you have oh a bunch of test

play52:33

cases

play52:39

somehow the idea that feedback loops

play52:42

just simply

play52:43

have to be long has come back

play52:46

into fashion so this is one of the

play52:48

advantages of being an old person

play52:50

is i get to look at these things come

play52:52

back around and he's like

play52:54

oh yeah i know how this one ends

play52:58

might take five years for all y'all to

play53:00

figure out how this one ends but at

play53:02

least

play53:02

i don't have to worry about it because i

play53:04

know how where it's going

play53:06

the ddd community is perfectly placed

play53:10

to counteract that tendency

play53:14

by insisting on feedback

play53:17

you're the people who analyze

play53:21

more carefully and more thoroughly than

play53:23

other folks do

play53:25

but when that moment comes when you've

play53:27

made some decisions and you know that

play53:30

they're

play53:30

at risk you're also the people who are

play53:34

perfectly positioned to say

play53:37

time out i'm not sure about what we've

play53:40

done

play53:41

already i'm not comfortable adding

play53:44

more layers and more layers on top of

play53:46

this let's implement something

play53:48

let's put it in front of people let's

play53:50

see how they act

play53:52

let's see how that changes the context

play53:54

let's see what we learn

play53:56

from that feedback loop before we start

play53:58

making another

play53:59

set of decisions based on

play54:02

these risky assumptions this room

play54:06

and your compatriots are perfectly

play54:08

positioned to

play54:10

to tee that up and say nope we're not

play54:13

going to continue

play54:15

however good it feels however

play54:18

much progress we feel like we're making

play54:20

however many

play54:21

insights we gain into the domain by

play54:24

thinking really hard about it

play54:26

that's a thing we need to do that but we

play54:29

need to spread that

play54:30

over time and here's how we're going to

play54:33

do that

play54:34

now i'm not quite sure how your

play54:37

community spreads your techniques

play54:39

over time in that way so i'm going to

play54:42

leave that as an exercise to the

play54:44

listeners but what i can say is

play54:47

in addressing our collective moment of

play54:51

insanity going back to

play54:53

very very long feedback cycles

play54:56

you have an opportunity a unique

play54:58

opportunity

play54:59

to address that sooner and quicker than

play55:02

the people like me who are talking to

play55:04

mostly to folks who are writing code and

play55:06

writing tests and think that they

play55:08

shouldn't write tests because they don't

play55:10

have not a design software and

play55:12

it's a long story but that's what i

play55:15

would that's what i wanted to come to

play55:16

you to say

play55:17

is the water falls back it's stopped

play55:20

apologizing

play55:21

and it needs to be killed with fire

play55:24

thank you very much

Rate This

5.0 / 5 (0 votes)

関連タグ
Software DesignWaterfall ModelDDD ConferenceFeedback LoopsCoupling CohesionBehavior ChangesStructure ChangesDomain Driven DesignInnovation CycleDevelopment Practices
英語で要約が必要ですか?