 All right, I guess first thing I want to see is a show of hands from people here who Are familiar with design patterns A lot of you okay, good. All right, and I'm not not working in a vacuum here. That's that's excellent All right, just so you guys know me. I'm Jerome sharing I am a distinguished engineer with VML Incorporated and at age top five Advertising agency in the United States I can be reached it Most of the usual places except I do tumblr rather than Facebook All right design patterns now Back in the day design patterns were not invented for use with software design patterns The guy who invented them came up with the idea for physical Architectures for building houses for building buildings for building offices and parks and Any kind of public spaces any kind of thing entering into the built universe so for 30 years now We've had design patterns, but one of the things the guy came up with this the Christopher Alexander said was it When he was writing in the timeless way of building Patterns are a gate an understanding allows us to pass through and leave the gate behind Something that I find increasingly rare as a motivating factor in the software industry This is the guy himself Christopher Alexander formerly In the school of architecture at University of California at Berkeley in the US Currently he has his own own Academically oriented Architectural school the Center for environmental structure. I believe is what it's currently called So all right again show of hands people who know design patterns probably know this book Right everybody anybody yeah, okay good So the question then is how many people remember that? That book was really kind of a follow-on in software to this book in physical architecture How many people have read a pattern language itself? Tiny tiny handful of people good. Okay, but not not a complete vacuum. That's also very encouraging so a pattern language came out in the late 1970s design patterns came out in the mid 1990s and Well one of the things that happened over the course of years after a pattern language was Published and its follow-on books was that Alexander discovered that Pattern languages while really amazing didn't tell the whole story That even people who were really encouraged by using pattern languages in physical architecture There was still something Missing from the structures they designed from the structures that they built in many cases which with Characteristic with characteristic lexical skill he referred to us the quality without a name Well The more he worked with it over the course of decades comes up with the idea that well No, maybe we can put a name to this maybe we can Analyze the things that are going kind of sideways when we try to apply pattern languages I know he's been quoted as having said that buildings Built by people just following the pattern languages Were kind of funky. I think is the way he put it We got a lot of buildings with alcoves in them was another way he put it And I see the same kind of thing when I work with software developers when I work with Architecture teams I see that yes people can look at the gang of four book or any of a number of other software Design pattern libraries since then and say okay. Well, we're applying this pattern here Or we're applying this other pattern here and then this Leads into segues into that lots of people use strategy lots of people use Command patterns very few people that I know implement for example the iterator pattern anymore and there are an enormous amount of literature out there Concerned with whether or not design patterns simply represent a Lack of functionality in the implementation language, but that's not what we're talking about today Because we're going a little deeper than that so Alexander Collected his understanding based on what had happened after he wrote a pattern language into a new series of books called the nature of order That's the cover of volume one there. That's the phenomenon of life The others are the process of creating life The living world No, excuse me a vision of a living world and the luminous ground Are the other books in this series, but the series as a whole is called the nature of order and This is not as easy to grasp as a pattern language pattern languages were very concrete the ideas behind them were extremely grounded in the nature of order he's asking his readers to think at a Kind of a meta level about the things that give rise to or generate patterns or the things That we use to apply patterns in series in order to generate built objects in order to generate Japanese tea gardens or play rooms or houses or office spaces or homeless shelters as the case may be So my question coming into this is looking back at this relationship What goes there? What's the book in that blank spot and? I was actually quite surprised to discover after a great deal of searching in a number of sources But there really isn't anything in that spot. There were a few attempts in that direction if you do a Google search for the nature of order and Software you'll find mostly a few pamphlets by Richard Gabriel who was In the software industry and a friend of Christopher Alexander's as well, but His relationship there was to the structure of code as a form of literature the structure of code as a form of poetry and I think after a great deal of analysis, it gets a little bit John I'll say it gets The scope is too narrow so for myself A few months ago. Well more than a few months ago. I guess it's been over a year. Goodness. I Dread the nature of order many years ago and thought well. This is interesting Wonder what the software community is going to do with it But it wasn't until about a year ago when I started getting into functional programming that I realized that an awful lot of the structures an awful lot of the ideas that Alexander's talking about as practical steps that you can take to build spaces had Direct analogs in structures that were talked about in functional programming and we'll see maybe a couple of examples Or at least a couple of inspirational ideas on those lines in just a moment But the basic idea is to try and figure out what goes in that space what goes in that blank spot So The unifying thing about all of this though the one thing that that's Inescapable and the one thing that says yeah, maybe we can apply these ideas from the nature of order out into the software development community is that is that ultimately Software has to run in the real world and has to run It's it's written by human beings and it's used by human beings and They're the same people with the same ideas and the same thoughts and the same needs and the same spaces as everything that architecture physical architecture is concerned about it's All one thing ultimately, I mean I've talked to Actually at this conference. I've talked to a couple of depop depops guys or Well, not necessarily guys know that think about it a number of debops personnel Who? Come at a lot of software problems from the perspective that people merely designing software don't necessarily have a sense of the platforms on which it needs to be deployed They don't have a sense of the limitations. They don't have a sense of The scope or necessarily they look at Factors like runtime From a mathematical perspective without necessarily looking at it and saying okay, well If we're going to need it to run in this time How big an Amazon Lambda do we need to allocate in order to get something back to the user in six seconds or less But those are physical considerations Alexander had similar concerns with respect I'm sorry about that I Had similar concerns with respect to architects physical architects working on physical buildings One of the difficulties the reason he's no longer at UC Berkeley is because he was teaching a curriculum that required His students to get out into the field to get their hands into the concrete To stand on the slab where they're gonna put up a house to look at the site to look at all the objects on the site Where a building was going to be constructed to say okay? How can I connect what I'm building? How can I make this? construction Part of this place as opposed to just plunking it down there How do I incorporate the needs of literally the platform on which I'm going to build a physical thing? into the design of that physical thing and Well quite frankly I see a lot of people in software think well right once run anywhere Okay, how many people remember that slogan from the early days of Java right once run anywhere? Yeah, okay, and for how many of you was that ever actually reality? Yeah, so I thought I Had a QA lead once who put it right once test everywhere right once test everywhere But it's the same basic idea It's not that you can't do it. It's that you need to know that you should that you need to know that yeah, there are gonna be differences between platforms and More to the point far more to the point at a deeper level than that The software that we build the software that we design the software that we run is going to be making these profound differences in people's lives Think about the talk that you just heard a few moments ago. Okay? That's about technology. That's about a unification of hardware and software design Making a difference in the life of the planet and we all share a little bit of that Just with the software that we write for our firms or our open source projects or our clients or our customers Or just for ourselves every day We participate in that so some basic concepts coming out of the nature of order itself like life This was the thing that he found Gatsby This was the thing that Alexander found was most characteristic of Things that were well done They were alive every piece of space. He postulates. He says in the phenomenon of life every bit of space has some degree of life And it's the job of the architect. It's the job of us as human beings To increase the life of the spaces in which we live how many times have you gone out and looked at a shopping mall a new bank building a new abstract construction for Some corporate headquarters and thought That looks like a really dead place to work That looks like a really difficult place to live That's the kind of thing he's talking about when he says those places have less life It's not that they have no life. It's not they're completely dead, but they're disconnected They're weaker than they could be but every piece of Space has some degree of life and it's our job to make that work So the first book the phenomenon of life has hundreds of pages like this where he puts up Two images and says okay, which of these Seems like a thing that has more life and he's got a number of ways of characterizing that He calls it the mirror of the self test Which when you look at these images, which one Into which one do you feel your humanity expanding which one makes you feel more like you? which one is more compelling at a deep level and He does hundreds of pages of these and he doesn't in a comparative way for example, which of these two is more compelling I don't I don't actually need your answers to this by the way. I just need you to think about it so Okay, so that's one set. All right So what have we got here? Which of these spaces Feels more alive, which of these spaces feels that it has more Life that feels more compelling that you feel more connected to it Like it's a real place in certain ways Okay, fine. So you might have some comparative there. All right. How about these two? What happens there? What the phenomenon of life is about is analyzing why those comparisons tend to come out the same statistically across a Very large number of samples like tens of thousands of people. He sat down and had them compare images and Well, there are outliers because people really are different You get the kind of statistical bell curve that says, okay Yeah This image for most people is more compelling. This image has more light This environment feels more like someplace Not necessarily that you would want to live but that people live So that's life And a lot of that cheese Okay All right a lot of that Is about the way the space itself is structured and the way people use the structures in the space so What we wind up talking about is the idea that well the degree of life in a given space is ordered We can feel more spaces Some spaces more alive than others. But how how do we generate that kind of life? How do we build more living spaces? The first tool in that particular box is something that Alexander calls the field of centers centers are a complicated concept Mostly because like a lot of definitions in the nature of order The definitions are recursive Centers are things that have a sense of distinctness The classic canonical example that Alexander gives is you have a blank sheet of paper And when you put a dot Down in the corner of that paper You create within the mind of the observer a sense that that's a center That's now a distinct thing that engenders the idea that Implicitly calls for other things around it now again It's sometimes hard to wrap your head around the idea that these are actually epic phenomena There aren't they aren't necessarily what a physicist might call real But they are constructions that we get to work with because we have minds So in this instance for example It's a little blurry. Sorry about that. But in this instance putting that dot there The idea is that it creates That field of centers around itself There's the sense of the larger field around the dot But by putting it there it also tends to divide The space by putting the dot here There's an implicit sense that there's a division of the space here and a division of the space here and a division of the space here And then the relationships between them have kind of a ray-like structure which I'm sort of getting at How long those lines it's not Again I didn't want that to come across as especially distinct because it's not those are epic phenomena. Those those are cognitive spaces So the next idea is unfolding things unfold things an acorn implies an oak tree um Parts tend to imply a car an Idea a concept tends to imply a mobile phone app That's where they come from that's where they come from first they come from our minds They unfold in our minds they become more complete through a series of transformations like this Remember what we said earlier about centers the idea behind centers the idea behind increasing the life of a thing is to increase the strength the cognitive presence if you will of those centers and this is an example of what Alexander calls unfolding where Beginning with these points where it's just a circle at every point We have the idea of the same Kind of center, but then we add Centers to it We create new structures Through a series of transformations In every case we have the same basic idea and we embellish it we add things to it Sometimes we take things away. It's not in this example, but sometimes we take things away But at every step the idea of that same original center persists and That is what he calls structure preserving transformations Now those of you who remember I'd said that I was inspired to this talk by studying functional programming and already know a little bit of functional programming yourselves Kind of understand how that's similar How we have the idea of composition in functional programming The idea is that we have things that can be Composed we have the idea that we can say all right. Here's the core of a thing. Here's the idea Behind say, oh, what's my favorite now? bread first search But it's not really bread first search in a language like Scala or Haskell or of sharp You can express the idea of bread first nests Independently at the idea of search or for that matter independently of what source you're using for the nodes that you're searching through There's the idea of a bread first traversal which you can make a search or You can make an ordering or you can make any of a number of other things in Terms of the functions that you pass into the structure or to which you apply the structure with Composition or as Alexander would have it in physical architecture Structure preserving transformation. You don't muck with the basic idea of what was there in the beginning The next thing is wholeness and again, this is kind of recursive Wholeness is exactly what it sounds like. It's the thing as a whole in physical architecture What I'm trying to get at is the idea that this is your goal This is where you're going with this you're starting from with pieces and you're putting them together and You're arranging them and you're making all these transformations on them But you need to keep the wholeness in mind or you might wind up with an office building where you really kind of needed a single-family residence The wholeness is the it's the goal if you will the wholeness is the idea of what it is that you're trying to construct There are dozens of examples of this kind of thing in the nature of order There of course will be dozens of examples millions of examples of this kind of thing and when we start to apply these principles more generally in software development because what we think what we can think of the wholeness is The requirements for the program the definition of the project With each of those structure preserving transformations. Are we approaching closer? To what we need to do for the project and to the extent that the answer is yes, we are fulfilling the wholeness So we need some extended concepts because we're not working directly with the physical universe and again, I'm indebted to Richard Gabriel for some of these ideas like the idea that we have different perspectives on things How many people here are familiar with the words of oh my goodness Early 20th century Austrian philosopher Karnapp anybody conceptual spaces formal spaces Visual perceptual spaces. No, okay a couple people up there He was working in the same era as Vidconstein who's much better known for this kind of thing But the idea is that we're working in different spaces. We're working in the space of code We're working in the space of Diagrams more working on it. We're working in the conceptual communicative spaces of other people's minds We're working on whiteboards for that matter and There are transformations that apply each of these levels, but they map between those levels. I Mean for example, if you have a good system design It's probably going to look like a good system design regardless of how you got there. I Mean just to offer up some Scala code here You'll know Good code when you see it You'll know bad code When you see it you can something that I mean, okay who here Has been on a code review or looking at a pull request and thought This is really ugly anybody. Yeah, okay almost everybody. All right Now how many people have been on a code review or looking at pull requests and thought wow? I wish I could write code that well Yeah Okay But that's the kind of thing we're talking about that's the kind of thing From an Alexandrian perspective from the nature of order perspective we can say well Okay, if we look for these characteristics if we look for the centers within the code the places that our eye is drawn By the structure of the code itself. Is that actually also the most meaningful part of the code? Or are there bits around it that do violence to the central idea of whatever that particular piece of code is That's the same basic idea that we saw earlier with centers and Transformation and how we embellish things how we get a piece of code to grow out of a central concept out of a central functional point Into something more into a real program and again depending the perspective that we have depending on whether we're looking at it from the point of view of Different kinds of diagrams or whether we're doing a whiteboard we can express that in different ways But the same basic idea lives in the conceptual space okay So again examples of other things we can do We can see the life of the system express the deployment diagrams as well because again It has to live somewhere and this and somewhere that it has to live has to make sense So Lots of things I mean when we talk about Unfolding systems we're talking about we have a sense of the wholeness We have a sense of where we want the program to go and it's really a matter of saying okay Well starting from these components starting from these pieces. How do I get there? How do I get there in a way that's going to make sense? In a way that I'm going to be able to communicate to other people on my development team that I'm going to be able to communicate to The stakeholders in the project How do I get there in a way that? Everyone is going to look at and think yeah okay, I get this and In a way that's going to make us feel That's not just because feel in fact actually it's one of Alexander's points That's going to connect us to one another There are an awful lot of people in this industry who are in this industry because they don't particularly want to feel connected to other people Well, I got some news for you guys You're gonna be connected to somebody at some point that's part of the human experience That's part of the experience that we have from machines for that matter because the time is not long in coming we're gonna be feeling more connected to them too and Quite frankly They're going to have the ability to tell us that they don't feel particularly connected to us They already do if we have the ear to listen. I mean have you ever thought? What it's like in your Java programs or your Python programs or any of a number of other languages when you hit an exception and Suddenly the things unraveling a thousand deep stack trace What do you think that feels like how does that cognate to the machine would you do that to a person? Would you send them that far down the wrong path? Probably not but they're gonna come back and be Well, if you're lucky the person you sent down the wrong path a thousand deep is gonna come back Can you say what? Well, that's what the programs are doing too. So that sense of connectedness to a great extent applies to them as well But if we have living systems if we have systems that are unfolded if we have systems That we built through structure preserving transformations. We can take different paths for different platforms we can have a strong core and Nonetheless a unique deployment We can build things if we're paying attention If we're feeling our way through we're saying hey, which of these which of these courses of action that I can take as I'm building this code Is going to make things better For everybody which one makes me feel more connected to my future self to my co-workers to the stakeholders So with transformations same basic idea It's still an idea of Adding or in some cases removing centers because some of the things some of the transformations involved Have to do with increasing the simplicity of a system or saying hey, let's go for a little bit of calm here okay Sequences are how we get there as the steps we take which transformations do we choose in which order? They iterate they iteratively apply some of them involve removing but each Transformation this is the key point each transformation Strengthens existing centers and increases the life of the whole This is an example from book to the process of creating life in physical architecture Where Alexander is demonstrating the sequence involved in building? I believe this is a West no an east Turkish minaret that he gives an example of start with a basic form Add boundaries to it In this case add a cap Second one. I think is added if I remember the text correctly is out of base. That's another boundary transformation Then we start doing a little bit of deep interlock where we take some of that Top section away or perhaps add a little bit more of a border to it Then we add additional borders in alternating repetition then we start doing even more embellishment where we start to Strengthen each of the centers of the column by adding arches and decorations and Each of those is a clearly defined transformation So in development. Yeah, all of that keep the wholeness in mind Your project is done stop when nothing else can be strengthened and Transform deliberately in the sense of no, why you are doing what you are doing I mean, we have legends about this We have stories about people who don't know what they are actually doing in code They just copy in a piece of code that somebody else gave them or that someone else in the company scratched down on Note paper in the days before people kept records on computers Well, that was what worked. So that's what I'm going to use. No transform Deliberately look at what you've done and say does this increase the life of This part of the project doesn't increase the life of the wholeness of the project To say that this requires further work is an understatement as I pointed out. I've done a number of literature searches and I got nothing This idea that composition maps on to the stuff that Alexander wrote after patterns There's a little bit In a few corners Like I say look up the work of Richard Gabriel but not at the level that it really needs to be applied because There isn't only one view. There's multiple spaces where this kind of thing works As we said, there's code. There's deployment. There's Requirements and all the facets of development have their own viewpoint their own perspective into this kind of thing Our structure preserving transformations really in a mathematical sense function or monad like compositions And what do we do when the transformations aren't obvious? How do we search for them? How do we find what those transformations are going to be and are there other kinds of transformations or properties beyond the 15 That Alexander describes for physical space the answer by the way is yes because in book 4 He describes 11 more that have to do with manipulation of color spaces. Just so you know But why do we want to do this? The short answer is because we want to build a living world because we are the people who are building the next generation of Everything we live in a world where your hotel room has more intelligence Excuse me where the doorknob on your hotel room Has more intelligence than most of the computers that sent us to the moon We here Software developers are having more of an impact on what's coming down the pipe next I think then any other single group of people including the people who come up with things like political ideologies Because we're the ones who actually have to implement it We're the ones who actually have to make it happen We're the ones who are working in a space where? For a lot of physical things it takes time because they have to manipulate the physical world We're working up here. We can do new things as fast as we can think about them We can try a million experiments in the kind of time that a physicist might try 10 We are working our way into a new world at lightning speed and it's time. We understood the level of impact We are having and it is time. We understood Well, what was the last talk about one facet of in essence the social responsibility that goes along with Developing things with building things the trade-offs that we have in what we're actually doing how we're doing it I know sometimes some of these are income that some of these things are uncomfortable topics We don't necessarily want to think about how we fit into the larger picture. We don't have a choice This is the world we live in and I'd like to see it have more life I'd like us to take the next steps Into making it a better more coherent more connected living world Thank you You still aside. I'll go over here. Thank you There's a load of questions, but we're very short on time, so I'm just going to pick one And the one I'm going to pick is Is there a tension between imbuing code with life and connectivity and achieving abstraction and reuse one embraces specific context and the other steps back from it Yeah, okay That's actually a comment That actually expects thing I mentioned briefly earlier where there are people who of the opinion that if you're using patterns That's inherently violating the principle of don't repeat yourself Mm-hmm, and that's true but in which the same way that Every house is different Every software project is different Yes, there are things that you can reuse if you look at it from the perspective again a physical architecture I've wrestled with this for a while until I realized what the analogy really was Okay, if you look at physical architecture and physical construction, you still have things like bags of concrete or bricks That are commodity properties. Those are things that you weren't necessarily Customizing but that you are using to customize what you were doing and There's still going to be a pile of things in every one of our bag of tricks that we're going to reuse Okay, we don't have to use a completely new bred first nest algorithm or bred first nest expression every time we want to do a different kind of thing be it a search or a Concatenation or just a traversal of some kind because we already know how to do that We might want to tweak it for the particular platform that we're working on or we might want to at least acknowledge The compiler is going to tweak it for the platform. We're running it on but it's not necessarily something We have to do ourselves any more than we have to figure out how to compound our own concrete if we're building a house because those things are known and Those are things that we can reuse but the idea is to reuse them in ways where the wholeness In ways where the things that we're building with those components come out uniquely suited for their environment Thank you very much