 Anyhow, hi, I'm Don, people are looking very awake today, and actually, you know, Emily, I'm kind of with you on this one, the audience is looking a bit smaller today, so I'm guessing that either last night's dinner had a truly abysmal survival rate, or that transportation today is provided by my internet service provider. I'm not sure which. Anyhow, that's not what we're here to talk about. We're here to talk about what I like to think of as the human infrastructure of code, and that's why the talk is called to code as human. And to lead into that, I'd like to talk a little bit about how I got here, not in a biological sense, and not in like a philosophical existential sense, that's a bit long for this particular talk, but specifically how I arrived here on Wednesday night. So usually when I go into a hotel to check in for a conference, you walk up in the concierge, very politely smiles at you and says, so, sir, would you like to check in? This time, I stepped into the hotel in the concierge, smiled at me politely and just, are you okay? Never gotten that before. And the reason for this is that the flight here, I think, qualifies as the worst travel experience of my life. I don't remember when I booked with China Eastern that I checked the checkbox that said, yes, I want the authentic prison experience on my flight. I don't remember doing that. But I swear to you that the flight attendants were like drill instructors. They were marching up and down. I do mean marching up and down, sort of the aisles on the plane. They were making sure that your sheets were upright, that you could not recline. That was not allowed. They made me take out my phone multiple times to prove to them that the phone was off. Not in airplane mode, off. Never had that before on a flight. And it was strict. I was actually afraid when they like wheeled the little cart around that, you know, they were going to say like, so, would you like the chicken or would you like the beef? And I was afraid to answer because I knew that any answer that I gave would be wrong. So I snuck my phone out when, you know, the drill instructors were, I assume, off harassing other people. And I took a picture of the inside of the economy class on China Eastern. I wanted to share that with you today. And I'm really disappointed because this is very different than the picture that was on their websites. So I'm usually a very solid person. I'm not, I'm not prone to panic. I'm not the kind of person that really gets angry. But when I got to the hotel, I'm not kidding. She asked me if I was okay. And it put me in a hugely bad mood for the trunk of yesterday. In fact, one of the organizers today said, oh, so did you get here, did you get here last night? I'm like, no, I arrived day before yesterday. You probably don't recognize me because for most of yesterday I was merely a hollow shell of a man. And the reason that I bring this up is because I'm a human being. We're not robots. And unfortunately as programmers, we tend to kind of look at algorithms and data structures and speed and performance and benchmarking as our sort of yardsticks for excellence in programming. And well, these are all important things. These are very, very good things to keep an eye on. We have to be aware of our human infrastructure of code because that's really what drives excellence for us as programmers. And so this is a talk on software engineering. But we're not going to talk about refactoring or about the way that you should structure your code or about functional programming. And we're going to talk about maintaining your own human infrastructure and leveraging that human infrastructure to be a better programmer. Now, there's an old joke. I have a degree in math. I actually picked this because it had the lowest number of units of anything in STEM, and I'm lazy. And there's an old joke that mathematicians are machines that turn coffee into theorems. You give a mathematician coffee and you get out like a big blackboard full of stuff that nobody actually understands. And in the same vein, programmers are machines that turn coffee into working software. And I don't mean to say that programmers are machines. Like, that's not what I'm trying to get out here, but that your body and your mind are incredible tools, absolutely incredible tools. And like any tool, they require maintenance and maybe a bit of training in practice to get the most out of them. And so in the same vein that a investment in quality tools is one of the best things that you can do as a crowd. So you have a good laptop. You have a good phone. You have a comfortable chair. You have a good screen. One of the best investments you can make is in your own human infrastructure. And we're going to break that into two categories. We're going to talk about the software, which is your mind. And we're going to talk about your hardware, which is your body. And we're going to start with the hardware. I'm a big believer that health is very important towards crafting quality software. And the reason for this is something I like to call anti-work. So you've heard of anti-matter. I think everybody in here has seen Star Trek. And so anti-matter is this sort of like mega-matter stuff that if you take a gram of anti-matter and a gram of normal matter and you say, now kiss, you get a huge explosion. It will destroy everything around it, probably for the size of the earth. And anti-work is exactly the same thing. One time, many years ago, I was CTO for a startup in Japan as part of the Great Kuban Rush of 2009 or so. And at this startup, I had written a bunch of code because we were doing this massive rewrite. And of course, to do this, I had pushed myself very hard, was working 12, 14, sometimes even 16-hour days. And we made the big launch on time and everything was great. The launch actually went really smoothly. So I went home to get some very, very much needed rest. After about four hours, my phone rang. And it was one of my developers saying, hey, Don, I really didn't want to call you about this. But everything's on fire. Yay. And the problem was that there were the database. They had looked at it at the database. And for some reason, everything was just getting locked. There were this huge number of locks. Every time they cleared them, locks would just come back immediately. Nobody could figure out what the problem was. And they called me and they told me this. And I knew instantly that that's my bug. I did that. Sorry. Because as it turns out that cache expiry is one of the harder problems in computer science. And I had made a catastrophic mistake. And I did this not because I was stupid or incompetent, but because I was exhausted when I wrote that code. And I probably cost my team the better part of a day developer of work because I tried to push things too hard. And so when we talk about getting the most out of our hardware, our bodies, what do we really want? We probably don't care as much about strength or speed. I mean, these are great things to have. But being the Incredible Hulk does not make you a better programmer. Being the Incredible Hulk does. The thing we really want is constant energy. We want to have constant energy that we can use throughout the day. And it's really important because it's something that we don't really pay attention to very much. So one of my mantras is that you need to manage your energy and not your time. We obsess over getting more hours, more time in the day. We pull all nighters, we drink caffeine, maybe even take new tropic drugs to get more time. And rather than trying to get more hours, rather than trying to increase the quantity of hours, it's to increase the quality of them. Everybody here as a programmer knows what the zone is like. You know what I'm talking about when I save the zone? It's when you and the machine are one, the code is just flowing. It's an incredible thing. I think it's why we're programmers because that spirit, that essence of pure creation is what makes programming fun. And imagine if all or at least most of your hours could be like that. And the most fundamental thing to having those quality hours is get enough sleep. Sleep kind of recharges your psychic batteries. And one of the core parts of getting enough sleep is to wake up at a regular time and go to bed when you're tired. So that way your body will naturally drift itself into the appropriate cycle. It's important to do this on the weekends as well, because if you don't do this on the weekends, if you stay up and party and I'm guilty of this as well, very guilty of this, then you will give yourself this sort of like little bit of jet lag every single weekend which you have to recover from on Monday and Tuesday. It's very important that you don't cut more sleep to get time. Remember this is about better hours, not more hours. So really make sure you get that time in. And be careful with alcohol because as much as I love my whiskey, alcohol reduces the amount of REM sleep that you get. And REM sleep is the stuff that you really, really need. So you might have noticed that after a night of drinking, you'll go to bed and you'll sleep a really long night. You may be sleep 10 hours, but when you wake up, you don't quite feel rested. And that's why. I have a couple of tools for this. I use bedtime on my phone. I also do not disturb so that my phone will not wake me up during the course of the night. And sleep is really, really important. I have an entire slide for this and I go on about it because it sets up your daily rhythm and this is critical because we are very rhythmic creatures. Our bodies have two rhythms actually. One is the sleep cycle, and that's nominally tied towards sunlight and light. And the other one is food. So if you aren't careful to actually have a regular food schedule, this will also screw up your energy during the day. Whereas if you establish regular meals, if you have your meals at a regular time, if you have your snacks at a regular time, rather than having this sort of up and down energy during the day, you'll get a much more level feed of energy that you can use and that will help carry you forward, which is a wonderful, wonderful feeling. It also reduces the amount of stress that you deal with. So when you don't have the sort of up and down energy levels as much when it's a lot smoother, it actually does reduce the amount of stress that you feel. It's really, really nice and it boosts your focus. I actually have calendar reminders, which I've turned off that remind me to eat. Because that's how dedicated I am towards this. And I keep the same schedule on the weekends because once again you can give yourself jet lag if you break it. Food is really important actually, because it's what powers your brain. And you don't have to let have some crazy diet. It's really about the diet that works for you, but your brain will only work as well as the fuel that you put in. And I'm a big fan of watching insulin sensitivity. So focus, like if I can give any dietary recommendations, I'm not a dietitian. It would be focus on minimizing the number of sort of high insulin carbohydrates. So obviously modulo your own dietary needs, but things like pastas, rice is good. Avoiding a lot of sugar is going to help you keep that energy really, really stable during the course of the week. And my tools for this are that I also do weekly meal planning so that I know exactly what I'm going to be eating during the course of the week. And I also avoid processed food. Last but not least, motion is life. It's one of my favorite things as well. Living things move. When we're alive we're moving around. We're dancing, we're running. Well I'm not dancing obviously, because nobody needs to see that. But exercise is really critical towards that energy. It boosts endorphins. It improves your blood flow. It's great for your brain and it improves your focus during the week. And a lot of people fail to get into an exercise routine because they're always obsessed with what is the best. What's the best exercise that I could do? It's not about the best. It's about what you love. So if you love dancing, dance. Dance is great exercise. If you like hiking or walking or running or playing badminton, all of these things are absolutely wonderful things. For me it's lifting weights. I really like doing that. That gives me my fix. Or rock climbing. Rock climbing is great for programmers because it's a very mental sport. But find something that you really, really like and make it a point to stick it into your schedule. And if you have a hard time sticking with an exercise routine, the one trick that I've used every time I don't want to go train is that my rule is I have to go to the gym. I don't actually need to do anything when I get there. I just have to get there. Because more often than not I'm going to stand in the gym in my stupid shorts and I'm going to want to start and do something. And you can use that mental momentum to carry you forward. And these are really kind of the pillars of your constant energy which are what are going to drive you through the day as a programmer. And I cannot stress how important these are because optimizing your hardware and taking care of your hardware and your body is really what's going to drive you towards being able to build great software. And that's the hardware part. Maybe these are things that you already knew. Now let's go ahead and talk about software. Because we really need to understand how our software works in order to understand how to get the most out of it, right? Like there's this great talk about the Ruby object model and how all of these all these objects tied together with artwork that I'm incredibly jealous of. And the, by understanding that, by understanding how Ruby's object system works, we become better programmers. We have a better idea of what's going on under the hood. This is what a good programmer does. We understand our tools deeply. And so let's understand our minds a little bit more deeply. There's a lot of limitations to our brain and you may or may not be aware of these. One of my favorite is this, that you are blind. Literally blind for 14 minutes every single day, every person in this room. And the reason that you're blind is because of something called the saccade. So the fastest motion in your body, the fastest thing that you can do is called a saccade. It's the motion that your eye makes. See we don't actually see a full scene. As I look out on this audience, I'm not actually seeing all of you in perfect clarity. Now I'm seeing a little spot here and a little spot here and a little spot here as I look around the room. And my brain is stitching that together into a whole image that says, yes, there is a room that is about 40% full of people. Now the thing about the thing about saccades is that there's a limited amount of motion that they have. So if you were to, if you take, if you, if you take your hand out and you hold your palm out, the middle of your palm is about the your focal area. That's what you can see and everything else your eye is going to have to move. And if you're holding your arm out straight and you move it to shoulder width, that's about as far as your saccade will go. So that means that if you hold your arm out like this, look straight forward and then look to your arm, your eye will turn to that. If you hold your arm out farther and you look, your head will naturally turn to follow it. So if you have something that takes too wide of the field of vision in front of you, it's going to require a lot of neck motion which is smaller and more tiring. So there's something that this ties into and you might have heard it before. It's one of those programming rules that people may think that's like, wow that just sounds kind of arbitrary. And that's that long lines. When you have a line that goes really over about 80 characters, it starts going outside of your saccade boundaries. And so if you have really long lines on a really big screen, you start scanning back and forth with your neck and it makes you more tired. This is actually a principle discovered by ancient typographers. If you look at books, like a lot of books the size of a page is actually quite narrow and it's because it allows you to scan with your eyes rather than having to turn your head. It's another fun limitation you've probably heard of and that's that your working memory is limited to about seven plus or minus two items. And the interesting thing about the way that your memory works is that it degrades. You get lossy compression. So for example, if you try and remember a long string of digits, like you know just you know a series of 16 digits, what your brain will do is it will chunk it down a little bit until you remember maybe like the first three and the last four or something along those lines and you will think that you have remembered all of it but you really haven't. And that's really kind of the evil thing is that when you're working through a really long function, for example, you think it's all in your head but you have actually lost stuff and you don't even know. This is one of the reasons why we talk about keeping functions small, right? In that if you have a function that goes outside of that working memory size, it goes outside of that seven plus or minus two items, you will drop things and you will make mistakes. And that's one of the reasons, probably the biggest reason, I think, that we want small functions. It's why they are comprehensible. And so these rules that you've definitely heard before are driven by our limitations as human beings, the limitations of our bodies and our minds. And a lot of people I've heard that I've worked with especially as a manager have complained that these rules feel very arbitrary. It's like a straight check but they really are rooted in our limits as human beings. And this why really matters. The why is very important because you can follow all the rules but if you don't understand why you can still do stuff like this. This follows the rules. It's a short function, it's got one line. That means it's the best function. See, we got the best functions here. And the interesting thing, you know, people and people talk about small code, right? Like, you know, if you have small code, well there's few places for bugs to hide. There are three bugs hiding in this. And I didn't actually realize that until I did something else. And we'll talk about that later. Now this is, we've got a little thing, oh it looks like my phone's decided that it wants to ring. There we go, you don't need to ring now. So this ties into something else and that this code is really hard to read. Like yes, we can make sense of what it does but it's not really readable code. And that's really important because of another aspect of how our minds work. And that is that we are built to remember stories. We remember, we remember tales, we remember epics. And this is because of how we've evolved. So writing, the, you know, human writing has only existed for about 10,000 years. But modern humans have been around for millions of years. And that means that for all of that time outside of, you know, 10,000 years ago, all that time before, all those millions of years, we were conveying information to each other and we were doing it by telling each other stories. You know, the Epic of Gilgamesh, all of these things were passed through oral tradition throughout history. And this is really important because some of you might actually remember since I told the story about a bug that I made and relating to Cachex where you probably remember a little bit of that about that because I told the story about how it was my big mistake because I was too tired and I wasn't respecting anti-work. This is actually, there's actually even a thing coined about this called the method of loci, where it was how I believe it was Aristotle once remembered all of the people around a dinner table because he had told the story and a joke involving all of the different guests. Now we're going to get to why stories are important in just a second. And when we, when we go into the latter bit, the, I've actually gone off the rails a little bit. Stories are, are so critical to us and the reason why they're critical as programmers is because that our code should tell the story. And if your code reads like well-written pros, you know, you get this cognitive fast track into your long-term memory because of that method of loci. So if your code tells the story of what it does, that means that it goes into the deep parts of your brain and six months later when you come down the road and you have to touch that stuff again, you're a lot more likely to remember not only what you were doing at the time, but all of the context around it because our memories are interconnected. We don't remember facts, we don't remember data points like a computer, we remember sort of intersections of things. So for example when you think about a dog, you're not thinking of a data point of like, you know, this is a dog, it's a Labrador, you have this sort of intersecting memory of everything that is dog-ness and that is what you are recalling in your brain. So if we go back to that snippet and we refactor it understanding the why-by in this, we get something that is, I think, a lot more readable and simply by refactoring this we now understand a lot, you know, a lot more what's going on here. It's like, oh, we're dealing with short colors and long colors now, so we have the short RGB codes and long RGB codes. But we also, solely by refactoring, solely by refactoring this and by breaking it apart, uncovered several bugs. One of them was, and of course I've broken the rule of refactoring and then fixing some bugs, but I'm not doing those two slides, and we found things, for example, like the hex digits were improperly specified, there were places where punctuation was missing and there was a place where we were actually missing a method call, so that code would fail to even run. Now another really interesting aspect of your psychology that you can leverage during the day is that you only get a finite number of decisions that you can make. Decisions, making a decision uses energy. Remember energy, energy being kind of important? Well it uses it every time you make that decision. So if you go to one of those sort of coffee places that has a million different things on the menu, that's actually a little exhausting. There's a term for this in cognitive psychology, it's called decision fatigue. Whereas when you have a coffee shop like the one set up here where you walk up and it's like, well, I can have coffee with or without milk. And that's pretty much it. Easy choice, you know, you don't have to figure out, it's like, oh god, do I want an extra shot in that latte mocha frappuccino, double, double, oh god, I don't know. Yeah, and so use those decisions really, really wisely. There's a, there's a, there's a really good decision, a really good story about this that I like, which is also taken from psychology research, and that is that, so if you're in prison, which I hope you won't be, then you have an option to do something called going up for parole, which means that if you have been a good prisoner, a model prisoner, then you can get released a little early than you would otherwise. And if you are put up for parole, you have a parole hearing in front of sort of a panel of people that will determine whether or not you can leave prison early. So this is a big important thing for you. And if you are a prisoner and you are up for a parole hearing, you want to go as early in the day as possible. Really, really topical advice for this audience, I know, right? And the reason for this is because early in the day, the judges arrested and they will actually listen to your case. They will look at your evidence. They will look and say, well, you know, this person's been really good, you know, except for that one instance where they, you know, they fixed a bug and refactored at the same time. I don't know if we can let them out. Whereas if you go later in the day, they've already made decisions. They made a lot of decisions. They've listened to a lot of other people and now they're tired. They don't really care anymore. And their default behavior for you is probably just going to be to say, deny. Decision fatigue is a very powerful thing and you will fall back on your path of least resistance, which is also one of the reasons why discipline is something you need to be very, very careful of. I don't like discipline. I really don't. I think that discipline is overrated and that you need to build good habits. So habits are decisions that you've already made and there are things that you've encoded in your behavior, that you've encoded in the deep structures of your brain so that you automatically do the right thing because you can't rely on discipline. Discipline is you making a choice. You make a decision to do the right thing and you need to teach your brain to do that right thing automatically and a lot of best practices, a lot of the things that we hear about that we really want to be doing as programmers are nothing but good habits that leverage the way that our brain works. One of my favorite examples is the reward cycle. So you have a cycle that operates inside of your brain. It's called the dopaminergic cycle. Hopefully I'm pronouncing that correctly. My pronunciation, I've read these things and unfortunately English is hard. So the way that this works is that your brain will, when you start to actually do something, you have a goal, you have something you want to accomplish and it doesn't matter what this is, this could be writing a feature, this is brushing your teeth. Your brain will pump a little bit of, it'll pump a little bit of, I want to say dopamine if I'm remembering this correctly, pump a little bit of dopamine and you just say hey, you should totally brush those teeth. Those teeth really need to be brushed and as you move towards that goal, as as you work through the brushing, as you do the thing, you know your brain is pumping a little bit more, reward chemical, a little bit tiny bit more, motivation chemical and into itself and then once you finally completed the task, boom, you get this nice rush, okay, because you've actually completed it. You don't feel it, okay, I mean I don't think most of us finish brushing our teeth and think like yeah, okay I do, but okay. And this is how people, by the way, get addicted to things, because that, like if you, like you can get addicted to exercise because the bigger, the bigger the stimuli, the bigger the accomplishment, the bigger that rush is. This is how addiction works and the thing that's really, that really is interesting about it is that you get this strong reward and then it fades away really quickly. You know, you, you accomplish the thing and you're really, really happy and then you just kind of go back to baseline. You buy that new car, that really awesome new car, you finally got the Mercedes or in my case the Kia and you, it's a really, really, really great car for like the first couple weeks and then after that it's just sort of like well it's just my car now, because the reward fades. And this is how motivation works. This is literally why you do everything that you do, including writing software. And that's why test driven development is so important. Because remember the prize goes at the end. You know, you get the rush after you brush your teeth, not before. And so if you put that, if you do test later development, which usually turns into test never development, what you're doing, your goal is not to write the test. You are not there to write, well at least most of us, are not there to write the test. That's not the thing that we're there to accomplish. We're there to build a feature. We're there to build something that gives somebody some new capability that makes people happy. And by putting the test first, we put the tests in the weight of that goal. It becomes something that we need to get over to accomplish what we're trying to do. And so what we're really doing with test driven development is we're leveraging that motivation cycle by putting the busy work first. And so you do that and you work through the test and you get the thing and finally when all those tests are green, you're done. Yay! You get the, you get the green test. That's awesome. And the feature is done. And you can use a little bit of that tail rush, you know, from, from actually accomplishing things, maybe to do some refactoring. And this is why red-green refactor works, because it actually leverages the way that your brain works. It doesn't rely on discipline, whereas test later development, when you write your code and then you write your tests later, means you have to be disciplined. You have to finish doing the thing and then afterward, and you have to be disciplined while you work to remember all the things that you need to test. And then afterwards, you have to then go and be like, okay, I've done the thing now, now I'm going to go spend all the time writing the tests. So TDD leverages your brain cycle. Another interesting little aspect of your brain, so speech is really distracting. This is something that's buried deep within our brains. If, if you, it's, it, you find this all throughout nature, birds chirping. So when a sparrow chirps or it makes an alarm sound, it registers in all other sparrows in the area. No other birds, just sparrows, because we've evolved to have these deep structures in our brains. In humans, it's called Vannikas area. It's literally located right behind your ear. And that registers things like alarm, danger, things that you need to be worried about. In humans, it's tied to our names. So if somebody is asleep, you can be talking to them and nothing will happen. But if you call their name, they'll wake up. And so that's because we have this deep structure in our brain. Now, it's always listening. It's like the NSA. Now, I'm sorry I didn't mean it. And the problem with this is that that means it's always processing. And if you're in a big open plan office, because as we all know, open plan offices are fantastic, and that's why everybody uses them, then you're getting this constant distraction of people talking. And it doesn't matter if you put headphones on, they don't block out everything. And so you're always getting this continuous feed that is keeping Vannikas area engaged. This is a bit of a problem because this is quite annoying. I mean, we've all experienced this kind of distraction when you're working in an office, but there is a solution. And it's pair programming. Pair programming actually solves a lot of things. I'm a huge, huge fan of pair programming. I will literally, I will talk until Vannikas area has shut down about pair programming. But what it does when you're pairing, you're working with your parent, you're talking to them, you're going back and forth, and you're kind of having the ping pong going on, and it's keeping the speech area, it's keeping Vannikas area engaged. Which means that that's not processing all the stuff going on around you. It's not processing like the sales calls that are going on, and the irate customer in the corner, it's just processing what you're doing with your pair. So this removes a huge chunk of distraction, and it makes you happier during the course of the day. And pair programming has tons, tons of benefits. I mean, you've got the real-time code review. Remember that reward cycle? Who loves to, you know, you get done right and something you're like, well, I need to, like, work on this feature, but I've got a stack of code reviews to do. You know, doing good code reviews is hard. You know, it is very, very hard to be a good code reviewer. It's actually one of the reasons I'm looking forward to a talk later on today on code reviews because I do want to get better at this. But if you're in a full pairing team, you're doing your code reviews in real-time because you have a pair there. You have a person there who is saying, whoa, whoa, whoa, whoa, whoa, whoa. What is I? What does that variable mean? Why is there a variable called foo? Actually, no, why is there a variable called data? There should never be a variable called data. It's all data. It's the worst variable name ever. And so pair program gives you a lot of excellent things. There's tons of other stuff. Like, I'm not going to go into too much detail on it now. So we're almost at the end of our time here. And I think that really, you know, if you could take one thing away from this entire talk, it would be do not fly China Eastern Airlines. You're all far too young and you have far too much to live for and to give to the world. Okay. And if you could take two things away from this talk, the second is, don't fly China Eastern. I mean it. If you could take three things away, the third would be that you need to invest in yourself, which is why you don't fly China Eastern. Okay. And investing your health and happiness. And you leverage those cognitive limits. You leverage your psychological quirks and the quirks of your body. And you learn to work with it because that is what will help you drive excellence in your craft as a software engineer. And this really isn't just about excellence as a software engineer because we all want to be good at what we do. We all want mastery over what we do. But it's also about just being happier and having a good life. So I always forget to do this part. I always forget to talk about like I have like a website where I write articles and stuff. And I do actually use Twitter now finally. So if you would like to see articles on how to CTO and how to developer and I guess how to Twitterer then that's all here. And I believe we have hopefully time for a little bit in the way of questions. Do we have anyone with questions? Okay. So Yay. So yeah, thanks for the talk. I actually have a couple of points. So I'll just bring them up. Sure. All at once. Okay. And pass the microphone. No pressure here. Chill out guys. First of all regarding the sleep cycles that you mentioned. I read quite a bit about different sleep patterns. Yes. How to potentiate your your productive time by sleeping less without feeling tired, without overexhausting yourself. So I would like to hear if any your opinion on that. So let's you have many points. This is the first one. Let's do these. If you don't mind, I'd just like to tackle that because it's a big one. Okay. So you raise something in interesting point, which is that there are multiple different sleep patterns that you can engage in. I think specifically, you're talking about polyphasic sleep. Yes. Okay. Cool. So polyphasic sleep, for those of you who don't know, is where you can actually break up your sleep nominally into two chunks. And something that that people did actually in antiquity is that they would go to bed when the sun went down and they would wake up again sometime maybe around 1am and have about two or three hours of productivity and then they would go go fall asleep again and then they would wake up again with the sun. This is actually a very common sleep pattern. In fact, it's one that I do right now not because of choice, but because my brain has decided that's what it needs to do. The thing about sleep is that you really do need to listen to your body. It isn't that you need to set eight hours and you must get exactly eight hours. It's that by having a regular schedule for your sleep and by making sure that you get enough, e.g. not forcing yourself to stay up when you're tired, saying like, oh, I need to get this code done. By having that regular schedule, now it's not about the number of hours to put the quality. That's what will give you your good sleep and your constant energy. So the goal of polyphasic sleep is not necessarily to cut out the number of hours because you really actually don't cut that many. Like if having switched from a normal sleep cycle or sorry, a constant sleep cycle to a poly... constant is not the right word. There's a word for that. A solbox. Continuous. There we go. Yeah, you can tell I have a math degree. So a continuous sleep cycle in one that is broken up into two different chunks, then having made that switch, I can definitely say that I sleep maybe a couple hours less, but it's... I kind of actually pay for that because I end up having to take a small nap or something later in the day. Like I do still pay a bit of a sleep debt. And also age, as you get older, I'm obviously quite advanced in years. As you get older, you do need a sleep lesson. So I don't think you're really saving that many hours. Have I answered that question? Yeah, we can talk about more. Okay, sweet. Sweet. Cool. And then just a note on the thing of the instant reward. Make your bed in the morning. It's another... Make your bed in the morning. It's another instant reward. Actually, yes. And regarding the pair programming, a bit more serious talk now. As my... We do pair programming in our company as well, but what I feel is that if the pair is uneven, which is, I think, somehow common to find uneven pairs, it's very easy for the strongest pair to persuade that his solution is better and the weaker pair, just accepts it and doesn't refute. I would love to talk about this, but this is totally outside the scope of this talk. I'm actually going... So I give a small talk at a meetup called Pairing for Happiness and we addressed a little bit of that there. So I'm going to pitch that at conferences and I'll send you a link to it. So if you follow me on... If you follow me on Twitter, this is how I get Twitter followers, by the way. Yeah, so if you follow me on Twitter and sign up for my blog, then you'll get... You'll totally get a link to that video when it comes out. Cool. Any other questions? I think... Did you have one? Yeah. Hello. Sorry, yeah. We'll... It's not a question, a few addendons to the things that you said. The first one is from... Somewhere in the Y Combinator startup school lectures that I heard that and it was about doing one thing at one time. It followed from the fact that when a person has more than one thing to do, they're likely to pick up B1 problems rather than the A problems which need to be done anyway. And it applies to the personal life as well in the sense that you can't be a superhuman. If you try to set your targets too high, that I'm going to improve myself technically, improve myself personally, health, diet, nutrition, you'll end up failing in all of them. Pick one of them, do it, make it a habit and routine then move to the next one. Other is, yeah, again something everybody knows but fails to follow and follows from the first one. Perfect is the enemy of good. So you don't try to be the perfect person or the perfect programmer or the perfect, look for the perfect diet or the perfect exercise. If you don't start, you'll never even reach the good stage. Perfect is something which will sweat much later in your life or stage. Very much so. Oh, please. Yeah, another point is it's easier to understand. I'm sure a lot of people follow sports and you will hear a lot of prodigies and stuff and then you'll figure out only some of them made through. And then there will be a lot of people that will find in sports. You will feel that they are not so talented but the discipline which brought them forward. And the person who's talented and disciplined will always do better but only the disciplined one will do better than the talented ones if the same level of effort that goes into that. So you actually raise a really important point and this is, I think part of also being a programmer, right? Like one of the things that we do is problem decomposition. Like a very important part of being a programmer is when you're sitting down to write the code. You don't try and code all the things at once. You break your problem down into little chunks and you solve those. So when you're talking about setting goals, goals work the same way. And it's not just about goals it's about having the goal the thing that you want to achieve and building yourself a system that gets you there every day. But that's also another talk on habit formation and building systems within your life. I only have so much time. Okay, actually I think you have a microphone and you had a question. Yes, so I wanted to ask you how do you keep your habits when you're traveling? I always find it very, very difficult. Like, you know, I do 50 push-ups a day and then travel for a few days and when I travel I get very different rewards. And when I come back home I'm like, I already stopped doing push-ups for a few days. So the habit is gone and how to... So I would like a round of applause for this man because he has asked a great question. So it's difficult because travel exactly as you mentioned when you get on a plane because nobody here has ever done that. When you get on a plane and you go someplace it breaks those habits because you've had this reset to your cycle. Number one is that when I land I immediately get back on the food cycle of whatever my location is. So I set my watch when I get on the plane to wherever it is I'm going. So I'm on destination time and from that point I try and follow the routine that I would. I try and sleep when I would even if it's just relaxing and I'm not actually sleeping that's fine. Usually the airlines are good about actually having you on the same meal schedule. That's why those meals are always at weird times. And when you land have your meal at the right time even if you're not feeling hungry like you may land and you think, well, I'm not really feeling like eating right now but it's dinner time have a little dinner have something and force yourself back into that routine. Number one. Number two, especially if you're somebody who if you exercise in the morning or the evening once you get there set that calendar reminder and follow that rule if you just have to start like pushups. Pushups are a great example. The talk about what was it? Wheelchair, hacking your wheelchair really resonated with me because I actually spent some time in one as well. And so I'm finally recovered. I'm doing fine but I'm building back up to doing weight training again. And as part of that I've been doing a lot of pushups and I don't like doing a lot of pushups really if I'm completely honest. I did enough in ROTC and I'm kind of over them now but in order to get some in order to get my pushups in I have to do one. So I have my exercise time and it's like okay I have to sit down and do my one pushup and if I do my one pushup and I don't want to do any more pushups that is my pushup for the day. I owned that pushup. Yeah, that one was mine and so by doing that by by leveraging that mental momentum for those key habits you can't do it for all of them but you have just enough discipline to do that and you leverage their momentum that helps you get back into that routine back into that cycle. Yeah, have I answered your question hopefully? Yeah, absolutely. And second question which airlines do you go back to Tokyo with? Yeah, well I had options. There was there was there was some like con air prison airline that I was tempted. They had a pretty compelling offering swimming looked good. I was thinking about just going to the airport and just kind of like doing this as the flights went by and hope but maybe hope one would stop or just moving to Singapore was an option as well. I could stay but no, I actually I'm not kidding. I literally booked a one-way ticket back on on ANA. Yeah, so yes, yes. I'm glad that somebody got the point in my talk. All right, we have a question up here. Sorry. Hi, so I have a few friends who always tell me like, Oh, I have no time to even start all these salty habits. What would you tell them? Ooh, another great question. So the first one is you you only have a limited number of hours in the day, right? Like you don't get more. And if you really focus on quality hours that number is not only somewhere on 16. You need to prioritize religiously. So people say that they don't have time. There's probably a lot of stuff that they're doing that is friction in their lives. So they're, here's a great example. I have, I absolutely adore my brother-in-law, but he's very, he's the kind of person that has this sort of thing of like, you won't take one over on me. And he, he once had a case where I think his phone company built him an extra $40 on his phone, $40 on his phone bill. $40. You make good enough money. It's $40. And he went to war over that. I can't, I probably spent the better part of a week of concentrated effort to get that $40 back. That's friction. And so letting the little things go is a very important part of that. Like learning, learning to let those things go and not focus them. One of the other things is that to, to concentrate your efforts and then multiply them. So for example, I cook, I love to cook one of my biggest hobbies. But when I make pasta sauce, my ragu pasta, I make a gigantic batch of it and I freeze the rest so that later on during the week, if I'm untired, I don't want to make dinner, I have dinner available. I have food at home that I can eat. And I don't need to go through a lot of extra effort to have a nutritious meal. I'm actually going to be investigating, I think, joylent as well so that I have something at home that I don't need to worry about getting a meal. I do a lot of other things where, for example, my work hours are incredibly regular life. I follow the same schedule every single day part of having that regular schedule. And that means that when I hit the end of the day, I'm done and I know I have that time available to me. And I religiously prioritize that time. I keep the things that matter. Like, I really care about making sure I get exercise. So I don't watch a lot of TV. I care about things like making sure that I actually go out and I spend time with people. And so I kick out, but I don't want to be drinking too much right now, so I focus that on like, okay, I'm going to combine exercise and I'm going to go out with friends, so we're going to go climbing together. And so leveraging things like that where you focus, you focus, you prioritize, and you also combine. Like, those things together really help you get a lot of quality time back in your day. Have I answered your question? Yes, yes. I think it's like, what, four for four? Yes, sorry. I have to cut it short. Yeah. So if anyone else has any more questions, you can look for Dan after during the break or at lunch. Yeah. I'm sorry, bro. All right. So let's give a round of applause for Dan. Thank you very much.