Check out a free preview of the full The Good Parts of JavaScript and the Web course:
The "Two Systems" Lesson is part of the full, The Good Parts of JavaScript and the Web course featured in this preview video. Here's what you'd learn in this lesson:

Doug Crockford begins his course on the Good Parts of JavaScript with a brief look at the course agenda. He then shares a metaphor for human thought that separates it into two systems: The Head and The Gut.

Get Unlimited Access Now

Transcript from the "Two Systems" Lesson

>> [MUSIC]

>> Douglas Crockford: So good morning, I'm Doug Crockford. This is three days of the good parts. Unexpectedly, JavaScript has become, perhaps the most important programming language in the world, which is surprising, because it's also the world's most misunderstood programming language, which we'll try to fix some of that this week.

[00:00:56] So, this is the outline for the course. Today is going to be a series of five lectures and I apologize for that. There's a lot of information I need to give you and the only way I know to do that is to say it. So you're gonna have to listen to me whining on all day, but tomorrow will be much better.

[00:01:14] Tomorrow, we're gonna workshop. We're gonna have fun with functions. You could be writing programs and it's gonna be great. We're gonna have a much better time tomorrow. Then on the third day, we'll do some more fun with functions, then we'll also look at some very important topics. Security, asynchronicity, which is something you have to deal on a lot with, especially in servers and the better parts looking at the future of this language and other languages So that sound agreeable.

[00:01:41] So, let's begin with part one programming style and your brain. These are two topics which appear to have nothing to do with each other. Programming Style is the part of your program that the compiler notice and some people think that because the compiler doesn't care, you shouldn't care any styles as good as another it's just a matter of taste.

[00:02:02] I'm gonna try to persuade you that that is not the case, that some styles are significantly better than others and then your brain. Your brain is that big wad of meat in your skull that you think with and what possible connection could there be between these two things?

[00:02:18] Well, turns out there is a connection, a surprising and important one. I'm gonna be misrepresenting the work of Daniel Kahneman, the Nobel Winning Psychologist. Now, Nobel does not give a prize for psychology. So they gave him the award for economics, but he's not an economist, but he found that one of the fundamental assumptions of economics doesn't hold.

[00:02:38] That is that in any transaction, a party can be expected to pursue their own best interests. Kahneman shows this is not the case if a party is a human being, because human beings do not think the way economists think we think. In fact, none of us think the way we think we think.

[00:02:56] And the more you study Kahneman, the more amazing it is that we ever get anything done at all. So Kahneman has a metaphor for human thought based on the interaction of two systems. System two and system one. System two, which we can think of as the head is the higher level one.

[00:03:14] It's analytic. It's algorithmic. It's where we do mathematics and reasoning, and logic. It's a really sophisticated machine. It requires a tremendous amount of effort to use and it is very slow. So, we leave it turned off as much as possible. It's because that system is so slow that we had to invent computers, because system two is not capable of generating all of the numbers that society needed in order to do it social evolution.

[00:03:43] So we needed to come up with machines to do that processing for us, then there's system one. System one, you can think of as your gut. It is intuitive. It's heuristic. It's associative. It is very, very fast. It requires no effort. And in fact, you cannot turn it off.

[00:04:00] It's on all the time and the idea that we have these two systems is not new. I mean, we all have this intuitive sense that we've got these two systems and sometimes you can even hear them. Sometimes if you're confused about something important, you can hear your head telling you one thing and your gut telling you something else.

[00:04:16] We've all experienced that. What Kahneman found was how the two systems are connected. It turns up system two gets its assumptions, its givens, its working set from system one and is not aware of that connection. System two thinks it's getting the stuff from the vault of deep truth, but it's not.

[00:04:37] It's getting it from system one and system one, because it's an approximate system sometimes gets things wrong. And if you have a logical system with false inputs, you can get false outputs and it turns out we do this all the time.