Summarized using AI

To Code is Human

Don Werve • June 23, 2017 • Singapore • Talk

In the talk titled "To Code is Human," Don Werve emphasizes the importance of understanding the "human infrastructure" behind software development. He discusses how cognitive psychology can be applied to improve programming practices and enhance overall productivity.

Key Points Discussed:

  • Human Infrastructure in Programming: Werve highlights that programmers often prioritize algorithms and data structures, neglecting the human factors that drive their performance.
  • Energy Management Over Time Management: Rather than focusing solely on getting more hours of work done, he suggests managing energy levels effectively through proper sleep, nutrition, and exercise.
  • Importance of Sleep: Sleep is vital for maintaining energy and cognitive function. Regular sleep schedules and avoiding alcohol to preserve REM sleep are critical.
  • Diet and Nutrition: Werve encourages establishing regular eating habits to maintain consistent energy levels throughout the day, advocating for diets that stabilize insulin levels.
  • Exercise: He elaborates on the role of physical activity in improving focus and overall health, recommending that programmers find enjoyable forms of exercise to incorporate into their routines.
  • Understanding Cognitive Limits: Werve shares insights from cognitive psychology, such as limitations in working memory and decision fatigue, emphasizing the need for programmers to work within these constraints.
  • Code Readability and Storytelling: He explains that code should communicate its purpose clearly, likening good code to well-written prose that is easier to remember and maintain.
  • Decision Making: He discusses decision fatigue and stresses the importance of making wise choices, advocating the development of positive habits over relying on discipline alone.
  • Pair Programming: Werve promotes pair programming as a means to reduce distractions and enhance productivity, highlighting its benefits for real-time code reviews and maintaining focus.

Conclusions and Takeaways:

  • The essence of coding lies not just in technical skills but in understanding and optimizing the human aspects involved in software development.
  • Proper self-care through sleep, nutrition, and exercise can significantly influence programming effectiveness.
  • Embracing cognitive psychology principles can lead to better coding practices and improved code quality.
  • By investing in their own mental and physical infrastructure, programmers can foster not only professional success but also personal happiness and well-being.

To Code is Human
Don Werve • June 23, 2017 • Singapore • Talk

Speaker: Don Werve, Consultant, Minimum Viable

Programming is a deeply mental art. And as programmers, we invest large amounts of time in mastering new languages and new tools. But all too often, we neglect understanding of the most important tool in the developer's toolbox: the programmer's brain itself. In this talk, we will combine the art of programming with the science of cognitive psychology, and emerge with a deeper understanding of how to leverage the limits of the human mind to sustainably craft software that is less buggy, easier to understand, and more adaptive in the face of change.

Speaker's Bio

Don is from California, lives in Tokyo, and divides his time between cooking and training to survive the impending zombie apocalypse. He has spent the past seven years working around the world as a back-pocket CTO and software engineer, helping companies solve tough team management and scaling issues, and today he joins us to chat about the human infrastructure of software engineering.

Event Page: http://www.reddotrubyconf.com/

Produced by Engineers.SG

Help us caption & translate this video!

http://amara.org/v/8HYN/

Red Dot Ruby Conference 2017

00:00:04.620 anyhow hi I'm dawn people are looking
00:00:10.240 very awake today and actually um you know Emily I'm kind of with you on this one the audience is looking a bit
00:00:16.840 smaller today so I'm guessing that either last night's dinner had a truly
00:00:22.960 abysmal survival rate or that
00:00:28.200 transportation today is provided by my internet service provider I'm not sure
00:00:33.850 which anyhow that's not over here to talk about we're here to talk about what I like to think of as the human
00:00:40.060 infrastructure of code and that's why the talk is called to code as human and
00:00:45.100 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
00:00:52.079 philosophical existential sense that's a bit long for this particular talk but specifically how I arrived here on
00:00:59.250 Wednesday night so usually when I go into a hotel to check in for a
00:01:05.290 conference here you walk up in the concierge very politely smiles at you and says so Sarah would you like to
00:01:10.450 check in this time I stepped into the hotel concierge smiled at me politely and just are you okay never gotten that
00:01:19.840 before and the reason for this is that the flight here I think Olaf ice is the worst travel experience of my life I
00:01:27.700 don't remember when I booked with China Eastern that I checked the checkbox that said yes I want the authentic prison
00:01:34.689 experience on my flight I don't remember doing that but I swear to you that the flight
00:01:41.460 attendants were like drill instructors they were they were marching up and down I do mean marching up and down sort of
00:01:47.460 the aisles on the plane they were they were making sure that your seats were upright that you could not recline that
00:01:53.549 was not allowed they made me take out my phone multiple times to prove to them
00:01:58.830 that the phone was off not in airplane mode off never had that before on a
00:02:04.920 flight and it was strict I was actually afraid when they like wheel boo-boo cart around that you know they were going to
00:02:11.370 say like so would you like the chicken or would you like the beef and I was afraid to answer it because I knew that any answer that I gave would be wrong so
00:02:20.430 I snuck my phone out you know when when you know the drill instructors were him off harassing other people and I took a
00:02:26.400 picture of the inside of the economy class on trying to Easter night I wanted to share that with you today and I'm
00:02:34.980 really disappointed because this is very different than the picture that was on their website so I'm usually a very
00:02:44.010 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
00:02:51.480 hotel I'm not kidding she asked me if I was okay and it put me in a hugely bad
00:02:56.880 mood for the chunk of yesterday in fact one of the organizers today said oh so did you get here did you get here last
00:03:02.040 night like no I arrived day before yesterday you probably don't recognize me because for most of yesterday I was
00:03:07.530 merely a hollow shell of a man and the reason that I bring this up is because
00:03:12.989 I'm a human being we're not robots and unfortunately as programmers we tend to
00:03:19.380 kind of look at algorithms and data structures and speed and performance and
00:03:24.420 benchmarking as our sort of yard sticks for excellence in programming and well
00:03:30.870 these are all important things these are very very good things to keep an eye on we have to be aware of our human
00:03:37.290 infrastructure of code because that's really what drives excellence for us as programmers and so what I this is a talk
00:03:44.100 on software engineering but we're not going to talk about refactoring or about
00:03:49.260 the way you should structure your code or functional programming and we're going to talk about maintaining your own human
00:03:54.820 infrastructure and leveraging that human infrastructure to be a better programmer now there's an old joke I have a degree
00:04:01.750 in math I actually picked this because it had the lowest number of units of anything in stem and I'm lazy and
00:04:08.350 there's an old joke that mathematicians are machines that turn coffee into
00:04:14.080 theorems you give a mathematician coffee and you get out like a big blackboard full of stuff that nobody actually
00:04:20.080 understands and in the same vein programmers are machines that turning coffee into working software and I don't
00:04:27.940 mean to say that programmers and machines like that's that's not what I'm trying to get at here but that your body
00:04:33.250 and your mind are incredible tools absolutely incredible tools and like any
00:04:39.100 tool they require maintenance and maybe a bit of training and practice to get the most out of them and so in the same
00:04:46.570 vein that a investment in quality tools is one of the best things that you can do as a Crouse you have a good laptop
00:04:52.390 you have a good phone you have a comfortable chair you have a good screen one of the best investments you can make
00:04:57.610 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 we're going
00:05:04.450 to talk about your hardware which is your body and we're going to start with the hardware I'm a big believer that
00:05:10.600 health is very important towards crafting quality software and the reason for this is something I like to call an T work so ant you've heard of antimatter
00:05:18.130 I think everybody in here has seen Star Trek and so antimatter is this sort of like negamatter stuff that if you take a
00:05:24.970 gram of antimatter and a gram of normal matter and you say now kiss you get a huge explosion it will destroy
00:05:32.020 everything around it probably for the you know the size of the earth and anti work is exactly the same thing one time
00:05:38.470 many years ago I was CTO for a start-up in Japan as part of the the great coupon
00:05:43.480 rush of 2009 or so and at this startup I had coded written a bunch of code
00:05:49.720 because we were doing this massive rewrite and of course to do this I had pushed myself very hard was working 12
00:05:55.120 14 sometimes even 16-hour days and we made the big launch on time and everything was great the launch actually went
00:06:01.540 really smoothly so I went home to get some very very much needed rest after about four
00:06:07.810 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
00:06:15.060 everything's on fire yay and the problem was that there were
00:06:21.670 the database they had looked in it you know at the database and for some reason everything was just getting locked every there were this huge number of locks
00:06:27.580 every time they cleared them blocks would just come back immediately nobody could figure out what the problem was and they called me and they told me this
00:06:34.210 and I knew instantly that that's my bug I did that sorry because as it turns out
00:06:42.340 that cache expert is one of the harder problems in computer science and I had
00:06:48.820 made a catastrophic mistake and I did this not because I was stupid or incompetent but because I was exhausted
00:06:55.420 when I wrote that code and I probably cost my team the better part of a day developer of work because I tried to
00:07:02.110 push things too hard and so we talked about getting the most out of our hardware our bodies what do we really want we probably don't care as
00:07:08.740 much about strength or speed I mean these are great things to have but being the Incredible Hulk
00:07:13.780 does not make you a better programmer being the credible Hulk does the thing
00:07:19.030 we really want is constant energy we want to have constant energy that we can use throughout the day and it's really
00:07:24.610 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
00:07:30.760 manage your energy and not your time we obsess over getting more hours more time
00:07:36.700 in the day we we pull all-nighters we drink caffeine maybe even take nootropic drugs to get more time and rather than
00:07:44.020 trying to get more hours rather than trying to increase the quantity of hours it's to increase the quality of them you
00:07:50.530 know 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
00:07:56.890 one the code is just flowing it's an incredible thing I think it's why we're programmers because that that spirit
00:08:03.070 that essence of pure creation is what makes programming fun and imagine if all
00:08:08.950 or at least most of your hours could be like that and the most fundamental thing to having those quality hours is get
00:08:15.790 enough sleep sleep kind of use your psychic batteries and one of
00:08:21.310 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
00:08:27.070 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
00:08:33.580 weekends if you stay up in party and I'm guilty of this as well very guilty of this then you will give yourself this
00:08:40.120 sort of like a little bit of jet lag every single weekend which you have to recover from on Monday and Tuesday it's
00:08:45.790 very important that you don't cut more sleep to get time remember this is about better hours not more hours so really
00:08:51.130 make sure you get that time in and be careful with alcohol because as much as I love my whiskey alcohol reduces the
00:08:57.700 amount of REM sleep that you get and REM sleep is the stuff that you really really need so you might have noticed
00:09:03.100 that after a night of drinking you'll go to bed and you'll sleep a really long you maybe sleep ten hours but when you wake up you don't quite feel rested and
00:09:09.730 that's why I have a couple of tools for this I use bed time on my phone I also
00:09:15.220 do not disturb so that my phone will not wake me up during the course of the night and sleep is really really
00:09:20.800 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
00:09:28.030 creatures you know our bodies have two rhythms actually one is the sleep cycle so and that's nominally tied towards
00:09:33.520 sunlight and light and the other one is food so if you aren't careful to
00:09:38.680 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
00:09:44.470 a regular time if you have your snacks of regular time rather than having this sort of up-and-down energy during the
00:09:49.780 day you'll get a much more level feeding on your G that you can use and that will help carry you forward which is a
00:09:55.180 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
00:10:01.510 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
00:10:08.620 have calendar reminders which I've turned off that remind me to eat because
00:10:13.870 that's how dedicated I am towards this and I keep the same schedule on the weekends because once again you can give yourself jetlag if you break it food is
00:10:21.520 really important actually because it's what powers your brain and you don't have to let have some crazy diet it's
00:10:27.490 it's really about the diet that works for you but your brain will only work as well as the fuel that you put and I'm a big fan of watching insulin
00:10:35.410 sensitivity so focus like if I can give any dietary recommendations another dietician it would be focus on
00:10:41.949 minimizing the number of sort of high insulin carbohydrates so obviously modulo your own dietary needs but things
00:10:47.920 like pastas Rice's are good avoiding a lot of sugar is going to help you keep that energy really really stable during
00:10:54.190 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
00:10:59.949 going to be eating during the course the week and I also avoid processed food last but not least motion is life so one
00:11:08.019 of my favorite things as well living things move you know when when when we're alive or moving around you know
00:11:14.019 we're dancing we're running well I'm not dancing obviously because nobody needs to see that but exercise is really
00:11:21.759 critical towards that energy it boosts endorphins and improves your blood flow it's great for your brain and it
00:11:27.009 improves your focus during the week and a lot of people fail to get into an exercise routine because they're always
00:11:32.050 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
00:11:37.750 love so if you love dancing dance dance is great exercise if you like hiking or walking or running or playing badminton
00:11:44.339 all of these things are absolutely wonderful things for me it's lifting weights I really like doing that that
00:11:50.170 gives me my fix or rock climbers rock climbing is great for programmers because it's a very mental sport but
00:11:55.360 find something that you really really like and make it a point to stick it into your schedule and if you have a
00:12:00.940 hard time sticking with an exercise routine the one trick that I've used every time I don't want to go train is
00:12:06.190 that my rules 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
00:12:11.319 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
00:12:18.189 something and you can use that mental momentum to carry you forward and these are really kind of the pillars of your
00:12:23.920 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
00:12:30.459 your hardware and taking care of your hardware and your body is really what's going to drive you towards being able to
00:12:35.709 build great software and that's the hardware part maybe these are things that you already knew now let's go ahead
00:12:41.889 and talk about software and 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
00:12:48.339 great talk about the ruby object model and how all of these all of these objects tied together with artwork that
00:12:53.770 I'm incredibly jealous of and the by understanding that by understanding how
00:12:59.589 Ruby's object system works we become better programmers we have a better idea of what's going on under the hood this
00:13:05.140 is what a good programmer does we understand our tools deeply and so let's understand our minds a little bit more
00:13:10.720 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
00:13:16.420 this that you are blind literally blind for 14 minutes every single day every
00:13:21.430 person in this room and the reason that you're blowing is because of something called a cicada so the fastest motion in
00:13:27.550 your body the fastest thing that you can do is call the cicada it's the motion that your eye makes see we don't actually see a full scene as I look out
00:13:34.510 on this audience I'm not actually seeing all of you in perfect clarity I'm seeing a little spot here in a little spot here
00:13:39.970 in a little spot here as I look around the room and my brain is stitching that together into a whole image to test yes
00:13:46.300 there is a room that is about 40% for people now the thing about the thing
00:13:52.900 about saccades is that there's a limited amount of motion that they have so if you were if you take if you if you take your hand out and you hold your palm out
00:13:58.870 the middle of your palm is about the your focal area so that's what you can see and everything else your eye is going to have to move and if you're
00:14:05.050 holding your arm out straight and you move it to shoulder width that's about as far as your seek aid will go so that means that if you hold your arm out like
00:14:10.990 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
00:14:16.570 follow it so if you have something that takes - why - the field of vision in front of you it's going to require a lot
00:14:21.940 of neck motion which is smaller and more tiring so there's something that this
00:14:27.640 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
00:14:33.880 and that that long lines we have a line that goes really over about 80 characters it starts going outside of
00:14:40.089 your secada batteries and so if you have really long lines on a really big screen you start scanning back and forth with
00:14:45.459 your neck and it makes you more tired this is actually a principle discovered by agent typographers if you look at
00:14:50.830 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
00:14:57.490 head it's another fun limitation you've probably heard of and that's that your working memory is limited to about seven
00:15:04.040 plus or minus two items and the interesting thing about the way that your memory works is that it degrades
00:15:09.560 you get lossy compression so for example if you try and remember a long string of
00:15:14.600 digits like you know just you know a series of sixteen digits what your brain will do is it will chunk it down a
00:15:21.110 little bit until you remember maybe like the first three and the last four or
00:15:26.360 something along those lines and you will think that you have remembered all of it but you really haven't and that's really
00:15:31.910 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
00:15:38.360 stuff and you don't even know this is one of the reasons why we talk about keeping function small right in that if
00:15:47.030 you have a function that goes outside of that working memory size because outside of that seven plus or minus two items you will drop things and you will make
00:15:53.720 mistakes and that's one of the reasons probably the biggest reason I think that we want small functions it's why they
00:15:58.850 are comprehendible and so these rules that you've definitely heard before are driven by our limitations as human
00:16:06.110 beings the limitations of our bodies and our minds and a lot of people I've heard
00:16:12.710 that I've worked with especially as a manager have complained that these rules feel very arbitrary it's like a straitjacket but they really are rooted
00:16:20.000 in our limits as human beings and this why really matters the why is very
00:16:25.460 important because you can follow all the rules but if you don't understand why you can still do stuff like this this
00:16:32.660 follows the rules this this fun this is it's a short function it's got one line
00:16:38.200 that means it's the best function C we got the best functions here and the
00:16:45.560 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
00:16:52.490 I didn't actually realize that until I did something else and we'll talk about
00:16:58.490 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
00:17:04.040 go you don't need to ring now so this ties
00:17:09.380 into something else in that this code is really hard to read yes we can make sense of what it does but it's not really readable code and
00:17:14.929 that's really important because of another aspect of how our minds work and that is that we are built to remember
00:17:20.809 stories we remember we remember tales we remember epics and this is because of
00:17:27.470 how we've evolved so writing the you know human writing has only existed for about 10,000 years the modern humans
00:17:34.700 have been around for millions of years and that means that for all of that time outside you know ten thousand years ago
00:17:40.130 all that time before all those millions of years we were conveying information to each other and we were doing it by
00:17:45.200 telling each other stories you know the epic of gilgamesh all of these things were passed through oral tradition
00:17:50.559 throughout history and this is really important because some of you might
00:17:55.970 actually remember since I told the story about a bug that I made and relating to cash checks where you probably remember
00:18:00.980 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
00:18:06.980 wasn't respecting ante work this is actually there's actually even a thing
00:18:12.020 coined about this called the method of loci where it was how I believe it was Aristotle once remembered all of the
00:18:19.400 people around a dinner table because he had told the story and a joke involving all of the different guests now we're
00:18:25.190 going to get to why stories are important in just a second and when we when we go into the latter but the I've
00:18:33.140 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
00:18:39.559 should tell the story and if your code reads like well-written prose you know
00:18:44.900 you get this cognitive fast-track into your long-term memory because of that method of low-side so if your code tells
00:18:50.360 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
00:18:56.059 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
00:19:01.370 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
00:19:07.789 computer we remember sort of intersections of things so for example when you think about a dog you're not
00:19:13.460 thinking of a data point of like you know this is a dog it's a Labrador you have the sort of intersecting memory of everything that is dogness and that is
00:19:20.690 what you are recalling in your brain so if we go back to that snippet and we accurate understanding the why buying
00:19:26.960 this we get something that is I think a lot more readable and simply by refactoring this we now understand a lot
00:19:33.110 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
00:19:39.340 but we also solely by refactoring solely by refactoring this and by breaking it apart uncovered several bugs one of them
00:19:46.040 was and of course I've broken the rule of refactoring and then fixing some bugs but I'm not doing those on two slides
00:19:52.010 and we found things that for example like the hex digits were improperly specified there were places where punctuation was missing and there was a
00:19:58.310 place where we were actually missing a method call so that code would fail to even run now another really interesting
00:20:03.740 aspect of your psychology that you can leverage during the day is that you only get a finite number of decisions that
00:20:10.130 you can make decisions making a decision uses energy remember energy and energy being kind of important well it uses it
00:20:16.130 every time you make that decision so if you go to one of those sort of coffee places that has a million different
00:20:21.830 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
00:20:28.580 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
00:20:35.180 that's pretty much it easy choice you know you don't have to figure out like
00:20:40.310 oh god do I want an extra shot in that latte mocha frappuccino double-double americorps god I don't know you know and
00:20:46.700 so use those decisions really really wisely there's that there's a there's a really good decision a really good story about this that I like which is also
00:20:53.390 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
00:21:02.180 option to do something called going up for parole which means that if you have been a good prisoner or a model prisoner then you can get released a little early
00:21:08.470 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
00:21:14.090 people that will determine whether or not you can be prison early so this is a big important thing for you and if you
00:21:19.790 are a prisoner and you are up for a parole hearing you want to go as early in the day as possible really really
00:21:25.340 topical advice for this audience I know right and the reason for this is because early
00:21:30.940 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
00:21:36.429 been really good you know except for that one instance where they they you know they fix the bug and refactored at
00:21:41.770 the same time I don't know if we can let them out whereas if you go later in the
00:21:47.200 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
00:21:53.559 their default behavior for you is probably just going to be to say deny decision fatigue is a very powerful
00:22:00.610 thing and you will fall back on your path of least resistance which is also one of the reasons why discipline is
00:22:05.890 something you need to be very very careful I don't like discipline I really don't I think that discipline is overrated and
00:22:11.080 that you need to build good habits so habits are decisions you've already made and there are things that you've encoded
00:22:16.929 in your behavior that you've encoded it in the deep structures of your brain so that you automatically do the right
00:22:21.970 thing because you can't rely on discipline discipline is you making a choice you make a decision to do the
00:22:27.070 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
00:22:33.370 hear about that we really want to be doing as programmers are nothing but good habits that leverage the way that
00:22:38.770 our brain works one of my favorite examples is the reward cycle so you have
00:22:43.900 a cycle that operates inside of your brain it's called the dopaminergic cycle hopefully I'm pronouncing that correctly my pronunciation of where I've read
00:22:50.409 these things and unfortunately English is part so the way that this works is
00:22:55.870 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
00:23:01.390 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
00:23:08.559 little bit of I want to say dopamine and rememberings correctly a little bit of dopamine did you just say hey you
00:23:14.080 totally brush those teeth those teeth really need to be pressed and as you move towards that goal as you work through the brushing as he do the
00:23:20.080 thing you know your brain is pumping a little bit more reward chemical a little bit more motivation chemical into itself
00:23:25.539 and then once you've finally completed the task boom you get this nut this nice Rush okay because you've actually
00:23:31.539 completed that you don't feel it okay I mean I don't think most of us finish brushing our teeth and think like yeah yeah okay I do they
00:23:40.059 okay and this is how people by the way get addicted to things because that that
00:23:45.140 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
00:23:51.220 this is how addiction works and the thing that's really that really is interesting about it is that you get to strong reward and then it fades away
00:23:57.260 really quickly you know you you accomplish the thing you're really really happy and then you just kind of go back to baseline you buy that new car
00:24:03.920 that really awesome new car you finally got the Mercedes or in my case the Kia
00:24:09.070 and you it's a really really really great car for like the first couple
00:24:14.419 weeks and then after that it's just sorta like well it's just my car now because the reward fades and this is how
00:24:20.090 motivation works this is literally why you do everything that you do including writing software and that's why sighs
00:24:26.780 Raven development is so important because remember the prize goes at the end you know you get the rush after you
00:24:32.150 brush your teeth not before and so if you put that if you do test later development which usually turns into
00:24:38.540 test never development what you're doing your goal is not to write the test you are not there to write to all these most of us are not there to write the test
00:24:44.600 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 it gives somebody some new
00:24:50.030 capability that makes people happy and by putting the test first we put the tests in the way to that goal it becomes
00:24:55.790 something that we need to get over to accomplish what we're trying to do that's what we're really doing with test-driven development is we're
00:25:01.730 leveraging that motivation cycle by putting the busy work first and so you do that and you work through the test
00:25:07.910 you get the thing and finally when all those tests are green you're done yeah you get them you get the green test
00:25:12.919 that's awesome and the feature is done and you can use a little bit of that tail rush you know from from actually
00:25:18.290 accomplishing things maybe to do some refactoring and this is why red green refactor works because it actually
00:25:23.900 leverages the way that your brain works it doesn't rely on discipline whereas have later development when you write
00:25:29.690 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 you have to be
00:25:35.990 disciplined while you work to remember all the things that you need to test and then afterwards you have to then go and
00:25:41.450 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
00:25:47.390 brain cycle another interesting little aspect of your brain so speech is really distracting
00:25:52.580 this is something that's very deep within our brains if you it's it you find this all throughout nature birds
00:25:57.919 chirping so when a sparrow chirps or it makes an alarm sound it registers in all other sparrows in the area no other
00:26:04.159 words just sparrows because we've evolved to have these deep structures in our brains in humans it's called
00:26:09.320 Danica's area it's literally located right behind your ear and that registers things like alarm danger things that you
00:26:16.519 need to be worried about in humans it's hide your names so if somebody is asleep
00:26:21.529 you can be talking to them and will happen if you call their name they'll wake up and that's because we have this
00:26:27.049 deep structure in our brain now it's always listening like the NSA sorry I
00:26:35.779 didn't mean it and the problem with this
00:26:41.510 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 that's why
00:26:47.870 everybody uses them then you're getting this constants traction of people talking and it doesn't matter if you put
00:26:53.720 headphones on they don't block out everything and so you're always getting this continuous feed that is keeping veronyka's area engaged this is a bit of
00:27:01.130 a problem because this is quite annoying we've all experienced this kind of distraction when you're working in the office but there is a solution and it's
00:27:08.029 a pair programming pair programming actually solves a lot of things I'm a huge huge fan of pair programming I
00:27:13.070 literally I will I will talk until Vanek Azaria has shut down about pair programming now but what it does when
00:27:20.090 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 a ping pong going on and it's
00:27:25.909 keeping the speech area at keeping veronyka's area engaged which means that that's not processing all the stuff
00:27:31.490 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
00:27:37.700 with your pair so this removes a huge chunk of distraction and it makes you happier during the course of the day and
00:27:43.880 pair programming have tons of tons of benefits I mean you've got the real-time code review remember that reward cycle who loves do you know you get done
00:27:50.750 writing 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
00:27:57.169 you know it is very very hard to be a good code reviewer it's actually one of reasons I'm looking forward to a talk
00:28:02.330 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
00:28:08.270 time because you have a pair there you have a person there who is saying what whoa whoa whoa whoa what is I
00:28:13.640 what is that variable mean why is there variable called foo actually why is there variable called data there should never be a variable called data it's all
00:28:19.670 data the worst variable name ever and so
00:28:25.310 pair program gives you a lot of excellent eggs there's tons of other stuff away I'm not going to go into too much detail on it now so we're almost at
00:28:32.660 the end of our time here and I think that really you know if you can take one thing away from this entire talk it
00:28:39.110 would be do not fly China Eastern Airlines you're all far too young and
00:28:46.850 you have far too much to live for and to give to the world okay and if you could
00:28:52.880 take two things away from this talk the second is don't fly China Eastern I mean
00:29:00.350 it if you take three things away the third would be that you need to invest in yourself which is why you don't fly
00:29:06.500 trying to Eastern okay and invest in your health and happiness and you leverage those cognitive limits you
00:29:12.140 leverage your your psychological courts and the quirks of your body and you learn to work with it because that is
00:29:17.660 what will help you drive excellence in your craft as a software engineer and this really isn't just about excellence
00:29:23.720 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
00:29:30.350 a good life so I would forget to do this part I always forget to talk about like I have like a website where I write
00:29:35.990 articles and stuff and I do actually use Twitter now finally so if you would like
00:29:41.390 to see articles on how to CTO and how to developer and I guess how to Twitter then you know that's that's all here and
00:29:48.110 I believe we have hopefully time for a little bit in the way of questions cool
00:29:59.540 each do we have anyone with questions okay so yay hi
00:30:12.380 so yeah thanks for assault I actually have a couple of a point so I'll just
00:30:17.490 bring them up sure this one's okay and possum eyes no pressure here chill out
00:30:23.130 guys so first of all regarding the the sleep cycles that you mentioned I read
00:30:30.420 quite a bit about the different sleep patterns yes who potentiate your your
00:30:36.770 productive time by sleeping less without filling yet diet without over exhausting
00:30:42.300 yourself so I would like to hear if any their opinion on that so quest so let
00:30:47.960 you have many points this is the first one let's do this if you don't mind I just like to tackle that because it's a
00:30:53.040 big one okay so you raise something an interesting point which is that there are multiple different sleep patterns
00:30:58.350 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
00:31:04.770 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
00:31:11.490 would go to bed when the Sun went down and they would wake up again sometime maybe around 1:00 a.m. and have about 2 or 3 hours of productivity and then they
00:31:17.550 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
00:31:24.870 now not because of choice but because my brain is decided that's what it needs to do the thing about sleep is that you
00:31:30.240 really do need to listen to your body it isn't that you need to set 8 hours and you must get exactly eight hours it's
00:31:36.030 that by having a regular schedule for your sleep and by making sure that you get enough eg not forcing yourself to
00:31:41.220 stay up when you're tired saying like oh I need to get this code done you know by having that regular schedule not it's
00:31:46.440 not about the number of hours to put the quality that's what will give you your good sleep and your constant energy so
00:31:51.780 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
00:31:57.660 from a a normally cycle or a sorry a constant sleep cycle to a fully constants out the right word a there's
00:32:04.830 words that a cellblock continuous there we go yeah you can tell I have a math degree so I continue
00:32:10.230 sleep cycle in the one that is broken up into two different chunks then you
00:32:15.510 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
00:32:24.330 that because I end up having to take like 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
00:32:29.429 you know I'm obviously quite advanced in years as you get older you do need to sleep lesson so I don't think you're
00:32:35.460 really saving that many hours have I answered that question yet much more okay sweet sweet cool and yeah just a
00:32:42.720 note on the the thing of the incentive award make your bed in the morning it's another make your bed in the morning
00:32:48.390 it's again another instant reward actually yes and regarding the pair
00:32:54.480 programming a bit more serious talk now as my we do pair programming in our
00:33:00.570 company as well but what I feel is that if the pair is an even which is I think
00:33:06.870 the more common to find and even bears it's very easy for the strongest pair to
00:33:14.059 persuade that key solution is better and in the weaker bet
00:33:21.559 pair just accept it and doesn't refute I would always talk about this but this is
00:33:29.220 totally outside the scope of this talk I'm actually going so I give a small talk at a at a media called pairing for
00:33:35.250 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
00:33:40.440 to it so if you if you follow me on if you follow me on Twitter this is how I get Twitter followers by the way yeah so
00:33:45.929 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
00:33:53.940 think did you oh yeah hello sorry I hope I found a question a
00:34:01.940 few attendants for the things that you have said this first one is from somewhere in the Y Combinator started
00:34:07.790 school lectures that I heard that it was about doing one thing at one time it
00:34:13.280 follow from the fact that when if the person has more than one thing to do they're likely to pick up b1 problems
00:34:18.770 rather than the a problems just need to be done anyway and it applies to the personal life as well in a sense that
00:34:26.740 you can't be a superhuman if you try to set your targets too high that I'm going
00:34:31.820 to improve myself technically improve myself personally health night nutrition you would end up failing in all of them
00:34:38.119 pick one of them do it make it a habit and routine then move to the next one
00:34:44.139 other is the other again something everybody knows but fails to follow and
00:34:49.520 follow us on the first one perfect is the enemy of good so you don't try to be
00:34:54.590 the perfect person or the perfect programmer or the perfect look for the perfect diet or the perfect exercise if
00:35:01.100 you don't start you never even reach the good stage perfect is the something which is very much later in your life or
00:35:06.740 stage very much so the surrogate oh please yeah another point it is easier
00:35:13.640 to understand it I'm sure a lot of people follow sports and you will hear a lot of prodigies and stuff and then you
00:35:18.920 figure out only some of them made through and there may be a lot of people
00:35:24.109 that you find in sports you will feel that they are not so talented but the discipline which brought them forward
00:35:29.300 and and the person stayed in gate and disciplined which always do better but
00:35:35.810 only the discipline one will do but better than that they rented one if the same level of effort that goes into that
00:35:42.530 so you actually raise a really important point and that this is I think part of also being a programmer right like one of the things that we do is problem
00:35:48.680 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
00:35:55.190 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
00:36:02.000 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
00:36:08.119 talk on habit formation and building in your life I only have so much time okay
00:36:13.680 actually I think you have a microphone in your question yes so I wanted to ask you how do you keep your habits when
00:36:19.680 you're traveling I always find it very very difficult like you know I do 50 pushups a day and then travel for a few
00:36:25.200 days and when I travel I get very different rewards and when I come back home I'm like I already stopped doing
00:36:30.600 'through jobs for a few days and so the habit is gone and how do you so I would
00:36:36.150 like a round of applause for this man because he has asked a great question so
00:36:41.420 it's difficult because travel exactly as you mentioned when you get on a plane because nobody here has ever done that
00:36:47.120 when you get on a plane you go someplace it breaks those habits because you had this reset to your cycle number one is
00:36:53.340 that when I land I immediately get back on the food cycle of whatever my location is so I I have I
00:36:59.220 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
00:37:04.500 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
00:37:09.830 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
00:37:16.950 have your meal at the right time even if you're not feeling hungry like you may land you think well I'm not really feeling like eating right now and but
00:37:23.550 it's dinner time have a little dinner have something and force yourself back into that routine number one number two
00:37:29.390 especially if you're somebody who if you exercise in the morning or the evening once you get there set that calendar
00:37:35.190 reminder and follow that rule if you just have to start like push-ups push-ups are a great example I the
00:37:41.100 talked about was that we at wheelchair hacking your wheelchair really resonated with me because I actually spent some
00:37:46.380 time in one as well and and so I'm I'm finally recovered I'm doing fine but I'm
00:37:53.010 building back up to doing weight training again and as part of that I've been doing a lot of push-ups and I don't like doing a lot of push-ups really if
00:37:59.460 I'm completely honest I did enough NROTC and I'm kind of over them now but in
00:38:05.880 order to get them in order to get my push-ups in I have to do one so I have my exercise time and it's like okay I
00:38:11.490 have to sit down and do my one pushup and if I am do my one pushup and I don't want to do any more push-ups
00:38:16.620 that is my push-up for the day I owned that pushup yeah that one was mine and so by doing that by leveraging that
00:38:22.800 mental moment 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
00:38:28.079 their momentum that helps you get back into that routine back into that cycle yeah have I answered your question probably an ankle so the and second question
00:38:34.950 which airlines do we go back to ticular
00:38:41.030 yeah well I had options there was there was there was some like Conair there's
00:38:46.530 an airline that I was going to they had a pretty compelling offering swimming
00:38:52.020 looked good I was thinking about just going to the airport it's kind of like doing this as the flights went by and
00:38:59.579 hope that me hope one would stop or just moving to Singapore was an option as well I could just stay but no I actually
00:39:07.559 I'm not kidding I literally booked a one-way ticket back on it on a na yeah so yes yes I'm glad that somebody got
00:39:16.829 the point in my talk all right we have a question up here sorry so I'm gonna hi
00:39:23.849 so a few friends who always tell me like oh I have no time to even start all this
00:39:31.170 salty habits what would you tell them mmm another great question so the first
00:39:37.920 one is you um 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
00:39:44.309 not only somewhere around 16 you need to prioritize religiously so people who say that they don't have time there's
00:39:49.740 probably a lot of stuff that they're doing the description in their lives so there here's a great example I have
00:39:56.780 absolutely adore my brother-in-law but he's he's very uh he's the kind of person that has this sort of thing of
00:40:03.299 like you won't take one over on me and he he once had a case where I think his phone company billed him an extra $40 on
00:40:10.859 his phone the 40 bucks on his phone bill $40 you make good enough money it's $40
00:40:17.640 and he went to war over that you know I can't I probably spent the better part of a week of concentrated effort to get
00:40:24.030 that $40 back that's friction and so letting the little things go is a very
00:40:30.329 important part of that like learning learning to let those things go and not focus them one of the other things is that too
00:40:36.530 and create 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 red goo
00:40:43.340 pasta I make a gigantic batch of it might freeze the rest so that later on during the week if I'm tired I don't
00:40:49.250 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
00:40:54.920 meal I'm actually going to be investigating I think joylent as well so that I have something at home that I
00:41:01.100 don't need to worry about getting a meal I do a lot of other things where for example my work hours are incredibly
00:41:06.830 regular life I follow the same schedule every single day part of having that regular schedule and that means that
00:41:12.590 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 you know I I keep the thing in that
00:41:19.010 matter like I really care about making sure I get exercise so I don't watch a lot of TV I I care about things like
00:41:26.650 making sure that I actually go out and I spend time with people and so I I kick
00:41:32.630 out but I don't want to be drinking too much right now so I focused out I'm like okay I'm gonna combine exercise and I'm going to go out with friends so we're
00:41:38.390 gonna go climbing together and so leveraging things like that where you focus you focus you prioritize and you also combine like those those things
00:41:44.720 together really help you get a lot of quality time back in your debt have I have said your question yes I think it's
00:41:51.080 like what four four four yeah sorry I have to cut it short yeah so if anyone
00:41:56.870 knows any more questions you loop up them after during the break or an lunch yeah I'm sorry girl all right so let's
Explore all talks recorded at Red Dot Ruby Conference 2017
+12