Hello, welcome to Meta Refresh. I know it's been a long day, but it's been great, so it's been great for me and people. I want to thank Hasgeek for putting this together. Just like the last time, just like every last time they were all coming, trying to make sure that it happened today. I thank them for figuring out what's possible at Hasgeek. Oh, I'm sorry. This is a small workshop. The workshop doesn't come today. We'll be talking about the front-end bit process. Historically, front-end developers essentially just written that forward and go to the back-end base to deploy it into production. And it's been the back-end base not to figure out how to include it on their HTML pages. And the back-end guys don't really get that much of a commitment, or at least it is really reduced. This is obviously back with JavaScript as a trial language. Of course, these have become a lot more serious now. Giant applications. All those desktop-calibre-level applications are being made with HTML5 CSS and JavaScript. And a whole bunch of things are happening in HTML5 and CSS3. But now it's come to that it's now our responsibility as front-end developers to be professional about it and figure out all the details by ourselves. How are you going to serve it to the browser at optimal speed? What's the caching required for this? How are you going to make packages? How are you going to optimize for different page loads? Some pages might want to set you up for a little bit more. How do you optimize for things like that? That is what this talk is about. It's about the front-end bit process. It's called the last mile because you have to understand that the code that you write is not the last step on its way to becoming part of the product. You have to package it and document it and test it and get it to a place where it's seamless. It shouldn't be part of a daily order. It should just be running in the background and it doesn't matter whether you change the file. Anyway, that's the idea. The point is that we have to go with the last mile in deploying our front-end assets. My name's Pai. My actual full name is Neel. I'm exploring all those things by... I think I might be seeing a couple of them somewhere. My friend's called me Pai and I worked at a bunch of places. I'm not really proud of having worked at a bunch of places. I'm not mastered very well. My point is that I work with startups, contracts, development of India and I've seen good code, I've seen bad code. I work at YAML right now which has the combination of the best startups in the world and don't ask me which is mine. So sometimes there are a few things that are common to the front-end build process amongst all of you guys. At least for the people who care about you, who care about you. You have a good product out there. Let's talk about you. The assumption is that currently your front-end build process sucks. If it doesn't, who knows? You guys have given much more effort than about 90% of the front-end programmers out there. But anyway, your boss is probably old school, from the early 90s. He believes his entire stack is Java and YAML is a skin on top of it. Or possibly you have a small school who keeps talking about all the great things that his company's going to do for the world but doesn't really care about the product. In any way, point is that there are a lot of places where quality of your code can suffer and the quality of your deploy also. There are a few common use cases. For example, you are not doing any friends. You are essentially serving straight out of the directory. You have to understand that you will see how that's kind of wrong. But the point is that you're serving raw source, comments and all. There are various methods and obviously don't have any discoverings. How many people care about JavaScript? There's more than the last time I asked. Three people this time. When it boils down to a JavaScript, it's now a serious language and we better handle the test for it. There are no ways about it. I'm not going to defend it anymore. If your code doesn't have tests or coverage, then I don't believe that it works. And no matter clicking on the dropdown is going to fix that problem. You probably have no logs. In the last talk, there's no real user monitoring. Not a lot of people do it. Not a lot of people know how long it takes for the average person in Australia to see your page for your page to load. And without this information, this is all very useful data that you should actually involve it because you can use it to make the product better. And if that's not a good reason, I don't want this. Let's start at the base. What is a build? We can learn a lot from the server side. The server side ties, back-to-back transfers. Basically, it consists of a few steps. These are what I believe are important. One is compilation. Compilation essentially means, let's say, you're at C++ and I get translated to machine code. You're writing copy steps and you're writing JavaScript and it has become compressed and minified JavaScript. You might want to run instrumentation on your code. For example, in JavaScript, you might want to see what the code is. For that, you need another build task where you actually run all your JavaScript through sub-processing which instruments the code for you. There's optimization. This is not just a build processing. Of course, this isn't just about g-loading your files. It's also about thinking about how it's going to get deployed on your HTML page. I'll be making sure that all your CSS is on top. I'll be making sure that all your scripts are at the bottom. What happens is somebody clicks a button before your job loads. So you have to figure out all those details and ideally those, again, should be automated. As much as you can. And then a deploy. It could be as simple as moving from your loaded desktop machine to the server. Possibly FPD. You could be using Git to deploy. You could be uploading it to S3. I'm not S3. You're somewhere else on the cloud. And then you'll find out what the UR target URL for that is and use that instead of reference. In any case, all these things, you might want to run test cases. These things comprise a page, a single page. When you say I'm firing the page or I'm going to run my continuous integration page, that means you're running one set of tasks which converge your source from what you've been working on to essentially something that's ready to deploy on some target. Might be on development, might be on production. Somebody came up to me and said, Oh, in the last two weeks I've written about three different custom page systems.  I used to tell people that, oh, it's awesome. Maybe you should try writing your own grade system because you'll learn more about it. Which is true. You know it for yourself. But there's a whole lot of work that I've gone into packages. A lot of people started with me at least. And you can use those things. The idea is not to build your own build system, but to make a build file, a build process that is fine tuned for your product or for your company or for your website. So you take these tools, you choose the ones that you like, the ones that you're comfortable with, mess around with it and make a build file, which will get you right out of the giant demo. In any case, there are a whole bunch of key solutions. These are tools which try to do a whole bunch of things for you. My absolute favorite is Jamet. It's a Ruby-based package management system with compresses, it deploys, it's very images and data-oriented CSS. It's very, very sexy. So in Rails, my mind also does a whole bunch of the same things. If you guys have any Python developers here, Django might be a problem. So yeah, Django compress, I've used it in a previous project. I think the Django recommended one now is Django static files. It's a little too rudimentary for me. Basically, it's just sending up the same files, but with caching and so on, put on top of it. On Node.js, there are a whole bunch. You can go to the Node wiki and check out the list of modules. One that stands out is Builder. Builder is really nice. It does JavaScript, CSS, packages, things like that. And Sangam is shameless plug. I actually wrote that. It's not too bad. I don't use it in production, but it's what I did to it. It's not learning about it. Learn from a lot of people. For me, the most enlightening moments about learning about build systems were going through server-side processes. To understand how they break up tasks into, you know, two of the things that are built, they won't describe the entire build in one place. I say, okay, take all the tasks out. I take all the files and files, I compile all the files, instrument them, and so on and so forth. But my point is, stop your server-side. What do we do? One is, they have a wealth of knowledge in this domain that you could learn from. Second is, eventually, they're going to have to they'll be serving. So it's good to write up in the beginning saying, you know, I'll give you an output for KC5 because you'll have all the aliases for files and things that you want to replace it with. A worship Steve Souters. SteveSouters.com. In my description, I'd say that I'm going to show you numbers about why it's important, our friends and stuff. But that's just it. My entire slide would just say, SteveSouters.com. Go over any heavy articles, see all his thoughts. Loads of good stuff that he's, essentially, of the authority on it. Start profiling your own stuff. Take the last one such that you could open it up and open a file, see where all your scripts are loading, see if you can do anything. Essentially, you practice and you become better at understanding the patterns when it comes to custom projects.  Of course, Weislow is the popular one. There's page 3 from Google. There's SpeedRacer, which is not so much for loading of assets, but actually for checking out how it does this part and it makes you do it. You see where it is, which part of the there's CPU is binding upon. It's pretty cool. So we actually spotted a couple of issues with our code. We moved it to web workers. That's all our problems. So SpeedRacer is pretty good. It uses pro-modified versions of it. Moving on. This is one of my slides from my last talk. Own the browser. The browser is yours. You're the front-end developers. You should not expect the back-end guys to do anything for you. And in fact, it's the on-right answer question for you to expect them to listen to. This is what you want to get from that. Just like I said in my last talk, your code is your responsibility. If somebody finds that it's broken, and it's because you didn't write a unit test case for it because you are lazy, or because you don't know how to monetize it in comments for a while, you don't want to put it on. Now, sir, it's going to work anyway. You own the browser. It is your direct responsibility. All the way until the first file that the HTML is writing for the back-end guys. Those guys have given. It turns you into 0.019 seconds. We have to make sure that we match the kind of efficiency that the back-end guys have and make sure we do our very best to send the answers to the browser that's easy and as fast as possible. My point is being responsible. A couple of basics. Most failed files, they consist of a few common operations. File, read, write, for example, you read sources and you write a combination of them to another file. Directly travel, search all JS files right under the site and find everything in this pattern. Take all those files to something like that. The idea of environments. This is quite simple idea. You don't even have to explain this too much. The idea is that your local machine when you're developing, when you're writing a line for text mail, when you're writing your own code. That is nothing like production environment. But you're obviously running the core code for this. So the idea is to understand that your code might be deployed on a number of targets. For example, development. Same, which might be delivered to the company. So you might not have loaded the assets to the CDN yet. It might simply be posted locally. Production, production is also simple. Make sure you have a monitoring base to make sure your JS files are 10% smaller and so on and so forth. The idea is that you should be able to specify environments as configurations. For example, compress, in my development project, I will compress as well. But for production I love this too. Some tools for build systems. These build systems basically give you the ability to make tasks. You know, you can say create a new task called link. And in links, you'll write your own code which will pull the code from the files and then return as well. And you can return the results back up to the build system. Rake is popular with the Ruby guys. Jake is becoming popular with the Node guys. In fact, leaflet I think is interesting. There's obviously make, there's ant, there's warp for Python guys. For what if one might use none of these? I use the same Node script just to show you how you can write to it. But this is work that has one in it. Pick your platform of choice, choose it and write your own code. Compressors and validators for JavaScript, I usually use Uglify. For what it's worth, you guys can write down just the names. It's easy to Google. Anyway, so for JavaScript, I use Uglify and there's YUI Compressor also and Closure Compiler. Closure Compiler is cool. It actually analyzes your code and you can check your code files. That's cool. For CSS, there's CSS meant that's also from essentially it's a fork of YUI Compressor. CSS would minimize it. For images, suppose I want to remove, make sure that every PNG that's been termed as any of the meta-information is super well useless. Data, you can use PNG crush. Image magic has a huge utility library of stuff you can do in images. Am I going too fast?  Have I said anything wrong? You know? Not yet. Not yet. Fair enough. You can stand up and say, you lie. Anyway, so for validation I use JSON, W. Stockford. CSS Lint is this new thing out by, I think Rebecca we participated in it. It is really strict and you'll feel really bad. I mean, if JS Lint made you feel bad, CSS Lint is really bad. When it comes to HTML validation there's a problem, especially when it comes to dynamic applications, because obviously you have a whole bunch of tags and they're not going to be standard HTML. We have tried a couple of strategies, but then HTML validation didn't really matter for us that much, I guess, because we were writing with template languages. But the idea is that your worst case scenario, what you can do is run the working server, serve up whatever the application is and then you can go to those three and try it as something that's really new. I think it came out like maybe for yesterday. It's crazy, you can just mention images and it'll generate this file for you. If you're writing your CSS with the side assignments like SAS or less, I'm sure there will be a port for less and SAS eventually, but it's great. I just tried it out yesterday. You just mentioned your own icons and it might generate a nice file for you to generate all that jazz, really killer. Retina.js is used for serving alternate assets for the iPhone Retina display screen. It chooses lower resolution if it has it all. It's ratio is 2 instead of 1 because of the IDP. Stylers, lessons, SAS. Did any of you guys go for the SAS? No, the SAS focus next. Wasn't there a ninja CSS? We went for that. What did you use it for? So these are great. They make your code really maintainable. CopyScript is the new dialect that you can use for your iPhone. Check it out, it's very cool. There is one specific problem with CopyScript that nobody really talks about. If you start writing a project in CopyScript you have to keep writing in CopyScript. And it's becomes kind of a pain. That means your entire team has to learn the language, even if it's just you who likes it. But it's beautiful. I'll give you that. If you can get your team to convert to it, it's gorgeous. Enderjs is awesome. The only thing you can do here for Node is package management. So Enderjs tries to do that for browsers. You can say enter back, enter back, and it pulls it from a database and just makes you a script. So you just use root, ender.js, and you do it. It's pretty cool. It's like a lo-fi method of dependency management, but it works. For testing, again, I'm not going to go into too much detail about this or drag my finger and say, you better write unit tests for your code. Do I look sufficiently common? But write unit tests for your code. Get good coverage. The kind of thing that keeps your boss happy. You can use Mocha. Mocha is great. Mocha is by T.J. Hallway, Chuck, very prolific 22-year-old. YUI test is awesome. And it has a great little tools ecosystem around it. I'll talk about that in a bit. JS unit is one of the older ones. Then there's Jasmine from Pivotal Labs, and some other people use that across the world now. That's pretty cool. Platforms to actually run your unit tests. If you don't want to be the guy who's like, okay, I'll do the unit test, which means you're going to open every HTML file and other tests. So it has to be automated. So some tools for that are getting jimmed, JS test driver, and Selenium. These actually pop up a browser for you and run the tests, collect the results and let you know about it. PhantomJS and CasperJS is my current favorite way of running unit tests. The command I have basically opens up a headless browser which means you take a look at the window. It's about 1224pxy and you can see what you want. It runs all the unit tests for you and just collect the results right there. No browser for nothing. Which means it's great to deploy for CI. Chai.phantomJS and CasperJS. Very cool. Tools for coverage. I know about Node.com and JS coverage. I haven't really experimented with too many others. Oh, of course that's YUI test coverage. Which comes with YUI test. It basically takes your source files and puts a whole bunch of links that's why you need to try the code with instrumentation. That's how you do it in JavaScript. And that's why when you actually run your code it keeps a track of what our lives have in this period. That's what we do by complex JS. So, let's say you write this randomly to me. Now get config.x is going to be 23. Then do this. Basic problem with coverage is that it will also be kind of where you will never hit the object. If you are saying age if age is less than 0 then use this code. But age is obviously never less than 0. The idea is that you need to make your code and once you run your unit test over it that means your unit test that section of code which was run. That's coverage. That's not that coverage. It basically means that much of your code was actually tested. 75% reliability that your code will work. It's not exactly that number. Don't overdo it. That's my point. Don't start writing unit tests just to get 100% coverage. That's the easiest thing to do. Just go through all your standard cases. Try it for functionality. Test for functionality. Make sure if I set map, center as the center of the testing then I should actually go over there. Stuff like that. That way every bug feature gets a unit test. How I write code now? What the bug comes in saying that this button doesn't do what's expected. I first write the unit test which fails for this year. If you click on this button then it will do so and so. And then I actually write the code and then the test passes. That's the basic idea. That's the basic idea. Once there's a bug, if you write a unit test then it can be calculated or if it occurs again your unit test will be very complicated. Compilations are things you might want to do in your build process. You might want to generate sprites using stylus sprites or pick it up from some other source where you are actually signing the livenings and stuff to you. This is pretty cool. Jamet actually does this by default. You should check it out. Your images can be embedded directly in your HTML or CSS or JavaScript. Data URIs basically takes the binary screen encodes it to basic C4s and just comes with that. And your browser? Most browsers except for the one browser that you know I'm talking about support set. In ID you have to use mxtml but there are a couple of bugs around that but please go and investigate this. It's a beautiful thing. It's how Apple managed to show images in Gmail. Do you remember there was a period of time when Apple promoted the mail sure the images even though they were embedded in the entire data. It's been done a whole bunch of times but it's really cool. I love this. You might want to see about making sure your call script is nice and modularized using, I don't know, require or even just separate files. So that way you can make packages. You can see if my main page package is I want J3, I want underscore, I want back both and I want that cool animation. You can specify files and that's your package. Asynchronous module definition, common JS, YUI those guys increment module systems where instead of saying require xy3.js, you'll say require module xy3 and somewhere else you'll mention that module xy3 might be 5 to 3 files so for 5 to 3 files pass it and there's no time limit. You basically modularize it. Get it to a place where it's not just .js files and more. They are living bringing objects. The multiple subdomain hack was spoken about in the talk, a couple of talks before this. Turns out that browsers have this limit on number of parallel connections that can be done to a browser, to a server at a time, I think it's 8 or something like that. But there's a need for the hack around that. If you start serving from multiple subdomains those are counted as different things so you can actually have gain coming from the same one. I think too. 1.1 but ideas that should be able to serve assets of several subdomains or separate targets. I don't know.  You can inline your css or javascript. For example, if it's a home page but nothing is changing you can remove all your other features and just inline the css and the javascript. This is not to say that this is right to your css or javascript in the html. You just say whenever you're talking about script type, I point to this just pull the script itself and talk it over with you. You can put that behind a caching layer and that's basically one request.  That should be fine for them. And obviously you use CDNs and set your caching on high. I'm not going to talk. You need me to talk in detail about caching because the headers have the ability to cache the data like images or files and when you're actually sending the data from the server, for example you can specify days on the headers that you set but how it is to be cached. For example this image will never change store it forever. Store it for like 30 years. But this files will never change. You can see this by experimenting and say something like Facebook go to facebook.com, load the page and check out your file you'll see a whole bunch of them are really big, for example 400 I suppose but none of it has been loaded. It says loaded from cache. That means it actually has saved from previous time and it's loading them. That's caching. So you have to make sure that when you upload to your static server may it be local or wherever else in the cloud or in your own data center you make sure that you have your static assets tuned to go to the target and see that for as long as possible. It leads to a couple of problems which I'll get to in a bit client-side templating you guys know what templating on the JavaScript side is it was like handlebars embedded JavaScript and underscore.templating if you have static developers obviously know what this is for. The idea is that you can write a template and download data and create part of it and generate html. What is this for? And in terms of that we can use this templating on the front end as well. For example, let's say you have a different Twitter page, you still have to construct a html. Now the old way of doing it would probably have been you know, open your tag and close the code plus this is on the bottom, construct the html and so on and so forth. But now we can use very strong template clients directly in the browser. So you'll say get the Twitter feed. This is the template. If I dump all the data I entered in the html required for to show the view, that's templating. So client-side templates are awesome except there are way too many people now including it directly into the html. I'll say this way I'm doing an idea of one so I'll just pull the html of it. I'll show you a much more maintainable way of doing this now. Logging. Again, if you guys have around 2 talks about the only way that you're going to make a product better is if you listen to your customers or at least you try to find out what problems they're having or you can go on log on the html. What instead you can do is you can actually start tracking the movements of the user on the html itself. For example, there's heatmap.js what it does is it deletes the heatmap of where the user is and moves around the page where he's spent the most time. If we don't have, as front-end developers we have to understand that this is our job again. If we can't be a guy who as you imagine that, no one else is going to do this. This is truly a front-end developer job. If you don't start putting little beacons on the page if you have something wrong with the program, for example, but any logging service that can log back to the server if you don't you won't get to a place where you know how long it takes for somebody in Australia to log your baby and most of the time you're getting a bunch of money from if you fix that problem, you get no money otherwise people start saying it's not a good idea. So start logging all the important stuff and save it to clients and database Continuous integration. Does anyone do any CIO on their code back and forth on it? So you guys use code check-ins and check-ins Continuous integration. Yeah, that's it. The idea is that every time you make a comment it doesn't it adds sand to make sure that everything is okay. That's the basic theory. It could happen on comment or it could have come by this order. But the general idea is that there are four people on the team every time one person makes a comment there will be a machine sitting by the side which runs through all your movement test makes sure nothing is broken and lets you know that it's in your name and your manager gets the information. But yeah, continuous integration. It should really look like an integration. Again, it is absolutely no reason that client developers can't make use of this now that we can run unit tests directly in the command lines without having to talk to the members. Can someone tell me how much time it takes? So I wrote a small parent system. What did I write a parent system for? A website. I noticed a couple of things that I think they might be doing wrong and implemented my custom based system on top. A few of the tools that I used I'm not sure if the camera is going to get this far and say for file traversal I used three tools. One is blob. It lets you say something like xysslash starstarslash star.js and it will return your list of files. It's quite cool. That's all it does and it's quite nice of that. Async because I was writing a node and it's called back and I'm writing with JavaScript. I used async to use promises and it helped out. I'll show you the code as well. I used wrench for directly traversal for creation. For example if you want to make the directory a slash b slash c you don't want to really try to it says must make a then make a this wrench is a bunch of utilities that makes it easy. For command line I used commander. I could have used j or rape or not rape but j but I decided I wanted to get more closer to the menu. Commander is something that helps you create a menu list of options for the for example you can write something like project.databit where you do a bit production. I used that for that. Using js lint and css lint for linting. For compressing I'm using uglyphi and node css compressor which is basically css min. I'm doing some small micro templating. I'll show you the code for that later. I write basic html files and those get compiled into JavaScript. It's quite cool. For testing I'm using YUI test Grogger and PhantomJS except that because the internet is not cooperating with me I might not be able to give you a proper demo for that but I'll try. I also used child process.exec. This is for utilities that aren't for example js lint is an executable. It's not a node package that you can include. So I use very regular child process.exec. It lets you execute commands and you get the little code and it's here. This is the code. That's your code, yes? That's your code, yes? Excuse me?  White background, sure. Yeah. Command control what? Just hold on. Oh and white background you were saying? Is that better? Guys stop being weird children and let me continue. Sorry. Anyway, so this is a meta refresh. It's a standard. I think it's a flash cap and this is where they keep their models, templates, views and static. Static is actually where they have the static assets. CSS, IMGJS, I made a folder of the current templates. I'll show you that code but in any case, what I want to show you is I made this little folder of the front end which consists of all my system stuff. I wonder if I can make this bigger. Is that a little better? So I have this script right here and let's see what it does.  The first two are very regular. That's fine. You can set an environment. For this build system, I'm assuming I've spoken it over with the Haskeek guys and we have a development staging and production environment with different conflicts which I'll show you. So I can set that environment whenever I'm running this thing. Clean, clean is the entire build folder. Very useful when you're doing a fresh build. You want to wipe it out and start a fresh. Or for example, you don't want to commit build files to the end of the script or whatever. S actually runs a little development server for me. The idea is that this isn't just for packaging assets. I should be able to work on my code without having to run the middle of a fresh site. I just want to, what about my asset? Make sure it's working. So I can run a little local server for it. The speed does a regular build. Assets takes a few points of specified assets. For example, you can mention images and so on and so forth. Push it to target directory. Lint runs JSLint and CSSLint. Watch does a fresh build every time a source file changes. That means you don't have to stop it and do a restart on the server. It could be encoded and just starts it. It does a fresh build of all your tasks. Let's take this for a spin. Let's say clean. My target directory is here. Let me walk you through this quickly. Like I said, the static directory is here. This is what I'm considering my source did. All the stuff that I'm going to package and so on and so forth here. And I could have put it somewhere else but my build directory is going to be here. It's going to generate a directory for it and put all the stuff over there. Let's try doing a regular build. I am logging all over the place. And it actually does. It sets the environment to government. That's the default. You can set it as production by passing in a parameter. It does a clean release the directory if it's already there. It takes also my templated HTML files, converts it to JavaScript templates, and generates a file template for JS. It takes my packages. I'm using this concept of just specifically for this. I have two types of packages. I have either JS or CSS. I use that to know whether I should use Aglify or CSSman or so on. But I suspect that I want all the start up JS files just at this root folder. For CSS, I'm going to take these four files and compress it and make one. It's going to be called styles.css. I also have specified my assets here. So all the JPG files, all the PNG files, and then I realize that I hadn't put the leaflet mapped files so I put those. This is for the little map that shows the Thermodrome College. So I've taken those files as well and put it to R6. You can have a look at the build directory and you can see yes, script.js has been generated. This is concatenated and all that jazz for CSS system. There's more interesting though, is what happens if I say environment production does another build. Let's go back to that. I'm pushing my production stuff into a separate directory called build broad. First of all, notice that the scripts that are generated are now hashified. If you can see the file name there, this is essentially to prevent cache poisoning. The idea is that suppose somebody has picked up script.js from you already and you want to push him on your one, but you already have this many caching one. This is a good idea that you have individual file names every time you do a separate build and so on and so forth. Which is fine. All you have to do is say let me show you how I actually integrated it. The idea is that you have to give hooks to the backing guys or to yourself frankly if you're writing HTML. So I'm using a little templating here and I'm just saying pick out css.styles. I'm passing the css object which has all those packages and I can say, I can choose to load an asset also here so I'm loading that way as you see. Go down you'll see JavaScript also in the same way as js.scripts. Scripts was the name of my package. And suppose I actually run a little server to render that page. Obviously I have a problem. That's the rule. These things always go up right in the middle. Anyway the idea is that it would render those special files that were generated even with the funky file names. Point to note here, so that means that it doesn't even have to be a specific file name that you have to remember. It doesn't have to be script.js or script.js, question mark some hash that you're going to put at the end of it. You can, all you have to do is maintain an output file that you specify the stuff that you've created, what it's going to look like. So these are all the assets that I've deployed. These are all the packages I've deployed. I'll go to the templating bit. This template.js file has been rendered automatically. It's been rendered off of this.  Basically output the result of X5 plus Z. You would obviously want something a little more complicated. For example, take 10 Flickr entries or Twitter entries and output the data in some specific output format. The idea is that it pushes it here and download or underscore template whatever. It's something I have to find here which basically takes that string and is able to give you a compile template. If you use underscore.template, you know what I'm talking about, but feel free to research the hell out of this. Like templates are cool, especially if you have a neat way of getting them into your flow. So now all I have to say is all I have to say is jst.xyz and I have that template available and then I just pass my parameters to it and get it automatically. Still not touching the STML. You can run a server, you can also run a little watch. Watch is where ideally it's supposed to change every time a file gets built, but just for a demo purpose I'm doing it every 3 seconds. So every 3 seconds, the point is that you set watch and leave it on in the background and continue working with whatever you want. So your output STML can actually keep pulling into built assets. Perhaps you're finding guys are reading your assets.json or I think you just got json and you think that to render it over there. But the idea is that you're not going to be afraid every time you do a change. This is a lot better than for example a whole bunch of server-side files. They have a fresh compiler and they have C++ running on the server. Other things you can also link to the files. I've made it incredibly liberal. I've made it incredibly liberal, but seems like that's the whole positive thing. Anyway, this is the idea. You have a built system and it's a whole bunch of facets. You could probably make a new task where it's uploaded by stream and so on and so forth. Quickly, just for reference, I'd like to show you that this is what it looks like. I have a whole bunch of commands defined and those are now some questions. Go to my questions slide. I wanted to talk about why you had questions. Yeah. Sorry? Why do I have questions? That's the idea. If you give a unique file name, for example scripts.someх.es, Then it's what it's a grid file and it comes up and is a grid address. In general, the tasks are So you won't have to worry about tagging the same thing, or anything like that. In Lexaphire, as in Lexaphire. Oh, okay, awesome. So yeah. It's saying that run is found with packages. Thanks a lot guys. Be sure to thank the Haskeen guys on your way out. Hope you had a great time.


The agency continues to verify the non-division of nuclear material declared by Iran under its safeguards agreement. The presence of multiple uranium particles of anthropogenic origin at a location Iran not declared to the agency still needs to be fully and promptly explained. The agency is intensifying its readiness to play its role in verifying the DPRK's nuclear problem. There is a need out there, countries are expecting and waiting for our help. As I've often said, this is not more of the same. This is the nuclear specific added value to a winning equation to defeat the COVID-19 and to prevent future pandemics.


going on everyone. Sam here with late sports cards with one box of 23 times tier one baseball hobby for Greg in. Good luck Greg. Let's see it. Let's go Greg. Come on. Slimy Sam. Slimy Sam. Oh no. Sound like those could be, those could be a little bit legit for sure. Anthony Rizzo at 24 at 25. There you go Greg. Some Yankees PC sauce. Hell yeah. Three color, two color. All game used. Oh yeah. That is going to be also a Wade Boggs. There's a Yankee to 400. Nice one there. Hell yeah. God, Dylan Cease. That is going to be to 299 for the White Sox. Kind of a good sign to get this kind of not the greatest time to get this. So 249 is Adolis Garcia. Obviously played extremely well in the playoffs as it is injured now but if they win then you know he's still part of it. So congrats Greg. Nice one there. Adolis Garcia. Do it for your break Greg. Thanks again for the sport buddy. Get him right


Hello, Will. Thanks so much for joining me. How are you doing today? Good. Thanks, Chris. How are you doing? I am fantastic and I'm so excited that we get to talk about the status game. I've been waiting. I've been waiting for a book like yours to come out. But before we dive into some of the topics from the book, can you kind of explain what inspired this specific book? Like you talk about it was kind of a combination of a couple other books you worked on. So he talked about why you want to write this? Yeah. So the last sort of two, three books I've written have been really, you know, the central idea has been like, you know, we experience life as this story and it's the kind of a made up thing, you know, like, so that's why we can be so irrational because the brain is this kind of hero maker that tells this heroic story about the world and it's distorted and it's biased and all that stuff. But then, you know, so the biggest question, if the illusion is a story, what's the truth? What's actually are we doing as we go about the human life? And I think the answer is there's two things, is connection and status. That's what we want. We want to connect into little into games. And once we're connected, we want to earn status within them. And, you know, once I kind of saw that, you still used to see it everywhere.  It's what we do. It's what we, it's what all humans are constantly doing is joining groups and playing for status. So yeah, I thought that, yeah, as soon as I kind of saw that, I thought, well, yeah, I really want to sort of think more about this. Yeah, yeah, like that's that's why I was so excited when I saw that you wrote this book, because I'm personally, you know, I'm always looking for like the root like where like, when I see like an issue or some weird human behavior, I'm like, okay, well, what's underneath that? What's underneath that, right? And I think, you know, why I got interested in this whole idea of status was, you know, I'm a recovering drug addict, and it was from my depression. And I looked at a lot of my depression and things like that. And a lot of it was my comparison to other people, you know what I mean? And when I got sober in 2012, and I started working with other people, I started looking around. And I saw that a lot of like, depression, anxiety, and just like overall human suffering seem to come from us constantly chasing status, you know what I mean?  Well, it's everywhere.   I used to take a lot of drugs when I was young. And so I can totally relate to where that's coming from.  And only do you feel that you're failing in life, you feel that it's hopeless that you've tried everything. And the game is going to keep throwing you out and you're at the bottom. And that's that. And so what researchers find is that is the risk of, you know, suicide and suicidal thoughts, you know, seriously increases when people, especially when people were suddenly loose status. So when they're here, and then they're suddenly down there. But interestingly, interestingly, another flashpoint, danger point is when people simply are left behind when they feel that everybody else has kind of accelerated ahead, and they're just still they're kind of stuck there. That also is linked to increased risk of suicide. So, so yeah, I mean, you know, the way I see status is it's, you know, it's a fundamental human need, like food and water is a fundamental human needs, but it's a psychological need. Yeah. And when people feel that they're being unfairly deprived of status, they get they get depressed and they get sad, but they also get really, really angry, you know, and that's the thing that we see more often, I think, especially at the moment in the world.  When I was a new father, you know what I mean, it was actually in 2008 when the recession hit, lost my job. And even then, like, it just felt terrible. I'm not as good as other people, I'm not able to provide and all these other things. And so much of it is just thinking about what others are thinking of me, right. And just like that, that sense of security. But like you said, too, like, it's interesting that there's like these two primary emotions, there's like the depression and sometimes it's like this helplessness. But then also it's this, it's this anger, right.  And I'm not as familiar with all the stuff going on in the UK. But how much do you think it's from this, you know, people don't feel like they're able to get to the status level that they want to be at or deserve to be at? How do you think that's playing into it? Yeah, I mean, it's, you know, again, very frequently when you see groups entering into conflict with other groups, it's to do with status.  And I do think there's a lot of that underlying the kind of, you know, what we call the culture wars at the moment.  They had more respect than they have now. There were the, you know, the backbone of America or the, you know, the salt of the earth and over here. And, you know, since the age of, you know, multiculturalism has arisen.  You guys, there's the, you know, the well-known kind of race issues. And I think, you know, part of what's happened is a genuine declining status for white working class people and white low middle class people in terms of, well, so generally, so declines it in terms of, you know, income, but also just the level of respect they're afforded, generally, as the kind of focus of the left especially has moved on to minority groups for lots of very good reasons.  And, you know, they make a lot of mistakes. And the most obvious one is that they blame the immigrants, they blame African Americans, which is the wrong, you know, it is the wrong target, but that's who they see as responsible for this. And then on the other side, you've got, you've got, you know, very privileged, educated people who have also, you know, seen a relative decline in status in the sense that so when researchers look at the exactly who are the people who are kind of fighting these culture wars on the left, that's really interesting things, you know, they're a minority of people, I think it's 13% in the UK, 8% in the US. They are out of sort of about seven different demographic groups. They're the wealthiest, they've got the most family incomes of 50,000 pounds over here. They're the most highly educated. And they're the most dominant voice on social media. So in the UK, this group of people make more contributions to social media than the rest of the nation combined, even though they're only 13%. So they're the ones on Twitter, you know, they're the ones shouting and about racism and social justice and so on. But many of these people, I mean, they also skew heavily Gen Z and Millennial. The interesting thing about wealthy, highly educated Gen Z and Millennials is that they are also suffering a decline in status compared to what was gone before. You know, famously, it's much harder to get the property ladder. It's much harder to they're earning a lot less money than their parents and at the same stage. So, you know, I don't think it's, you know, I don't want to oversimplify it, but I don't think it's a coincidence that in both of these groups in these kind of angry left-wing activists and angry white working class kind of pro-Trump anti-EU people have both seen a decline in relative status, you know, over the last few years. I don't think that's a coincidence at all. You know, it's not just that, but I think that's a big part of the picture.  I see all these people fighting and kind of like what you're saying. I'm like, everybody's kind of dealing with the same thing, right? It's just how we're perceiving it. And my chance, have you, have you read the book Strangers in Their Own Land from, what's her name, Arlie Hothschild? I don't know how to say her name. No, that's a new one, that's a new one on me. Yeah, so yeah, if you ever get the chance. So basically, like she's like this liberal woman, I believe she's a sociologist or something, and she's from like the, you know, one of the coastal places in the United States, but she wanted to go to the middle, middle of America and say, what's going on, right? Why do you guys disagree so much? And she wanted to understand. And yeah, you go there and they're dealing with a lot of the same things. And they, you know, it helped me kind of widen it. And my, why do my perspective and understand like, oh, these people feel like they're being left behind, right?  And I've been really interested in books lately that kind of explain or just have different opinions on the culture wars and how, you know, they're making us fight left versus right when there's really, we're upset about the top versus the bottom. You know what I mean? Do you feel like a lot of people are distracted by that? Yeah, well, yeah. And I think that's the mistake they make. And I think what was really interesting for me is understanding the two different stories that they tell about the world. And they're both stories about status as these things very often are.  The story that they tell of the world is that white people, especially white men, especially straight white men, have unfairly dominate the world and unfairly kind of hold resources and fix the game so everyone else is kind of screwed. But then if you look on the other, the other kind of story that, you know, a Trump voter or over here, a Brexit voter might believe is that it's not, it's the highly educated who unfairly dominate the game and fix it so everybody else is kind of screwed. And what, you know, I think the broad point, you know, I think if there's one kind of thing I've learned from the last few books is that stories are never true, you know, and usually it's not that they're complete outright fabrications, it's that they kind of hold half the truth. And what's interesting about those two stories is that white people, you know, fix the game on there and men do and so they're highly educated people. It's all true. All those things are true. But each side only sees that half of the truth.  And this woman has been to, you know, elite college after college. She writes for, you know, the Washington Post and, you know, so she's right at the top of the game, completely bathing in privilege. And yeah, she doesn't feel like it.   But it's because people, that's the thing we believe the story the brain tells us. And the story always holds about half the truth, if not less. Yeah, it's something like it, like every time there's like this topic kind of comes up, I just start to feel the frustration inside myself because it feels like just such an obvious sleight of hand trend, right?  He's, he's the reason you're in trouble. And people are like, yeah, you're right. And I'm like, do you guys do, do we not see this? How can we not see this?  And, and yeah, and I think, you know, I think one of the best things I would love if you could explain this study that you touch on in the book, because I think it really helps people understand how, how much we value status. So there was a study where they, they like offered employees and said, would you rather have a promotion to raise your status or like a pay raise or something like that? Yeah, can you, can you kind of break down like that study? They just straight out ask people, would you prefer a pay rise or a better job title? And about 70% opted for the, for the better job title. So a filing clerk wanted to be a data storage specialist. And, you know, yeah, and that just shows, I mean, you know, like the way to understand these status games is that it's like any game is that we use symbolic things to measure status. And you know, if we're playing monopoly, it's a, it's a plastic hotel. But, but you know, in this day and age, money is a way that we use to symbolize status. But it's not the only, it's not the only way it's just, it's just another way of playing the status game. You know, job title is, is, is also it's very clearly about status. So people often opt for the, for the improved status. And for good reason, you know, it's probably going to make them happier than the money is. We were in certain limits, obviously. Yeah, it's like the two primary things I often think of, think about that, like, are these driving forces of us is like status and signaling, right? And I'll never forget one time I was in Los Angeles, and I think I got lost and wasn't in the best neighborhood, right? But like these houses, there were, you know, there were, it wasn't the best neighborhood, but the cars were nice, right? They're that's such nice cars.  And I have him stop and think like, why do you want that? Right? Because I want him to start recognizing, are you trying to signal a certain status or, you know, is that going to bring your true happiness? But, but yeah, I, again, I love getting down to the root and we evolved this way.  Totally, yes. So it's basically the way that we've solved the problems of survival and reproduction, you know, it's that fundamental. And so as you might know, we're apes, humans are apes, but we're apes that have cracked, you know, the secret of being highly social. So Jonathan Hyatt, the famous psychologist, says that we're part A, part B, you know, we're that social.   But it's more than just about connection. It's because, you know, it's fine to feel connected into a group and we're driven by evolution to feel good when we're successfully connected into group and to fear being ostracized from a group. But once we're in that group, we're not, we're not, you know, we're not really happy to just flop around in the lower runs, you know, everyone likes me, but I'm a bit of a loser, you know, people aren't happy with that. And so, so we know we've evolved this kind of urge to want to move up, to be respected, and to feel above other people. And that's because, you know, being connected into a group solves the very basic problems of survival and reproduction. But if you want to really thrive, you had to earn status, because in any, in the human trials in which we evolved, the more status that you earned, the better food you got, the better your access to your chosen mates, the safer your sleeping sites, the better the opportunities for your children even. So, so the more status that you had, the better you were surviving and reproducing. So it's so it's that fundamental. And of course, you know, you still see that today, you know, that was true 10,000 years ago, you know, when all this circuitry was evolving and longer, and it's still true today, the more status you have in the modern world in the West, the better able you are to provide for your children, the better schools they go to, the better universities they go to. So it's still the same old game that we're playing. And as you know, if you just didn't get into the root, that really is the root, you know, connection and status. That's what we're doing all the time. Yeah, it's interesting because I feel like when, you know, I talk about this, because I just love, I love evolutionary psychology so much. But it feels like when I talk, when I talk about this, like it seems like it's like this kind of like cliche, like, hey, we're just these like old school tribalistic apes and we haven't really caught up. But it's like, it's so true. We're doing these, these ancient behaviors that helped us. And I think, you know, there's this weird balance of finding like, okay, this is part of how we evolved. And there was a pretty good reason since we're at the top of the food chain, right? But some of it, we kind of got to, you know, recognize it and balance it out because not all of them are as advantageous in 2021 as they were back in like BC. You know what I mean? Yeah, I think the main one is, main thing is really is that we evolved to play these small games. You know, we evolved in relatively small groups. And even within those small groups, your games are divided. So the genders would have been pretty much divided. Women would compete with women, men would compete with men. And in that, you know, it's down to age and, and, you know, hunters would compete with hunters, honey finders would compete with honey finders. You know, so you're playing these very small games and, you know, and they were so shallow that it's often people you hear talk about these human groups involved in being egalitarian, but they weren't egalitarian in the sense that everybody, nobody was interested in status.  And they were constantly kind of managing each other and pushing each other down, making sure nobody starts throwing their weight around. So they're egalitarian because everyone's all constantly shuffling to get up to get the better resources, you know. So, so yeah, so we've evolved to play these small games.  You know, we have thousands, tens of thousands of other who were playing it. So we've kind of driven mad by it. You know, we've driven mad by it in the sense that the status rewards on offer today are insane compared to what they were in the groups we evolved with.  Yeah. And, but today they, you know, the rewards on offer, but the downsize that means the resentments that they treat are much, much bigger than they would have been otherwise. You know, people would have been held in check back in the day, but today they're not.  You know, I think we evolved. Yeah, that's crazy. Like, as you as you talk about that, like, I think that's just such an excellent point because, you know, they talk about like Dunbar's number, right? Like 150 people. That's like the max relationships. So you think about these old school tribes, and you just kind of had to worry about a small group of people. Yeah. But then, but then, you know, like, even in just, you know, the industrial revolution, it's like, all right, now we're in these factories, and I got to worry about my status compared to this guy, right? And when you're in a small town, and like, are you better than the blacksmith down the road, right?  And every time you touch, every time we touch Twitter or Instagram or Facebook, we're competing. It's, it's this huge competition. And, and status is like, it's all over the place. But like you mentioned, like, the resentments, we, we, we get in all that kind of stuff. And I'm curious, because you touched on it a minute ago, but like, what are some of the key differences you see or you learned about through your research between men and women and how we kind of fight for status without broad generalizations and all that, but it's kind of the evolution.  You know, the main caveat, we would say that, that, that, you know, we now know that men and women aren't categorically different.  So, so, you're always talking about generalizations. You're always talking about, you know, if you take lots of men and lots of women compared together, you get these rough, you get these rough differences. And so, but there are some differences. The most obvious one is, is in terms of physical violence.  So dominance is about forcing status from people, either physically or by threat. And so men play kind of physical dominance games, you know, far more often than women do. You know, we're still built physically even today. We're still built physically, you know, without the body, muscular strength to fight physical one-on-one dominance games. So, so, so it's embedded in us. But, you know, women are aggressive too. Women also play dominance games because women don't tend to fight physically anywhere near as much as men. They use these other games, which is about, you know, destroying people's reputation and ostracization, reputation destruction. The literature is very mixed. So, so, so when you read some papers, they say that the reputation destruction is very much the female form of aggression. So if toxic masculinity is, you know, is physical aggression and one-on-one bullying, toxic femininity is reputation destruction. Other papers just as confidently announced that that's not true, and that men use reputation destruction just as much. So I don't really know what the truth is. But certainly, you know, men obviously use reputation destruction too. But, you know, anybody that's spent more than 10 minutes online can see that women are very good at dominance, at least as good as I would say, as dominance through reputation destruction and ostracization as men. So that's one of the, that's the most obvious is in the aggression styles. Another big difference that's sort of very well kind of established is this idea that we're drawn to different kinds of games. And this is all around the world, you know, cross-culturally, men are more likely to have interests involving things and women interested in involving people. And so that very basic broad general difference reflects in the kinds of jobs and vocations people join. So, you know, if you're going to open a tractor factory tomorrow, it's more likely that when you advertise for jobs in the tractor factory, it's likely you're going to get more male applicants than women applicants. And it's likely that, you know, that gender difference will reflect in your staff.  You know, what is argued about is the source of that difference. So a feminist will say, well, the reason you've got more men in the tractor factory than women is because women are told from an early age, you're not allowed to be in traditional tractors, you've got to be interested in cooking or something. Whereas, you know, an evolutionary psychologist might say, well, actually, it's more to do with millions of years of division of labor. You know, women had to give birth, so they have a psychology that's more interested in other people and empathetic things. But, you know, this is an argument that we're just going to go on and on and on forever because the status involved in it, you know, because if there's status under, you know, at its core, any round that's the people's status, it has the capacity to become incredibly toxic, incredibly quickly. I mean, people have been fired for making these arguments. Yeah, yeah. No, when you were talking about that, I was thinking about the James DeMore situation. Yeah. And it's interesting because I've recently been reading some books on, you know, the trans debate and I read Carol Hoover's book on testosterone. And I've been thinking, you know, just like with how slow evolution is, I just wonder if thousands of years from now, if things will look different just because of the cultural changes, you know what I mean? So now, you know, since, you know, women don't have to necessarily stay at home or gather and stuff. And I was talking with, I believe David Buss about, you know, a lot of women around my age, you know, or even within this group, I've noticed a lot of them just not wanting to have kids, right? So I'm like, how's that going to shift? But it's funny too, when you mentioned the kind of reputation stuff. When I got, when I had the internet coming after me in 2019, I got so interested in why we gossip. Like, why do we talk trash about each other? Why are there these mobs online? And why do people do this? And why do people care?  Like the person gossiping is saying, I have information about other people in the group about who you should interact with, who's good, who's bad, right? So you're showing status with gossip. And, and that's why, like, that's just reason number 9000, why I love your book, because it touches on all these things. And I just want to tell everybody, like, it's all about status. But when we're talking about the reputation, one of the things you touched on in the book, which I was like, yes, was going back to, you know, men and their status is you talked about embarrassment and humiliation. And you touch on like serial killers. And here in the States, I also think about mass shooters, right?  It's never like that, right? Yeah, it's never American psycho, isn't it? Yeah, yeah, exactly. So can you, can you kind of explain what you found in the research about, like, just how humiliation plays into our drop in status and, and why people turn to violence when that happens? Yeah, this was really, really early when I was still wondering whether to write a book about this, one of the little tests I gave myself was, okay, if you think that status is such a fundamental human need, then it must be really bad when it's taken away from us. So let's work out if it is or not on what happens. And so yeah, I, you know, I came across this paper that I think it's just called humiliation and it's causes and the way that these psychologists define humiliation is it's the removal of a person's status to such a degree that it's impossible for them to claim status in the future.  And then when you look around the literature, you know, my God, humiliation is connected to so much unbelievable evil, everything from honor killings to serial killings to, you know, incel murders. Yeah, so that's what I thought, you know, I believe this now, you know, but you know, that's what really convinced me finally that status was as important as people were saying, because when you look at the humiliation literature, it's just, you know, and even as I go in later on the book, when you look at the massive evil movements in history, most obviously the Nazis, the humiliations suffered after the after the First World War and the Treaty of Versailles, and they blame the Jews. So you know, the Jews get it in the neck, you know, and so one of the interesting things to be one, I looked in depth at the story of Elliot Rogers, who was the University of California, Santa Barbara. Because he left a really detailed autobiography behind 108,000 word kind of memoir, essentially that was unsparing in its honesty. Did you read the whole thing? I did. Yeah, I found it weirdly gripping. Yeah, it was just unbelievable because he was so so devastatingly honest. And it was like, it wasn't, yeah, what struck me about Elliot Rogers was he was clearly a narcissist. So I think the most dangerous people aren't isn't just like you and me, you know, when we humiliated and yeah, in that moment we might be dangerous. If somebody humiliates us, we might lash out, we might do something we really regret, especially if we, you know, drunk or on drugs. But the really dangerous people are the narcissists because the people who are very grandiose, they're the ones who automatically assume they're up here and they deserve to be up here. Yeah.   But, and yet he was just bullied like insanely all throughout his childhood. No, once he hit puberty, before puberty, he was happy. But as soon as he started showing interesting girls and realizing that girls didn't like him very much, he became tortured by this. And, and yeah, you know, he becomes obsessed with the fact that the pretty girls that he desires don't want to go near him. And he aides all what friends he does have and ends up entirely alone and rejected. And there's a very touching thing in his book where, where the only thing that brings him happens is the computer game World of Warcraft. And he would, he would meet up with some friends, just remaining friends and play all night. And then he found out somehow that his friends had started meeting up without it to play World of Warcraft and that's what and from that moment on he's just destroyed he stops playing World of Warcraft which is his only source of status and he goes from being just basically a very hateful individual to somebody who you would think he's mentally ill he starts telling a story about the world that he says that women are the cause of all evil in the world because they choose to mate with jocks you know stupid violent jocks and therefore they have stupid violent jock children and you know this is the cause of all the terrible things in the world when they really should be choosing him this glorious gentleman and so his solution is to kill all the women except for a few of them that he'll keep in some sort of laboratory or you know factory or something in which should be artificially inseminated to have children and sex will be abolished completely and anything you know when you're reading it you think man you've lost it now you've literally got insane this is like if somebody told you this story they they think you're a crazy person yeah and yet when you look at the story of the second world war it's it's hauntingly similar an entire nation well it was to go too far to say an entire nation but you know a large number of Germans started telling almost exactly that story about the Jews after the after the first world war and and you know and they did begin exterminating them as a race so so and that really when I realized that that sent a real chill down my spine because suddenly Eddie Rogers isn't this like crazy outlier I mean he is an outlier but but you think what his brain is just doing what brains do and that's telling that's when you know when we feel unfairly robbed of status we tell an unbelievably toxic and hateful story about the people that we blame yeah and that story can really really take us to incredibly dark places yeah so yeah so at the risk of being both cheesy and controversial here's a rant that I think that you'll understand because it's something I think about quite often so on one hand you have you have this kind of entitlement right like I deserve these types of people to you know women these types of women should desire me right but you know something I learned from David Buss's recent book is the worst thing you could do is be like on a scale of one to ten be like a five and go after eights right like just don't do that you got a day within your range so but there's this weird entitlement where people don't acknowledge that and they they lie to themselves and say I I should get better and that that's that's insane right um and Kate man that's the grandiosity that's the grandiosity yeah it's not everybody that's just some people yeah and uh you know uh Kate Mann in her book titled entitled actually she talked about Elliott Rogers right but then on the other hand here's my controversial slash cheesy side of it I I remember the Parkland shooting when it happened I looked at it and whenever stuff like this happens I'm like why why why I want to know a motive like by the way at the time of recording this there was a bomb threat like at the Capitol last week and I still don't know the full reason why nobody's talking about it but it's driving me nuts because I want to know why I want to know the story behind it but anyways uh the the kid from Parkland you find out that there was like uh you know all these kids who are bullying this guy for so long right and with uh you see this like temperature knob slowly being turned up and I guess like my view on it is just we got to be a little bit nicer right because because the bullying is a sign of status I used to be a dick when I was in school when I was in high school and stuff like that I was an angry person and I had an alcoholic mom and a crappy family so I bullied other people but that was status that was how I inflated myself you know but I was putting someone else down causing humiliation or whatever and the thing is once somebody does something so horrible like a mass shooting it feels like we can't even have that conversation anymore right because they crossed the line so far that we can't talk about what led to it does that make sense it feels like it's totally yeah no totally and I think that's the story you know we you know we tell a story about the world and it's a heroes and villains story and it's angels and demons and you know that's one of the things that I've always done in in my books which is he's tried to just put that to one side and not and try as far as possible to not morally judge people because I'm in no position to morally judge people and you know and you know and I think you could probably you know pick up in that chapter about Elliot Rogers you know I have him in sympathy for him in a in a way because Jesus the things he went through were horrific you know he was he he was he was probably an autistic kid so he had problems making social connections he was bullied just remorselessly and yeah and and you see you know status is a fundamental human human need we need it and and and if you and if you take anybody and put them through what Elliot Rogers went through yeah they're not going to to do what Elliot Rogers did you know he was a very rare combination of events and as I said the grandiosity is definitely a part of that the narcissistic yeah that's really dangerous you know male narcissistic humiliated is a bad combination but but but but you you're going to end up not with a you know a poor you know sad sorry victim that you're going to find in a Disney movie you're gonna go with an asshole yeah you know you're going to end up with an angry probably extremely aggressive anti-social prick that no one likes because that's what happens and and you know and it's big and it's it's because of what happens to these people I mean in the same way you know in the chapter about the Nazis I you know decided that I you can't I couldn't not write about all the things that Hitler did yeah that that actually genuinely make people love him and that wasn't to do with you know this again the story that we told about the Nazis because when people cross a certain line as you say we go into this we're going to this kind of cartoon framework of oh they're a monster yeah um but you know and of course you know Hitler was an unbeliever did unbelievably evil things um but but but he there was a reason that the the the germany's worshipped him like a god and it wasn't because he was like a monster with you know amazing or powers of speech making or whatever you're told at school yeah it's because germany was you know humiliated after the first world war lots of people believed a story that the jews were responsible for that is you know completely made up full story but but and not only did but he you know he yes he you know he told that story though although not as much as you'd think during the 1930s yeah but what he actually did was promise to restore the the status of germany and he did it you know he did it you know in in in less than 10 years he did you know he took this this country that was humiliated and fallen to pieces and achieved full employment and and you know and uh the the Treaty of Versailles which was the source of you know you know so much of that humiliation he just he just um row rough shot on it with no apparent consequences so that's the real reason that um that people loved Hitler but it's because he he he gave the nation the status they felt you know and I think it was quite a grandiose narcissistic nation at the time they were the leading they were by far the most successful country in continental Europe and probably all of Europe including the UK at you know before the First World War so so so you know you you have to if you really want to find out what's going on you've got to god to have the courage I think to push aside this urge to go well they're a monster I don't want to understand them yeah because it doesn't get us anywhere you're not going to prevent the next Elliott Rogers or the next Hitler by by by doing that you're going to prevent it by understanding what was the appeal of Hitler genuinely it was that he promised anti-delivered status I mean unlike Trump who promised status but didn't deliver it yeah you know um and you know what caused Elliott Rogers was was this unbelievably dangerous combination of narcissism and humiliation yeah yeah it's it's yeah it's just like one of those things where you're like you accidentally make a bomb right you take the wrong combination of genetics and how they were raised and you know like you you put that all together and a certain experience and boom right but you know the the thing is it feels like it feels like we have this human tendency to just want to simplify it as much as possible and forget the nuance and just we want to say you know these people are evil they were born different they were this is how they were because we want to believe that this couldn't happen regularly this couldn't happen or there's nothing I could do to cause somebody to you know or or play a small role you know what I mean and it feels like a oversimplification but but humiliation you know it's that final ingredient and let me ask you something let me ask you something will because it's very rare that I have somebody else who used to be an alcoholic on here do you think because I I bet you could relate to this like humiliation I already did all that shit you know I've done so many things that I can't remember and people tell me about so like I'm not telling people to be an addict or an alcoholic but do you think that prepared us a little bit better for dealing with humiliation I don't know I mean I can only speak for myself and yeah I mean humiliation is the big part of why I get quit or you know it's that awful moment of waking up and just not knowing what you did and then looking at your phone and shit looking at the text messages oh my god yeah and so yeah yeah but I don't know if that prepares me any better for yeah I just think humiliation is such a fundamentally dreadful experience it's you know it's like suffering from starvation you know it's the opposite of what the the mind craves yeah so I don't know I can only speak for myself but I don't think it's given me any kind of inoculation yeah that's a good point like when I think about it it's just kind of like shifted right like there's certain aspects where like you know somebody might look at me and be like aren't you embarrassed and I'm like no like I've done way worse but there's yeah what it does do is it makes me much more empathetic towards other people you know and I think that reflects in in in the writing I don't often you know you know judge other people in those ways like I'll look at an earlier Roger and not think there's a monster but I'll think oh yeah you know I'll be much more I have a high tolerance for bad people because I'm that person myself and I'm not going to like cast them into the fire because I get I get I get why people at like pricks yeah yeah I did I I've been reading books on like the justice system and everything like that and just to get you know just about like just because of my personal experience I used to be a completely different person just angry terrible bad father bad son bad friend all those things and I've changed I'm a pretty decent guy now right so I see that in other people and I'm like okay well maybe these people can change if given the opportunity and that's kind of why I'm interested in the justice system and the talks around it and stuff because like I'm like hey if a guy like me because here's the thing like especially just me personally like I should have had so many DUIs like driving under the influence here in Las Vegas like I just got lucky right so there's not there's not much aside from luck that separated me from a lot of other people who be considered bad on a lower level so that's why you know I try not to morally judge people but but yeah I want I want to ask you about a few just like situations now we talked about evolution and we're in 2021 and I want to hear your thoughts on how status plays into certain things that we're all dealing with right now and I want to start with like QAnon and anti-vaxxers and conspiracy movements right because you touch on it a little bit in the book but how does status play and do people like try to outdo each other within those groups for status because there's a weird thing going on where it's like are people trying to be like hey I have the craziest conspiracy theory and is that a status thing do you think? Yeah I think one where it gets really interesting this stuff is when you start looking about people's beliefs about the world and you know what the brain wants is connection and status it's not particularly bothered about it's not motivated to find out what's true it's motivated to find out who do I have to be in order to connect and earn status so we're very vulnerable to believing any crazy shit if our status is dependent on it and so in the book I tell the story I spoke to a young man in Pennsylvania called Miranda Dinda who was 18 years old and she was pregnant all her friends were at college she had been brought up in a family of women and was and you know really was one of these people that loved the idea of powerful strong independent you know women she had the misfortune to find a midwife who was an anti-vaxxer and this is before you know COVID so this midwife said if you consider not vaccinating your kid and Miranda was like what are we talking about? And this woman said oh you should just google it you should just google it so she googled why not vaccinate and of course the whole fucking internet blew up in the face of all these reasons why not vaccinate she's like oh my god this is horrific you know I never knew all this stuff and she joined a Facebook group and the Facebook group was um I think it was called great mothers questioning vaccines great moms great mothers questioning vaccines and she said you know the experience is like I'm suddenly surrounded by all these really amazing strong powerful women who you know who were just like a model for me and and you know she said she announced herself as vaccine hesitant and kind of just smogged her on this group really telling encouraging her and she basically said you know you know she described the situation in which of course she wanted to be connected to these people she said it was like imagine if you wanted to be a firefighter in Europe and your parents took you to the fire station you saw these amazing firefighters you're like oh my god I want to be just like these people that's how it felt you know so so so she did and that's what we do and that's backed up by huge amounts of research in you know in psychology and topology you know we humans copy people we don't just copy we don't just copy anyone we copy people that we look up to that you know we're playing a state in a status game with these people and we're like I want to be like that person so we start mimicking them we start you know even the way they dress their tastes in art the way they talk you know I remember when I was a kid I used to was obsessed with this popster called Nick Kershaw and I saw it Nick Kershaw on breakfast TV and he crossed his leg in this funny way with his ankle on his knee and I started doing that but it you know I was like eight years old it's just it's just a natural thing that you do and one of the things you do is you copy the beliefs and so she started believing this thing and then she said you know the way that you actually earned status and rank in this group was that you went out and evangelized the belief so yeah you'd go out into the world you'd lecture your cousins you'd lecture your doctor you know have arguments then you'd come back to the group you'd type it all in and everybody would go oh yeah wait I go mom and you know so it was it was a classic status game and the way that you earned status and you know secured your connection was by being useful to the group was by going out there and I think that becomes really dangerous for people who because you can imagine something like Miranda you know she's isolated she's in Pennsylvania all her friends are at college this this could easily become your main source of status so you know you have all these different sources of status and you know we designed to get status for people we actually spend our lives with but now we've got the internet and actually you can become somebody really important on the internet um for acting in a certain way and if all your and if and if your your major source of status is this internet persona you've got you're in a very dangerous place if if that persona depends on adherence to a belief because you ain't going to give that belief up not very easily yeah and and just you know even thinking about that and you're like you know that that facebook group of anti-vacces but we saw this rise of QAnon during the pandemic but like when you know I've watched several documentaries and read some books on QAnon and you often find that a lot of these people were isolated alone not really someone huge you know in their community or whatever but like you said online you can be you can be someone totally and and you can imagine during the when they when they kind of storm the White House these people just from you know had from ordinary lives in ordinary places all over America in that on that day when they stormed the White House they were Tom Cruise that they were literally saving America and saving the free world and you know like that is status you know that they really thought they were superheroes that day yeah and so so yeah you know it's very when she's when she sort of see the status dynamics in in all this stuff it's very hard to unsee it yeah you know so I I have a dumb question for you but I want to make a point for everybody listening to this this episode so with everything we're talking about like anti-vaxxers you know QAnon and stuff like that do you see similar causes with outrage culture right like who can get the most mad about something so morally stupid and insignificant right like oh I can't believe this person said this like do you see that same thing so they can go back and say oh I freaked out on this person more than anything right do you think that's happening as well with outrage yeah I mean totally I mean I mean that that's what outrage comes all about it's a status game and it's it's it's you know it's it's um it's about you know people kind of perform groups around uh you know political ideas on the internet and um you know within these groups there are high status kind of warriors who you know they can be journalists or columnists or politicians or you know celebrities often as well and and yeah and you know sometimes you know it's in the book and there's two British actors you know there's Jamila Jamil um it was a good place yeah and and Lawrence Fox um you know she's on the left he's on the right and and they're both I mean in the UK it's no I don't think it's an exaggeration to say they're now more famous for their internet warrior kind of behavior than they are for actual acting you know their main source of status is for Jamila Jamil it's for being this body positivity kind of activist you know yeah she's very interested in um in in in appearance and you know she's attacked numerous women um online and you know Lawrence Fox is this kind of anti-woke kind of warrior that that kind of that kind of attacks people that he perceives as being um you know two two two left wing in their thinking yeah and and you can see that they you know yeah it's it's so and you know and you know they've all got these sort of groups of people that follow the one on Twitter and and if they say something then they all mob against the the person they're complaining about and yeah I mean it's just classic status game behavior you know and and and it's interesting when you see in the book I kind of just you know went on the way about machine and I was interested and you see that from the moment they started doing this online Twitter you know warring their social media followers just counts just rocket upwards you know so they're running huge amounts of status um doing this yeah so I I have a few more questions for you but I got I have another quick rant to go on right so like earlier we were talking about how you know people are profiting off of this and you know corporations and companies and you know status and you know we want to move up the corporate ladder but on this like social status level like what you're talking about like like yeah I do that too like I look back and and humans we our actions are largely based on incentives right and we do what gives us rewards so if you say something right like you could you could start out with something soft and just be like hey body positivity and people like yeah but you're like oh wait well what if I turn that heat up a little and then people like yeah so then it gets to a point where I'm looking at these people and I feel again like it's this sleight of hand I'm like do these people even believe it anymore someone like a Jamila or you know other yeah there's endless I'm like do they even believe it anymore or is it do they keep that going just to keep their status and do all of their followers not see that because now they're motivated not only for the status but sometimes there's you know even profit incentives a profit mode it's like there's there's people on TV or you know whoever where because of their personality because they do that they're like the leader of this tribe that gets angry about stuff yeah I I'm inclined to tend to look towards the less cynical view I think they do you know I really do I think I think that when when you're looking from a distance and seeing them it's very easy to believe you can't possibly believe that you know but most of the time I'm sure there are cynical people out there but I think if you were really cynical you would lose energy and momentum in it you know I think it's very I don't underestimate the power of human irrationality when you know when status is in play I mean you know there are billions of people around the world who have religious beliefs literally billions of people who have religious beliefs religious is a status game and you know and you know so it is the norm to believe magic supernatural irrational things if your connection into a group and your status depends on it that's the norm it's not a rare thing if you look at the religious belief it's the norm so so yeah you know I really I really think they do believe it and there's not to say that it doesn't all fall to pieces around their heads at some point which which it may well do yeah but you know it like um I don't I don't rise about it in the book but it's always fascinated me from the European perspective to look at the experience of Germany East Germany you know East Germany in the 20th century went from being Nazis to communists you know these are the same people having the same life and some of the people that were in the Gestapo ended up being in the Stasi and but you know so so so that you know and it's obviously not as simple as they were all nice and all communists it's not everybody um but but you know a sizable number of East Germans you know who embraced Nazis and then went on to embrace communism like the opposite yeah point of view because that was the status game then and so so that shows you you know that that's a really that shows you kind of how malleable kind of people can be and how how vulnerable people can be to these um kind of these kind of um stories that you adopt you know what it's gonna feel good about yourself yeah yeah and and you know what will I'm glad I'm glad you're here to balance me out because I like your your view better because yeah but I'm looking at I'm like I'm like you don't really believe that because this is happening like the world's gonna end right like there's no way you can actually believe but but yeah like uh you know our our brain's like self deception is very real yeah look at the COVID pandemic I mean Jesus Christ I mean you know I've been writing about a rationality for for years now and even I was thinking well once once it'd be interesting with COVID because it will get rid of anti-vax but it hasn't got rid of anti-vax oh no just today um a bunch of protesters are storming um you know a TV channel a national TV channel in London you know so then these people are literally surrounded by suffering and death on a mass scale and they they are not only believing the anti-vax conspiracy theories they're believing it to such an extent they're storming TV stations yeah and attacking people so you know that that is the power of it and you know it's not most people but but it's a lot it's it's more people than it should be yo yeah no absolutely and I think that's I think that's why I enjoy your work because I'm fascinated by irrationality like like we were talking about the January 6th uh storming of the capital that was all based on something that had zero evidence of voter fraud and it's like you guys believe this so much that you like people got in cars and drove across country people got in planes they bought plane tickets got a hotel room and then they stormed like all the steps they took for believing something without evidence and I'm just constantly really fascinated by that whole thing but but yeah so I want to I want to end with a couple positive questions for you well so I'm hoping to learn from you since you just wrote an entire book on status and stuff like I'm curious like how how is this experience writing this book how has it changed how you view status and like does it help you like I don't know navigate a little bit more and yeah so it helps the one thing it does is it helps kind of grounds you because all of us and I'm definitely obviously no exception are vulnerable to when we feel that our status has been attacked unfairly you aspire into these kind of weird stories oh it's all a plot against me you know it's not fair and and I catch myself doing that much more now so so hopefully I'm less you know and but the process is so hard you can catch yourself at it but it still feels like it's true yeah you still think it must be true um but but it isn't so there is that but but also I think you know it does make me more kind of empathetic to other people because you know he's understanding that I think before we're into this project the way you see status is it's this kind of slightly dirty grubby thing that kind of loses and egotists are interested in and actually you know good people are worried about that kind of thing yeah it's absolute nonsense it's rubbish you know it's it's just it's just not true and so and so that does that does give you a lot of empathy for the other side for their irrationality for their anger um you know it's just saying you know for people like Elliot Rogers or you know you know these these people who do terrible things I think anything that gives you a kind of a deeper understanding into why people end up doing terrible things and that's got to be a good thing I think yeah yeah it's it's it's crazy because uh you know just I I remember just for a long time I was this huge advocate of like hey just quit caring what other people think right and then like when I had the internet coming after me and I was spiraling out of control I wanted to like relapse right and I'm just like what's going on and and now I cut myself some slack because I'm like this is like wired inside of me you know like you're talking like yeah so so we could acknowledge it and try to fight it but it is it's like trying to fight against like a wave that's coming at you well you can't do it because it's the way you're experiencing the world I mean you know like there was this funny study that I wrote about in the book where you know because some people meditate because they they want to destroy the ego you know yeah and so they did a study of 3,700 people who who who meditated specifically to get rid of their desire for status and they found that they measured really high in what was called spiritual superiority so they were all walking around going if only the rest of the world was like me the world would be a better place it's like you know the fact is that you don't really you know people who meditate on feel they think they feel really good about themselves they think they're better than you because they know because they do it so you can't you can't get rid of it because it's it's how we experience the world and any people that really try yeah the Hikikomori in Japan and they ain't happy yeah no I uh you know just even something similar that comes to mind is when I got sober and I was introduced to you know 12 step rooms and like you know they they they try to uh uh not have the status too right but but it's it's part of me like when I walked in there I'm like oh this guy's been sober longer right oh that person's not been sober as long and we're just constantly sizing up but and they're competing over who did the worst thing oh yeah yeah the three people I killed seven people yeah oh yeah I got sober in a sober living house so just all the newly sober people just talking about oh I sniffed this off of that and you know stuff like that so it's yeah it's crazy because we'll even fight for status of who did the worst thing which is which is also nuts but um so so this this I I hope we can simplify this because I can see this being like a whole another episode but so that on an individual level you know how this has kind of helped you but like how do you think like just society culture government can do better like for example for example when I think about all this the status game and you know jobs and everything like I I keep trying to find somebody who can argue who can make who can make me believe that capitalism is just the best system right but it seems like it it just amplifies the status game and one of the one of the common you know arguments is well if we get rid of money incentives people will no longer innovate and I'm like well that's bullshit because we're always seeking status so even if we were all on the level playing field we'd still want to do better than other people you know so I'm curious I'm sure this is cross your mind like do you have any thoughts on like a starting place for just how if you you start a country tomorrow you start will store yeah country right what's the system to set up to kind of avoid these status conflicts well you're not going to avoid the status the trick is to the trick is to is to arrange the the status games in such a way that it benefits everybody so so you know in the book I write about the virtue game and the success game and what kind of defines modernity is that is that we is that since the industrial revolution you know we play success games much more now so we award status on the basis of competence you know much more than we used to for thousands of years so you know and that you know it's like anything it's not all good or all bad it's a trade-off but but it's really good when you award status for competence in terms of fighting diseases you know in creating technology it makes you know it makes the world a kind of vastly better place yeah I think you know I think you know there is no perfect system but I think the best system that we've had that we that we've come upon so far is is what you might call neoliberalism with cushions I think neoliberalism is this heightened very very competitive form of capitalism that we've been living in the midst of since the 1980s you know we've seen wealth grow through the 1980s but but but it needs more cushions you know those white working class people who have suffered through neoliberalism they need help you know people are born with low IQs with with with social personalities they need help because they fail for reasons that are not their own but not their fault so you know I you know I tend towards a Scandinavian model because they have capitalism me too yeah with cushions yeah you know just today on twitter a kind of Atlas of Happiness was published and which I retweeted because I thought it was very interesting that the happiest places were the western places with capitalism but the happiest places with the Scandinavian places where they seem to have the best of all worlds over there yeah so you know like you know there is no perfect system but but I think the Scandinavians have got it best you know they've got that they've got competition but but they use a lot of its rewards to sort of take care of the people who are less able to compete yeah yeah absolutely no I love that yeah when I look because it's not about like where you know perfection is this thing we're never going to achieve but it's like I think we can nudge a little bit closer you know we can get a little bit closer but yeah well thank you so much for your time and well honestly the book was so amazing I have like two more pages of notes for topics we didn't even get to talk on so so I hope everybody goes out gets the book at the time of releasing this the books out but can you let everybody know where they can find the book and where they can find you because you're you you are a writing machine so where can people keep up to date best thing is Twitter which is just at W store st o double r and yeah the book is the book is out september 2nd it's available on amazon and everywhere else where you usually find books yeah beautiful awesome well thank you so much will and we'll we'll do this again sometime because i'm sure you'll find it out more boys