06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Hacker Culture · Lobsters · · 1:01:38 runtime

"Simple Made Easy" (2011)

Comments

Transcript 7120 words

All right, who's ready for some more category  theory? You're all in the wrong room.

So this talk I hope seems deceptively obvious. One  of the things that's great about this conferences,

this is a pretty cutting edge crowd. A lot of  you are adopting new technologies. A lot of you

are doing functional programming and you may, you  may be nodding saying, yeah, yeah, yeah through

parts of this. And if some of it's familiar then  that's great. On the other hand, I think that

I would hope that you would come away from  this talk with some tools you could use

to help conduct a similar kind  of discussion to this talk

with other people that you're trying  to convince to do the right thing.

So I'll start with an appeal to authority.  "Simplicity is a prerequisite for reliability."

I certainly agree with this. I don't agree  with everything Dijkstra said and I, and I

think he might've been very wrong about proof in  particular, but I think he's right about this.

We need to build simple systems  if we want to build good systems.

And I don't think we focus on enough on that.

I love word origins. They are tremendous  fun. One of the, the reasons why they're

fun is because words eventually become come  to mean whatever we all accept them to mean,

you know, whatever's commonly understood  to be the meaning is what it means.

And it's often interesting to say, well, I wish I  could, I wish we'd go back to what it really means

and use that. And I think there's a couple  of words that I'm going to use in this talk that I would love for you to come away  knowing the origins of, and try to use

more precisely, especially  when talking about software.

So the first word is "simple". And the roots  of this word are "sim" and "plex", and that

means one fold or one braid or twist. And that  characteristic about being about one literally

fold or twist, of course, one twist, Hey, what's  one twist look like? No twists, right? Actually.

And it, the opposite of this word is complex,  which means braided together or folded together.

Being able to think about software in terms of  whether or not it's folded together, is sort of the central point of this talk. The other word  we frequently use interchangeably with "simple"

is the word "easy". And the derivation there is  through a French word, and the last step of the

derivation is actually speculative but I bought  it because it serves this talk really well.

And that is from the Latin word that is the  root of "adjacent", and which means to lie near

and to be nearby. And the opposite is "hard".  Of course, the root of hard has nothing to do

with lying near. It doesn't mean lie far away.  It actually means like strong or tortuously so.

So if we want to try to apply simple  to the kinds of work that we do

we're going to start with this  concept of having one braid

and look at it in a few different dimensions.  I thought it was interesting in Eric's

talk to talk about dimensions because it's  definitely a big part of doing design work.

And so if we want to look for simple things,  we want to look for things that have sort of one of something they do, they have one role,

they fulfill one task or job they're  about accomplishing sort of one objective.

They might be about one concept like security  and sort of overlapping with that as they may,

they may be about a particular dimension  of the problem that you're trying to solve.

The critical thing there though, is that when  you're looking for something that's simple, you want to see it have focus in these areas.

You don't want to see it combining things. On the  other hand, we can't get too fixated about one.

In particular simple doesn't mean  that there's only one of them.

Right. It also doesn't mean an  interface that only has one operation.

So it's important to distinguish

cardinality, right? Counting things from actual  interleaving what matters for simplicity is that

there's there's no, interleaving not that there's  only one thing. And that's very important.

Okay. The other critical thing about simple  as we've just described it is if something is

interleaved or not that's sort of an objective  thing. We can probably go and look and see,

I don't see any connections. I don't see  anywhere where this twists with something else.

So simple is actually an objective notion.

That's also very important in deciding  the difference between simple, easy.

So let's look at easy. I think  this notion of nearness is really,

really cool. In particular obviously there's  many ways in which something can be near, right.

The sort of the physical notion of it being near  right, is something you know, like right there.

And I think that's where the root of the word came  from. You know, this is easy to obtain cause it's,

it's nearby. It's not in the next  town. I don't have to take a horse or whatever to go get to it. We don't have the same  notion of physicality necessarily in our software.

But we do sort of have our own  hard drive or our own tool.

Or sort of the ability to make things  physically near by getting them through

things like installers and stuff like that. The  second notion of nearness is something being near

to our understanding, right. Or in our current  skillset. And I don't mean in this case near to

our understanding, meaning a capability, I mean,  literally near something that we already know.

So the word, the word in this  case is, is about being familiar.

I think that collectively we are infatuated  with these two notions of easy. We are just so

self-involved in these two aspects  it's hurting us tremendously.

All we care about is, you know, can I get this  instantly and start running it in five seconds?

It could be this giant hairball that you  got, but all you care is "can you get it?".

In addition, we're fixated on,  oh, I can't, I can't read that.

I can't read German. Does that mean German  is unreadable? No, I don't know German.

So you know, this, this sort of  approach is, is definitely not helpful.

In particular, if you want everything to  be familiar, you will never learn anything

new because it can't be significantly  different from what you already know and not drift away from the familiarity.

There's a third aspect of being easy that  I don't think we think enough about. That's

going to become critical to this discussion, which  is, which now is being near to our capabilities.

And we don't like to talk about this because  it makes us uncomfortable because what kind of

capabilities are we're talking about? Like, if  we're talking about easy in the case of violin

playing or piano playing or mountain climbing  or something like that. Well, you know, I don't

personally feel bad if I don't play the violin  well, because I don't play the violin at all.

But the work that we're in is conceptual  work. So when we talked, start talking about

something being outside of our capability  well, you know, it really starts trampling

on our, our egos in a big way. And so,  you know, due to a combination of hubris

and insecurity we never really talk about whether  or not something is outside of our capabilities.

It ends up that it's not so embarrassing after  all, because we don't have tremendously divergent

abilities in that area. The last  thing I want to say about easy

and the critical thing to distinguish  it from simple is that easy is relative,

right? Playing the violin and reading  German are really hard for me.

They're easy for other people, certain other  people. So unlike simple, where we can go and

look for interleaving, look for braiding. Easy  is always going to be, you know, easy for whom

or hard for whom. It's a relative term. The  fact that we throw these things around sort

of casually saying, oh, I like to use  that technology because it's simple. And when I'm saying simple, I mean easy. And  when I'm saying easy, I mean, because I already

know something that looks very much a like,  that is how this whole thing degrades, and we

can never have an objective discussion about the  qualities that matter to us in our software. So

what's one critical area where we, where  we have to distinguish these two things and

and look at them from a perspective  of them being easy and being simple?

It is, it has to do with constructs and artifacts, right? We program with constructs, we have  programming languages, we use particular libraries

and those things in and of themselves when we  look at them, like when we look at the code,

we've right have certain characteristics in and  of themselves, but we're in a business of art.

Right. We don't ship source code and the user  doesn't look at our source code and say, okay, oh,

that's so pleasant, right? No, they run  our software and they run it for a long

period of time. And over time we keep  glomming more stuff on our software,

all that stuff, stuff, the running  of it. The performance of it,

the ability to change it all is an attribute  of the artifact, not the original construct.

But again, here, we still focus so much on our  experience of the use of the construct. Look,

I only had to type 16 characters. Wow. That's  great. No semicolon or things like that.

This whole notion of sort of  programmer convenience. Again, we are infatuated with it.  Not, not to our benefit.

On the flip side, it gets even worse. Our  employers are also infatuated with it, right.

Those first two meanings of easy. What do they  mean. Right. If I can get another programmer in

here. Right. And they look at your source code and  they think it's familiar. Right. And they already

know the toolkit, right. So it's near, at hand.  They've always had the same tool in their toolkit.

They can read it. I can replace you.  It's a breeze, especially if I ignore

the third notion of easy. Which is whether  or not anybody could understand your code.

Right. Because they don't actually care about  that. They just care if somebody can go sit in your seat, start typing. So again, as sort  of a business owners this sort of again,

the same kind of focus on those first two aspects  of easy, cause it makes programmers replaceable.

So we're going to see, we're going to contrast  this with the impacts of long-term use.

Right. What does it mean to use this  long-term and uh, yeah, what what's there,

what's there as all the meat, right? Does  the software do what it's supposed to do?

Is it of high quality? Can we rely  on it doing what it's supposed to do?

Can we fix problems when they arise?  And if we're given a new requirement,

can we change it? These things have nothing  to do with the construct as we typed it in

or very little to do with it and have a lot  to do with the attributes of the artifact.

We have to start assessing our  constructs based around the artifacts,

not around the look and feel of the experience  of typing it in or the cultural aspects of that.

So let's talk a little about bit  about limits. Oh, look, it does move.

This is just supposed to sort of lull you into  this state where everything I say seems true

because I can't use monads to do that.

This stuff is pretty simple logic, right? How  can we possibly make things that are reliable

that we don't understand? Right. It's very, very  difficult. I think Professor Sussman made a great

point saying there's going to be this trade-off  right. As we make things more flexible and

extensible and dynamic in some possible futures  for some kinds of systems we are going to make

a trade-off in our ability to, to understand their  their behavior and make sure that they're correct.

But for the things that we want to understand and  make sure are correct, we're going to be limited.

We're going to be limited in our understanding  and our understanding is very limited, right? There's the whole notion of, you  know, how many, how many balls can you keep in the air at the time? Or how many  things can you keep in mind at a time? It's a, it's a limited number and it's a very  small number . Right. So we can only consider

a few things. And when things are intertwined  together, we lose the ability to take them in

isolation. So if every time I think I pull out  a new part of the software I need to comprehend

and it's attached to another thing I had to  pull that other thing into my mind because I

can't think about the one without the other.  That's the nature of them being intertwined.

So every intertwining is adding this burden and  the burden is kind of combinatorial as to the

number of things that we can, we can consider. So  fundamentally this complexity and by complexity,

I mean this braiding together of things is  going to limit our ability to understand our

So so how do we change our software? Apparently  I heard in the talk today that agile and extreme

programming have shown that refactoring and  tests allow us to make a change with zero.

I never knew that. I still do not know that

because that's not actually a  knowable thing. It's, that's phooey,

If you're going to change software,  you're going to need to analyze what it does and make decisions about  what it ought to do. You know, I mean, at least you're going to have to go and say,  what is the impact of this potential change,

right. And what parts of the software do  I need to go to, to affect the change?

And you know, I don't, I don't care if we're using  XP or Agile or anything else you're not going to

get around the fact that if you can't reason about  your program, you can't make these decisions.

But I do want to make clear here because a lot  of people, as soon as they hear the word reason about they're like, oh my God, are you saying  that you have to be able to prove programs?

I am not. I don't believe in that.  I don't think that's an objective. I'm just talking about informal reasoning,  the same kind of reasoning we use every day to

decide what we're going to do. We do not take out  category theory and say, you know, we, we actually

can reason without it. Thank goodness.  So what about, what about the other side?

Right? There's two things you do with the future  of your software. One is you add new capabilities.

The other thing is you fix the ones you didn't  get, you know, so, you know, done so well. And

I like to ask this question. What's true of  every bug found in the field? Got written.

It got written. Yes. What's a  more interesting fact about it.

It passed the type checker. What else did it do?  It passed all the tests. Okay. So now what do

you do? Right. I think we're in this world. I'd  like to call it guard rail programming. Right.

It's really, really sad. We're like,  I can make change cause I have tests.

Right? Who does that? Who drives their  car around banging against the door?

I'm glad I've got these guard rails because  I'd never make it to to the show on time.

Right. And, and do the guard rails  help you get to where you want to go?

Like the guard rails, like guide you places. No, those guard rails everywhere. They don't, they  don't point your car in any particular direction.

So again, we're going to need to be able to  think about our program. It's going to be

critical. All of our guard rails will fall. We'll  have failed us. We're going to have this problem.

We're going to need to be able to reason about our  program say, well, you know what? I, because maybe

if it's not too complex, I'll be able to say,  I know through ordinary logic it couldn't be in

this part of the program. It must be in that part.  And let me go look there first, things like that.

Now, of course, everybody's going to start  moaning, but I have all this speed. I'm agile

and fast. You know, this easy stuff is making  my life good cause I have a lot of speed.

So what kind of runner can run as fast as they  possibly can from the very start of a race, right?

Only somebody who runs really short races. Okay.

But of course we are programmers and we're smarter  than runners apparently because we know how to fix

that problem. Right. We just fire the starting  pistol, every a hundred and call it a new sprint.

I don't know why they haven't figured that out,  but right. It's my contention based on experience

that if you ignore complexity, you will slow down.  You will invariably slow down over the long haul.

Of course, if you are doing something that's  really short term, you don't need any of this.

You could write it, you know, with ones and  zero's and this is my really scientific graph.

You notice how none of the axes are, there's no  numbers on it. Cause I just, I completely made

it up. It's a, it's an experiential graph.  And what it shows is if you focus on ease

and ignore simplicity. So I'm not saying you  can't try to do both. But if you focus on ease

you will be able to go as fast as possible from  the beginning of the race, but no matter what

technology you use or sprints or firing pistols or  whatever the complexity will eventually kill you.

It will kill you in a way that will  make every sprint accomplish less. Most sprints be about completely  redoing things you've already done.

And the net effect is you're not moving forward  in any significant way. Now, if you start by

focusing on simplicity, why can't you go as  fast as possible, right at the beginning?

Okay. Right. Cause some, some tools that are  simple are actually as easy to use as some tools

that are not, why can't you go as fast, then  you have to think you have to actually apply

some simplicity, work to the problem before you  start. And that's going to be maybe this ramp up.

So one of the problems I think we have is  this conundrum that some things that are easy

actually are, are complex. So let's look. There are a bunch of constructs  that have complex artifacts that are very

succinctly described, right? Some of the things  that are really dangerous to use are like so

simple to describe they're incredibly familiar,  right? If you're coming from object orientation,

you're familiar with a lot of complex  things they're very much available, right.

And they're easy to use. In fact, by all measures, conventional measures, you would  look at them and say, this is easy.

Right. But we don't care about that. Right.  Again, the user's not looking at our software

and they don't actually care very much about  how good a time we had when we were writing it.

Right. What they care about is what the  program does and the, and if it works well,

it will, it will be related to whether  or not the output of those constructs

were simple. In other words, what,  what complexity do they yield?

When there is complexity there? We're  going to call that incidental complaint.

Right. It wasn't part of what the user asked us  to do. We chose the tool, it had some inherent

complexity in it. It's incidental to the  problem. I didn't put the definition in here.

But incidental is Latin for "your fault".

and it is, I think you really  have to ask yourself, you know, are you programming with a loom?  You know, you're having a great

time. You're throwing that shuttle back and  forth and what's coming out the other side is this knotted, you know, mess. I mean, it may  look pretty, but you have this problem, right?

Where's the problem. The problem is the knitted  castle, right? Do you want a knitted castle?

What benefits do we do we get from  simplicity? We get ease of understanding, right? That's sort of definitional. I contend we  get ease of change and easier debugging. Other

benefits that come out of it that are sort of on  the secondary level are increased flexibility.

And when we talk more about modularity and  breaking things apart, we'll see where they, where that falls like the ability to

change policies or move things around. Right. As  we make things simpler, we get more independence

of decisions because they're not interleaved. So  I can make a location decision that's orthogonal

from a like a performance decision. And I really  do want to make, you know, ask the question

agilist or whatever it is is having a test  suite and refactoring tools going to make

changing the knitted castle faster than changing  the Lego castle. No way, completely unrelated.

Okay. So how do we make things easy? Presumably, you know, the objective here is  not to just bemoan the software crisis. Right?

So what can we do to make things  easier? So we'll look at those parts, those aspects of being easy.  Again, there's a location aspect,

making something at hand, putting it in  our tool kit. That's relatively simple.

Right? We just install it. Right. Maybe  it's a little bit harder because we have

to get somebody to say, it's okay to use it. Then  there's the aspect of how do I make it familiar?

Right. I may not have ever seen this  before. That's a learning exercise.

I've got to, you'll get a book, go take a  tutorial, have somebody to explain it to me.

Maybe try it out. Both these things are we're  driving, we're driving. We install, we learn

where it's totally in our hands. Then we have  this other part though. Right. Which is the mental

capability part. And does the part, that's always  hard to talk about the mental capability part.

Maybe because the fact is  we can learn more things.

We actually can't get much smarter. We're  not going to move. We're not going to move

our brain closer to the complexity. We have  to make things near by simplifying them.

The, but the truth here is not that  that's like there are these super, super you know, bright people who can do these  amazing things and, and everybody else is stuck.

Because the juggling analogy is pretty  close, right? The average juggler can do

three balls. The most amazing juggler in  the world can do like nine balls or 12 or

something like that. They can't do 20 or a  hundred. Right? All, we're all very limited,

you know, compared to the complexity  we can create, we're all, you know,

statistically at the same point in our ability  to understand it, which is not very good.

So we're going to have to bring things towards  us and because we can only juggle so many balls,

you have to make a decision.  How many of those balls

do you want to be incidental complexity and  how many do you want to be? Right. How many

extra balls you won't have somebody throwing your  balls that you have to try to incorporate in here?

Oh, use this tool. And you're like, whoa. You  know, more, more stuff who wants to do that?

All right. So let's look  at a, let's look at a fact.

So I've been on the other side of this  complaint and I, I like it. We can look

at it really quickly. Only because it, it's  not, this analysis has nothing to do with the

usage. This complexity analysis is just about the  programmer experience, right. So parens are hard,

right? They're not at hand for most  people who haven't otherwise used it.

And what does that mean? It means that like,  they don't have an editor that knows how to do,

you know, paren matching or move stuff around  structurally, or they have one and they've never

loaded the mode that makes that happen. Totally  given. Right. It's. Nor is it familiar? I mean,

everybody's seen parentheses, but they  haven't seen them on that side of the method!

I mean, it's just crazy,

but you know, I think this it's,  this is your responsibility,

right? To fix these two things  as a user, as a potential user,

you got to do this. But we could dig deeper. Let's  look at the third thing. Did you actually give me

something that was simple. Is a language built  all out of parens simple in the case I'm saying?

Is it free of interleaving and braiding? And  the answer is no right. CommonLisp and Scheme

are not simple in this sense, in their use of  parens because the use of parentheses in those

languages is overloaded, right? Parens wrap calls,  they wrap grouping, they wrap data structures,

right? That overloading is a form of complexity  by the definition of, you know, I gave you, right.

And so if you actually bothered to get  your editor set up and learn that the

parenthesis goes on the other side of the  verb this was still a valid complaint. Now,

of course, everybody was saying easy. It's  hard. It's complex in that we're using these

words really weekly. Right. But it was hard  for a couple of reasons you could solve.

And it was not simple for a reason that  was the fault of the language designer,

which was that there was overloading. Right. And  we can fix that. Right. Just add another data

structure. It doesn't make lists, not lisp to have  more data structures, right. It's still a language

defined in terms of its own data structures, but  having more data structures in play means that

we can get rid of this overloading in this  case, which then makes it your fault again.

Right. Because now this, the  simplicity is back in the construct.

And it's just a familiarity thing,  which you can solve for yourself.

Okay. This is an old dig at list programmers.  I'm not totally sure what the what he was talking

about. I believe it was a performance related  thing that lispers would just, they cons'ed up

all this memory and they did all this evaluation  and it was, it was a pig. LISP programs at that

time were, were LISP programs at that time  were complete pigs relative to the hardware.

So they, you know, they knew the value of  all these constructs, right? This dynamism, dynamic nature, these things are all great.  They are valuable. Right. But there was this

performance cost. I'd like to lift this whole  phrase and apply it to all of us right now.

Right. As programmers, we are  looking at all kinds of things. And I just see it, you know, read hacker news  or whatever. It's like, oh, look, this thing has

this benefit. Oh, great. I'm going to do that.  Oh, but this has this benefit. Oh, that's cool.

Oh, that's awesome. You know, that's shorter.  You never see in these discussions, was there a

trade off? Is there any downside, you know, is  there anything bad that comes along with this?

Never nothing. It's just like, we look all for  benefits, right? So as programmers now, I think

we're, we're looking all for benefits and we're  not looking carefully enough at the byproducts.

So what's in your toolkit. I have  you know, I have these two columns,

one says complexity, and one says, simplicity,  the simplicity column just being simpler.

It doesn't mean that the things  over there are purely simple.

I didn't label these things bad and  good. I'm leaving your minds to do that.

So what, what things are complex and what are  the simple replacements. I'm going to dig into

the details on these. So I won't actually  explain why they're complex. We're going to say state and objects are complex and values  are simple and can replace them. In many cases,

I'm going to say methods are complex and  functions are simple and namespaces are simple.

And the reason why methods are there because often  the, the space of methods the class or whatever

is also a mini very poor namespace. vars  are complex, and variables are complex.

Managed references are also  complex, but they're still simpler.

Inheritance, switch statements, pattern matching  are all complex and polymorphism ala carte is

simple. Okay. Now remember the meaning of simple,  meaning of simple means unentangled. Right.

Not twisted together with something else. It  doesn't mean I already know what it means. Right?

Simple. Does not mean "I already know what it  means." Okay. Syntax is complex. Data is simple.

Imperative loops, fold, even  which seems kind of higher level

still has some implications  that tie two things together. Whereas set functions are simpler.  Actors are complex and cues are simpler.

ORM is complex and declarative  data manipulation is simpler.

Okay. Even Eric said that in his talk,  he said it really fast near the end.

"Oh yeah. And eventual consistency  is really hard for programs."

Conditionals are complex in interesting ways and  rules can be, can be simpler. And inconsistency

is very complex. It's almost definitionally  complex, right? Because consistent means

to stand together. So inconsistent means to  stand apart. And that means taking a set of

things that are standing apart and trying  to think about them all at the same time. It's inherently complex to do that. And anybody  who's tried to use a system that's eventually

consistent knows that. Okay. So there's this  really cool word called complect. I found it.

I love it. It means to  interleave or entwine or braid.

Okay. I want to start talking about what  we do to our software that makes it bad.

I don't want to say braid or entwine  because it doesn't really have the good,

bad connotation that complect has.  Complect is obviously bad. Right?

It happens to be an archaic word, but you  know, there's no rules that say you can't start using them again. So I'm going  to use them for the rest of the talk.

So what do you know about  "complect"? It's bad. Don't do it.

Right. This is where complexity comes from.  Right? Complecting. That's very simple.

Right? And in particular, it's something  that you want to avoid in the first place.

Right? Look at this diagram. Look at  the first one. Look at the last one,

right? It's the same stuff in both those diagrams,  the exact it's the same strips. What happened?

They got complected. And now it's hard to  understand the bottom diagram from the top

one, but it's the same stuff.  You're doing this all the time.

You can make a program, a hundred different ways. Some of them it's just hanging there. It's  all straight. You look at it. You say, oh,

I see it's four lines this program, right. Then  you could type in four lines in another language

or with a different construct. And you end up with  this knot. So you've got to take care of that.

So "complect" actually means to braid together.  And "compose" means to place together.

And we know that right. Everybody keeps telling  us what we want to do is make composable systems.

We just want to place things together, which  is great. And I think there's no disagreement,

right? Composing simple components. Simple in that  same respect is the way we write robust software.

So it's simple. Right? All we need to  do is (everybody knows this I'm up here

just telling you stuff you know), we can make  simple systems by making them modular. Right.

We're done. I'm like halfway through my talk.  I don't even know if I'm going to finish. It's so simple, right? This is it. This is  the key. No, it's obviously not the key.

Right? Who has seen components that  have this kind of characteristic?

I'll raise my hand twice because not enough people  are raising their hands. It's ridiculous. Right?

What happens? You can write modular software  with all kinds of interconnections between them,

right? They may not call each other,  but they're completely complected.

Right. And we know how to solve this. It has  nothing to do with the fact that there are

two things it has to do with what those  two things are allowed to think about.

If you want to really anthropomorphize and what  do we want to make things allowed to think about?

And only these things, some abstractions, I  don't know if that's coming out that well,

that's a dashed white version  of the top of the LEGO, right?

That's all we want to limit things to. Cause now  the blue guy doesn't really know anything about

the yellow guy and the yellow guy doesn't  really know anything about the blue guy and they both become simple. So  it's very, it's very important

that you don't associate simplicity with  partitioning and stratification, right?

They don't. Right. They are enabled  by it. If you make simple components,

you can horizontally separate them  and you can vertically stratify them.

Right. But you can also do that with complex  things and you're going to get no benefits.

And so I would encourage you to be particularly  careful not to be fooled by code organization.

Right. There's tons of libraries that look,  oh, look, there's different classes. They're

separate classes. They, you know, they call  each other and sort of these nice ways, right. Then you get out in  the field and you're like, oh my God, this thing presumes, that, that  thing never returns to number 17. What is that?

Okay. I'm not going to get up here and tell  you, state is awesome. I like state. I'm not

a functional whatever guy, whenever I'm going  to say instead I did this and it sucks. Right.

I did years and years, C++ you know, He-Man  stateful programming. It's, it's really not fun.

It's not good. It's, it's never simple. Having  state in your program is never simple, right?

Because it has a fundamental complecting that  goes on in its artifacts, right? It complects

value in time. You don't have the  ability to get a value independent of,

of time, and sometimes not an ability to get  a value in any proper sense at all. But again,

it's a great example. This is  easy. It's totally familiar. It's at hand, it's an, all the programming  languages. This is so easy. This complexity

is so easy. Okay. And you can't get  rid of it, everything. So I'll have I

have modularity. And that, that assignment  statement is inside a method, right? Well,

if every time you call that method with the  same arguments, you can get a different result.

Guess what happened? That complexity. It  just leaked right out of there. It doesn't

matter that you can't see the variable,  right? If the thing that's wrapping it is

stateful. And the thing that's wrapping  that is still stateful. In other words, by stateful, I mean, every time we ask it the  same question, you get a different answer.

You have this complexity and it's like  poison and it's like dropping, you know,

some, some dark liquid into this, to a vase. It's  just going to end up all over the place. The only

time you can really get rid of it is when you  put it inside something that's able to present

a functional interface on the outside, a true  functional interface, same input, same output.

You can't mitigate it through the  ordinary code organization things.

And note in particular, I didn't  talk about concurrency here. This is not about concurrency. This has nothing  to do with concurrency. It's about your ability

to understand your program. Your program was  out there, it's single-threaded it didn't work.

All the tests passed. It, made it through  the type checker, figure out what happened,

right? If it's full of variables, where are  you going to need to try that? Recreate the

state that was happening at the client when  it went bad. Is that going to be easy? No.

But we fixed this, right? Your language, your  new shiny language has something called var

or maybe it has refs or references.

None of these constructs make state simple.  That's the first primary thing. I don't want

to say that even of Clojure's constructs,  they do not make state simple in the case I'm talking about in the, in the  nature of simple I'm talking about but they're not the same, right? They  all do warn you when you have state. And that's great. Most people who are  using a language where immutability is

not the default, and you have to go out of  your way to get it, finds that the programs

they end up writing have dramatically like  orders of magnitude, less state than they

would otherwise. Cause they never needed  all the other state in the first place.

So that's really great. But I will call  out Clojure and Haskell's references as

being particularly superior in  dealing with this because they

compose values and time. They're  actually little constructs that do two things. They have some abstraction over  time and the ability to extract the value.

That's really important. Because that's, that's  your path back to simplicity. I mean, if I have

a way to get out of this thing and get a value  out, I can continue with my program after I've

passed that variable to somebody else or  a reference to something that's going to find the variable every time through the varying  thing, I'm poisoning the rest of my system.

So you know, look at the var in your  language and ask if it does the same,

the same thing. All right, let's see why  things are complex. State. We already

talked about it complects everything  it touches. objects, complect state,

identity and value. They mix these three things  up in a way that you cannot extricate the parts.

Methods complect function and state ordinarily,  right? In addition, in some languages they

complect namespaces right. Derive from two  things in Java, they have the same name, method.

It doesn't work. syntax, interestingly

complects meaning and order often  in a very unidirectional way.

Professor Sussman made the great point about data  versus syntax and it, you know, it's super true.

I don't care how much you really love the syntax  of your favorite language. It's inferior to data

in every way. Inheritance complects types,  right? So it says these two types are complected,

that's what it means. Inheritance.  Complecting. It's like it's,

it's definitional, right? Switching and matching.

They complect multiple pairs of  who's going to do something and

what happens. Right. And they do it all in  one place in a closed way. That's very bad.

Vars and variables, again, complect value  in time, often in an inextricable way, you

can't obtain a value. We saw a picture during a  keynote yesterday this amazing memory, right where

you could dereference uh, an address and get an  object out. I want to get one of those computers.

Right. Have you ever used one of those  computers? I can't get one. I called Apple

and they were like, no. The only thing you can  never get out of a memory address is a word,

a scalar, right? The thing that was all  derided, right? Recovering a composite

object from an address. It's not something  computers do. None of the ones that we have.

So variables have the same problem. You  can not recover a composite mutable thing

with, with one dereference. Loops and fold  loops are pretty obviously. Complecting what

you're doing and how to do it. Fold is a little  bit more subtle, right? Cause it seems like this

nice. Somebody else has taken care of it, but  it does have this implication about the order

of things this left to right bit. Actors complect  what's going to be done and who's going to do it.

Now professor Sussman said the, all these  talks have acronyms and I couldn't actually

modify my slides in time. So object relational  mapping has, oh my God complecting going on.

You can't even begin to talk  about how, how bad it is. Right. And, and, and you know, if  you're going to do like, duals, right?

What's the dual of value, is it co-alue?  What's a co-value? It's an inconsistent.

Who wants that. And conditionals, I  think are interesting, right? This is, this is sort of more cutting edge area. We  have a bunch of sort of rules about what

our program's supposed to do. It's  strewn all throughout the program.

Can we fix that? because that's complected with the structure of the program and  the organization of the program.

All right. So if you take away two things  from this talk one would be the difference

between the words "simple" and "easy". The  other, I would hope would be the fact that

we can create precisely the same programs we're  creating right now with these tools of complexity

with dramatically drastically simpler tools.

Right. I did C++ for a long time, I did Java. I  did C#. I know how to make big systems in those

languages. And I completely. You do not need all  that complexity. You can write as sophisticated

a system with dramatically simpler tools, which  means you're gonna be focusing on the system,

what is supposed to do instead of all the guck  that falls out of the constructs you're using.

So I'd love t

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers

Sign in to join the discussion.

Make the first comment.

That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 536 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks