Dylan Beattie — The cost of code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
my name's Dylan BT and I want to close the conference today by talking to you about the cost of code very simple question what does code cost a little bit about me this is me Dylan bTW I'm CTO at skills matter in London I'm a Microsoft MVP I run the London dotnet user group I am the inventor of the Rockstar programming language so that everybody can be rockstar developers and get all those awesome jobs on LinkedIn yup Akiyama apparel ski I have been sticking with my lessons on duolingo to try and you know improve my Russian language I'd like to share with you some of the things that I have learned to say thanks to do olingos language teaching it on their coffee it's abortion question and you know it's a national musical actors idea but so mr. architect of Zappos power and it's oh goodness to'kustar ugh help it vodka so I understand English for the rest of the talk if that's all right with you and yes it's a sounds like a simple question what does code cost we write code we get paid code goes at it runs all over the world it makes money it causes problems it does things and while I was putting this talk together I was thinking about how much software just basically runs the whole world now you know when I'm I don't do anything in my life now I think that does not involve some kind of software all my music is on Spotify I don't listen to CDs anymore i watch netflix instead of TV I use Facebook to talk to friends and you know even when like I'm cooking in my kitchen I have the recipe on an iPad and I've got Google home playing music in the corner and you know software is absolutely everywhere it's on our phones it's in the hotels and houses and cars all over the place and this is not a talk about oh my god software is eating the world it's terrible I actually think this is pretty awesome like do you remember I had a teacher when I was in school who was like you have to learn your multiplication tables but when you grow up you won't have a calculator in your pocket it's like yeah I have a calculator in my pocket and the encyclopedia and a video store and a piano teacher and a Russian Russian language teacher and all of these amazing things you know technology is fantastic and the things that it's done for the world are astonishing but there are some questions that I think we need to start asking each other asking ourselves about all of this code that we write and what it means what it costs what actually happens to it and I start off by going back to the best decade in history the 1980s the age of Super Mario Brothers now the reason why I want to start with Super Mario Super Mario was designed by one person a programmer worked at Nintendo a dicot Shigeru Miyamoto is built by a team of eight it took about a year and then it was finished that was it it was done 256 kilobytes of code on a cartridge they released it in 1985 in the United States it sold 40 million copies for $25 each now that code never changed the cost of maintenance was zero there was never Super Mario Brothers version 1.1 Windows Update for fix there was no vulnerabilities there were no security flaws there were no bug fixes literally once the code was done Nintendo owned it and they sold it and every time they sold a copy they made $25 it targeted fixed hardware this the nintendo entertainment systems the Famicom in Japan it was fixed Hardware there was no operating system the code literally ran directly on that no vulnerabilities no bug fixes no modules nothing to worry about it is a very rare example of code that was an asset the people who owned the code sold it and made money and every time they ship the code they make more money Super Mario took about a billion u.s. dollars in revenue 256 kilobytes of code that is about the same as the CSS on Facebook's homepage if Facebook could charge the same amount of money for code CSS that super mario was able to charge they would make 36 billion dollars every day just for shipping CSS now that's not how it works of course it isn't you know and even that Super Mario that incredibly profitable codebase was still not the most profitable codebase because they still had to pay somebody to create it they had eight people working on a team they had a salary what if the code itself was free you know what if software I was completely free and actually free software is older than paid software because when computers were first created invented in the 1960s and 1970s why would you pay for code the only people who could get to the computers were the engineers and the scientists who in most cases invented them the code was just the kind of stuff you put in the machine to make it go even if you could sell it no one's gonna buy it because your computer was the only one in the world your code wouldn't run anywhere else and so people shared source code they shared ideas they swapped tapes and you know bulletin board systems all this kind of stuff it wasn't until the late 1970s when we started getting you know computers in offices and homes that people came up with the idea of selling software and controlling it and charging money for it and there was pretty immediately there's backlash led by a guy called Richard Stallman and the story goes he had a printer in his laboratory at the University in America where he's working and he wanted to fix a bug in the printer he couldn't because he couldn't get the source code for the printer driver because they said this is proprietary you can't have it and he thought this is bad I'm not gonna stand for this I'm gonna start the free software foundation and this word free is interesting because when Stallman talks about software he has this very famous quote think free speech not free beer now have you ever gone to your boss at work and said hey there's this amazing tool that I want to use on our new project and the boss says how much does it cost and you say that's it's free speech and he's like I don't care how much does it cost when you want to use things in you know business in in commerce the thing that most people ask what does it cost in money in rubles or euros or dollars and cents you know what is the actual cost of the thing and when you say do boss oh it's free it doesn't cost anything they tend to go brilliant go ahead use it this is fine use the free software we call this free as in beer now have you ever been to a wedding that turned into a fight because people had been enjoying free beer free beer sounds like a great idea right it's free and then you think what if we had free beer for everybody all the time alcoholism underage drinking violence liver disease that wouldn't actually be a terribly good idea I mean it would be a bit of fun to start with so maybe we're asking the wrong question now let's think about free software so I'm gonna use WordPress here in this example WordPress is free software it is free as in beer doesn't cost any money it is free as in speech the source code is available you can download this you can modify it you can even sell it so you can get free software that cost no money and you can charge people money for installing it and supplying them with copies of it and quite a lot of developers get their first start in web development by customizing WordPress or systems like it you get open-source you can figure it and you tweak it you set it up for a client and you send them the invoice and you're like look at this installing free software two and a half thousand pounds configuring free software I just got paid for free software seems like a pretty good model right and then you get the message from the client hey it's Bob there's urgent problem with the website call me I said urgent call me ASAP and you think oh come on it's the weekend I'm not working this weekend and you go and you look and you're like oh crap what's happened here and you say to Bob did you install any plugins he's like all the plugins you know it's like right okay someone's taken over your site now you say to Bob well it doesn't matter you know WordPress is free software and Bob says I paid you five thousand pounds for it it's not free to me I paid money and you say no but it's also free you can modify it look here's the source code you can go in and you can you can fix it yourself and bob says what the hell is source code I paid you for this website you gave me a website it's broken you fix it for free we need another kind of free because the best code is free it is free as in speech it is free as in beer it is also free as in hey I have a free weekend I'm not working I'm not uncool I can relax I am not gonna worry about what I am doing and that kind of freedom you know freedom from anxiety comes from trust we need to be able to trust the software that we are using the software that we are running the systems that we are running it on if we are gonna be able to leave the office on a Friday and go out and enjoy all of our weekends now I want to talk about this idea a little bit because we've always kind of had this idea that open-source code is good because you can look at it and you can read it and you can work out what it does and then you understand it and once you understand it you trust it to do the right thing there is a library called react I have inherited a project on my current job which is a react project written by some people who aren't there anymore I've never really done very much with react and I thought maybe I need to check it out maybe I need to like take a couple of hours and just do like up and running with react first so I did some poking around I found this thing the react team primarily recommends if you're learning react or creating a new app use create reactor I thought okay this looks cool now I have a thing I often do when I'm trying to understand new projects so what I did I downloaded create react up and I ran it and it misses away for a couple of seconds and it makes some very exciting little colored console output and it downloads things and install things and warning warning warning I'm like okay I'm sure it's fine and you know bang happy hacking and then I ran this code this tool called clock c-loc count lines of code what have I just got on my machine and this thing I'm thinking that is 21,000 files from create react app and I let this thing run and I let this thing run 1.5 million 1 million five hundred and sixty eight thousand lines of code that weren't there 30 seconds ago that are now my code because it's on my system it's my project this is my responsibility and I thought this could be fun so I went and I put it on Twitter and I said before you even open a text editor your project contains one and a half million lines of code most of it contributed by volunteers or enthusiasts no formal review or release process this is normal in modern web development and it got quite a lot of responses and likes and things and what was really interesting is half the people who replied to me said yes I know isn't it wonderful I completely agree and the other half said yes I know isn't it terrible I completely agree and I was like I kind of didn't really pick a side that I think it is amazing that we can do this I think it's amazing that we've developed packaged libraries and package managers and tooling to the point where you can just run one line of code and you get 1.5 million lines of stuff you didn't have to write yourself and there's a Dan Abramov who's actually one of the react core maintainer zhh he's like to be clear that's actually development test dependencies so when you do create reactor you're not actually just installing the code you're installing a whole build and development tool chain for working with react applications now you don't need to do all that you can just open notepad and do a you know script reference to react and that'll bring down about 23 thousand lines of react code and then you write the rest yourself but you know this is just how software development works the first thing we do is we go and install a bunch of packages from somewhere else and then we build on top of those and this Trust is essential your code is talking to entity framework and entity framework trusts that link is gonna work and link trusts that Don that core is gonna work properly and this guy over here is webforms who has no help to anybody at all now you could say we're not gonna do that we're gonna be different we are gonna do everything ourselves and there are some applications where maybe that makes sense if you're working in defense you're working in aerospace you're working in healthcare or you know the intelligence services there may actually be places that are like we need to draw a JPEG and we can't use any open source software please build your own implementation you got six months put a team together and do it and you know the stuff does exist but for most of us most professional developers you say we're not gonna use any libraries or frameworks we're gonna build our own system from scratch you're gonna learn three things one it is really good fun building frameworks it is great because you don't have to solve real problems you just solve hypothetical problems you think you might have later do it is really really hard Facebook the react team there are way better at doing this stuff than me and my team or any I suspect any of you and your teams because they are experts they've hired really really bright people who just think about this all day and three your customers have all gone they're all across the street with the people are like oh we're not using react we're using angular you're like I don't care I just need a website you know we have to accept it if you want to build and ship the kind of software that people expect you've got to use packages you've got to use open source you've got to use libraries frameworks once you have accepted that that's a part of the process then you can start making some informed decisions about it it is your code you've taken responsibility for it what can go wrong now there are bugs in open-source software there is a thing called lenez's laws coined by Eric Raymond given enough eyeballs all bugs are shallow if you have enough people looking at the code sooner or later all bugs will kind of come to the surface and somebody will notice them I have my own lore about this given enough shiny things all eyeballs are distracted there is so much going on in the world all the time that all of us are going oh I could learn that I can do that I can write that I want to get one of those sometimes really significant bugs just don't get noticed at all 2014 2014 news broke about a vulnerability called heartbleed now there's a couple of things about hardly that were really interesting heartbleed was a vulnerability in open SSL the security library which just about every web site on the planet uses to protect your password to protect your credit card numbers to protect your name your address all of this confidential information we use secure socket layer to do it and open SSL was the library that and most operating systems used to do that and they found a bug now it was a really good example of responsible disclosure the day that it was announced one there was a fix already available for it when this went public so you could literally as soon as you knew about it you could download and install the latest version they gave it a name this thing you know before they called it heartbleed it was called something like CVE - 2014 - one two three four and they said let's give it a name if we give it a name it'll get in the newspapers and it'll get on TV and people will know about it and for developers it was the first time ever instead of you having to go to your boss and say I think we might have a security problem your boss would come to you and go hey I think we might have a security problem because they've seen it on television and you were like yes we know it's fine we've got the fix we're already installing it but open SSL is a huge library that is really important that is used by Amazon Google Facebook Microsoft Oracle there are people all over the world smart people who have the skills to fix these kinds of problems and have a reason to do so they have the motivation one of the biggest recurring headaches that we find in the world of open source is something called the open source entitlement complex there's if you've ever worked on or maintained any open source projects every single week somebody will come onto your forum and go hey I need to use your software to do this can you make it happen and you're like no that's not what my software is designed to do sometimes it's just someone's found a bug and you're like yes we get it that's a bug but there's only two people working on this project we're doing it in our spare time we don't care about your bug send us a patch and the person goes I'm not writing a patch I'm not doing your job for you you fix it it's your fault and you're like you can have your money back we don't care you know some people completely burn out and walk away from open-source because of the amount of aggravation and hostility from people who find free code on the Internet and then they start shouting because the free code doesn't do the thing that they wanted to do they don't know how to use it they don't know how to fix it and they decided that this is your fault because you created the solution in the first place so if you're relying on open source you gotta have a plan what are you gonna do if you need to modify it you need to fix it you find a vulnerability you can't just base your business on the goodwill of volunteers and expect that they're gonna care about your problem in exchange for no money project maintainer move on you know projects get abandoned projects get transferred ownership they get shut down maybe you can buy a support package instead of reaching out to the people and saying your software doesn't work you can reach out and go hey we'd be interested in paying you to add this feature or to fix this or just to help us you know get this thing set up get it working properly maybe you can hire somebody and say we need you to come in and make some extensions to react or OpenSSL whatever the library is we needed a brighter driver for Linux for our piece of hardware you know maybe you just put some money aside you're like if it goes wrong we got money in the bank when it happens we'll deal with it then but you know have a plan it's open source you can get the code but do you know what to do with it once you've got it now there are people who are like well we don't use open source we only use commercial software from companies who have warranties and you know maybe you hire somebody to build a system for you maybe you're buying commercial off-the-shelf software Oracle Microsoft Sun all these kinds of vendors and stuff and there is the solution that if you pay money for software it's gonna be supported forever and that's kind of not true you know stuff gets end-of-life there are people out there still running code on Windows Server 2003 we know Server 2003 has got problems that's why there was Server 2008 and 2011 and 2013 and 2018 but they're still running the old version and because they paid for it they're like we'll where are the security updates and you're like that's not really how this works some vendors just disappear there are software companies who have gone bankrupt the code is gone nobody knows where it is people are still using the binaries they're still running it but if they find a vulnerability there is literally nothing anybody can do and you can go in there with your receipt and you can say I paid for this I'm gonna do you any good you're talking to an empty desk in an empty office there is no-one can do that but whether you're using open-source whether you're using corporate software whether it's stuff you hired somebody to build for you it is your code that code makes money you keep the money if that code causes problems those are your problems and you have to be responsible for them and they can crop up in all kinds of unexpected and interesting ways last year a woman called Nicki who's a doctor who lives in the UK went online and tried to apply for a Barclaycard a credit card and she filled out this form and clicked submit and it came up with this error message your gender does not match the title you provided please check and try again Nikki went straight on Twitter and was like hey Barclaycard it's 2019 how come I can't be female and a doctor now this is not Barclaycard making some horribly misogynist statement this is just JavaScript that doesn't work properly but the JavaScript bug turned into this thing which got picked up and made newspapers and television and went viral all over the Internet all these people going Barclaycard says women can't be doctors now that's one line of JavaScript that was just pausing the inputs in the wrong order and I'm guessing nobody ever thought what do we do if we put the inputs in the wrong order it goes into the newspapers and you know there's a massive PR scandal about it it's your code you know pay attention to the things that are going into it you are responsible for when that JavaScript does something weird and this kind of thing happens but what if we have a perfect team what if we have the best hundred percent Rockstar developers never make any mistakes there are no bugs the code is perfect 100% test coverage everything is absolutely brilliant it's gonna be fine right we're never gonna have any problems there are dependencies in your systems and your software there are nothing to do with code in 2018 intel went public with news of two vulnerabilities they called meltdown and specter and meltdown an inspector was really significant because these were security vulnerabilities in just about every CPU every processor being used by any computer anywhere on the planet there's a high performance optimization in modern chips which basically allows them to calculate multiple code branches in advance so when the time comes to you know they've resolved the if statement or the branch statement they know which one they can run and they discovered that there is just a fundamental vulnerability in the way this algorithm was designed now this is not one module that you can just go in and upgrade every operating system needed patching separately to deal with this and the problem was the only way to patch it is to disable the performance feature that contains the vulnerability Intel went on the record with this Leslie Culbertson who's their head of security we've observed a performance impact of approximately two to eight percent based on overall scores for benchmarks so yesterday your computer was fast but it had a security vulnerability you fix it overnight today it is eight percent slower than it was yesterday now if you're paying for cloud hosting you're running stuff by the minute and you're maxing out your capacity all of those machines just got 8% slower you're now paying 8% more to do the same amount of processing than you were this time last week now you know patches are all well and good the real fix for meltdown inspector is just to get a new computer because the modern CPUs from Intel and AMD and arm they do not have this problem they found the problem they fix the problem and we just kind of accept that we get new computers and new hardware all the time most places if you buy computer equipment for business you kinda like you have this agreement with the tax people that today it costs two thousand euros in five years it will be worth nothing and you'll throw it away for scrap and so you depreciate the cost this is accepted you know a new computer is new and shiny and next year it's a bit clunky in the year after their kind of okay maybe you're after that you give it to your kids to play Minecraft on in the year after that it's junk and you have to go and get another one and with mobile phones it's even worse because most of the world now has somehow got it into their heads that you need to get a new phone every two years because the mobile phone companies are like hey can you upgrade time for an upgrade two-year contract then you get a free upgrade and I think this is crazy I have an iPad at home actually I have a lot of iPads at home but I have an iPad at home that is a iPad generation to six years old it cost six hundred pounds so about seven eight hundred euros and and it still works the battery's good the screens good it's not damaged but it's pretty much useless and the reason why it's useless is you can't get the latest operating system for it and lots of the applications that made it useful like in a Netflix and BBC TV and GarageBand they don't run old versions of those operating systems and so I have this amazing device that six years ago was completely revolutionary and it sat at home in a box next to the iPhone 3 the iPhone 4 the iPhone 5 the iPhone 6 you know and this is weird and it's not just that we are constantly having to get new devices a modern smartphone is an absolute masterpiece of engineering you know there are signal processing chips inside this thing that are so small you can barely see them with a microscope the memory in these things uses floating quantum gate semiconductors which are basically impossible but we worked out how to mass-produce them anyway the lens in an iPhone is a sapphire it's a jewel that is actually grown in a laboratory because it is the hardest toughest substance though they have all of these amazing innovations and things and to build a modern phone or tablet or any of these portable devices you need to use very very specialist materials periodic table of the elements if we take out the gas the liquids and the stuff that is radioactive there are 80 stable elements in the periodic table and to make an iPhone requires 60 of them various points in the process and I pick just one as an example inside your phone there is a speaker probably two speakers there's a microphone that there's the little motor that makes it vibrate all of those things use magnets tiny tiny really precise magnets magnets are made of neodymium I'll show you what neodymium magnets can do [Music] and now in slow motion [Music] now that's some special stuff you know neodymium is an amazing element so how do we get this stuff well almost all of the world's neodymium is mined in China to mine neodymium first you have to dig the stuff up now neodymium or it's called a rare earth metal and the stuff they dig out of the ground is about five percent useful five percent of it is neodymium the rest is mud rock uranium thorium really quite unpleasant things things you don't really want to have to deal with so you get a kilogram of this stuff out of the ground then you have to process it to get the magnets out to get the neodymium out to do that you use a huge amount of electricity you use a massive amount of water in the atom ium refineries use about two Olympic swimming pools worth of water per day you use sulfuric acid to split and cause various chemical reactions that allow you to extract the bits that you need and so at the end of the process you started with a kilo of ore you've got 50 grams of neodymium and you've got a couple of litres of radioactive toxic sludge and we don't know what to do with that so we put it in a tank and we bury it in the ground and we hope that somebody's going to come along later and come up with a really good use for it and that's just one element that's just the neodymium cerium is another rare earth metal similar process dig it up refine it electricity sulfuric acid water radioactive trace elements all this kind of stuff the circuit boards in your phone have capacitors made using an element called tantalum tantalum comes from a mineral called coltan most of the coltan in the world is mined in Central Africa most of the money that goes into coltan mining goes to corrupt governments who use it to buy weapons and do all sorts of horrible things terrible working conditions but we need it you know inside the battery on your phone there's probably about a gram of lithium now lithium is fantastically good at storing energy that's why we use it to make batteries sometimes lithium gets excited and all of the energy accidentally comes out at once we call this an explosion and it's why you're not allowed to take Alex c-note seven phone on airplanes anymore because they had this reputation for catching fire and blowing up now your phone contains tiny tiny amounts of this stuff and modern smart phones probably have got about 30 grams of aluminium probably got about one gram of lithium 20 milligrams of tantalum so any one phone any one tablet device that's not really a problem but we've sold a lot of these phones so this is some Gartner market research data on the number of smart phones that have been sold around the world the total number of phones sold is around about 8 billion now 75% of those are Android devices so let's say 6 billion Android devices have been sold shipped now according to Google 2 billion of them are still active because they release these statistics every year that means there are 4 billion Android phones out there that we don't know where they went if we took the lithium from the batteries of those phones and added it all together it would weigh as much as the Eiffel Tower and that's just sitting around in drawers next to old phones and stuff you know all this effort all this work to get these incredibly rare valuable minerals out of the ground we use it to watch cat videos for two years and then we stick it in a drawer and we go out and we get another one now what can we do about it well it's not actually bad news lots and lots of people countries governments are waking up to the fact that this is kind of not OK there are directives and legislation in place in the UK most of Europe lots of other places around the world now if you got to get rid of an old phone you don't just throw it in the trash you have to take it somewhere where it can be recycled Apple have factories that literally dismantle old iPhones and retrieve the materials so they can use them to make more iPhones or they can sell those parts on what are the really interesting things that people have started to work out is old electronics is literally a gold mine because if you have a kilogram of old phones and you have a kilogram of gold or that you dug out of a gold mine there is more gold in the phones than there is in the gold or so lots of people are starting to develop industrial techniques to recover all of these minerals so it's not you know there's progress here it's good but you know this is iPhone since 2007 new on every 18 months they just keep coming out and coming out and coming out what if they turned around and went in there you know what phones are good enough I mean we can get a phone now they cannot make the phone any bigger or it won't fit in your pocket the pixels are so small you literally can't see them it's effectively a perfect picture you know the cameras and phones are so good you can take a picture with your phone you can stick it up on a massive screen like this it looks great they're fast enough they have enough storage for all the photographs you've ever taken they plug into cloud systems what if the manufacturers Android hi Samsung turn around and went you know what yeah we good this is we're gonna bring out a phone now and we're gonna guarantee that this phone will last for five years ten years I don't know but imagine as developers if we actually got to target the same platform for not like three months and then learn another framework actually really really learn everything we could do with it like the team who built Mario for the Super Nintendo they're like this console is not going to change for ten years build the best game the best software the best apps that you possibly can and that's it you get one of these phones you keep it for ten years you don't worry about upgrading it just works replaceable parts now this is not gonna happen I know this is not gonna happen because smartphones are big business and the only way to keep making money is to sell more phones but you know imagine if every single person if the people in China digging them the ODA Miam out of the ground if we decided that they get paid the same as software developers do how much would the phone end up costing you know you'd be like well a new iPhone actually costs fifteen thousand euros now so maybe we should just see if we can get our algorithms to work properly on the old one that people have already got because they're not going to upgrade you know now we've talked a lot about problems and that flaws in software about sustainability about you know bugs and vulnerabilities and all these kinds of things but what about the code is good it's perfect code no bugs all been tested and reviewed and everything it's running on nice clean environmentally sourced sustainable hardware and yet it's still gonna do something bad last month five Volkswagen executives were charged in a criminal court in Germany with fraud this was the latest installment in a huge scandal going back years and it all centers on code Volkswagon between 2009 and 2015 they installed engine management software on 600,000 cars in the United States and millions more around the world I don't have the exact figure and this code had a feature in it feature that is designed to tell when the car is doing an emissions test so there are laws now in countries all over the world about how much pollution your car is allowed to make how much you know various gases it's allowed to emit into the environment and somebody at Volkswagen went well I don't like that I like pollution I think we should pump loads of it into the air what if we put a thing in the software so that when the car is in the garage and it's being tested it does one thing and then when you take it out onto the road it does something else and this is exactly what they did and the thing I think is remarkable about this is a team did an analysis they basically reverse engineered the firmware from the engine control systems on these Volkswagen cars they published this paper how they did it an analysis of emission to feed devices in modern automobiles there is a variable called this Sdn eschar core which is zero or one and zero means you're driving on a road and one means that the car is being tested and you know imagine you're working at Volkswagen and you're looking at this code and you turn to your colleague and you say hey Carl what's this variable for why is there a flag in the code that makes the car emit too much pollution you know it is almost that obvious and nobody knew about it nobody spoke up about it nobody went public with this for years and years and years when it was finally discovered there was a huge scandal you know it has cost Volkswagen over 20 billion euros in fines and penalties there's PR damage there's criminal charges outstanding against all kinds of people from the organization there was a study last year that estimated 59 people are gonna die because of the extra pollution from Volkswagen cars that have this line of code and their engine management software now they don't know which 59 people but they're just like well this many people are gonna die in a Volkswagen hadn't done it it'll be this many people but there are people who do this kind of research 59 deaths and illness and disability all kinds of costs for a line of code that probably anyone in this room would have looked at and gone this looks a bit funny I wonder what's going on here now I don't believe that the people who made the decision actually wrote the code themselves you know and I suspect that the engineers who did it were just told this is your job please satisfy the requirements and they did you know they wrote the code that they had been asked to write but looking at that code would have given you cause for concern you know it's not that complicated what do we do when the code itself even with rigorous inspection doesn't look bad at all what are we doing there's no concerns or vulnerabilities to worry about in October twenty nineteen lion Air flight 610 took off from Jakarta Indonesia twelve minutes later it crashed killing 189 people four months later Ethiopian Airlines flight 302 157 people on board crashed after takeoff no survivors the common factor in these two tragic accidents was the type of aircraft the boeing 737 max now I'm a software nerd I'm also an airplane nerd I have two uncles who are pilots I spend half my life on airplanes I've been following this story with a lot of interest because in the immediate aftermath of that first accident the media came out and said it's a software problem and I was like that maybe it's a software problem and then the second one happened and they're like it's the software problem that's what's causing the thing with the Boeing 737 max that's what caused these two crashes now there are investigations ongoing you know there are still rigorous processes and the aviation industry is really really good when something bad happens they want to learn everything they possibly can it is very very rare for the same thing to go wrong twice because normally the first one they shut everything down until they work out what caused it so this is kind of what we know so far about what caused these two crashes with the Boeing 737 max now first of all it's important to understand there is a thing in aviation called type ratings type rating says that this pilot is allowed to fly this kind of aeroplane if you buy a new urinate airline you buy a new kind of plane all your pilots need to go back to school and they need to qualify they need to learn to fly the new kind of aircraft before you're allowed to put passengers on it this takes time this costs money this is inconvenient so if you are trying to sell aeroplanes it's a really good idea if you can go to the airlines and you can say hey this is the new 737 it's technically the old 737 but just it's got some improvements but it's okay your pilot's are still qualified to fly it and this is basically what Boeing was trying to do with the 737 max they wanted to build a plane on the one hand don't change anything don't change very much at all because we want everyone out there all the pilots who can fly 737s we want them table to get in this plane and fly it also though we need to make it fly further we need longer range Airbus has got the a320 long range it's causing damage to our business we need to compete with that we need bigger engines and we need bigger fuel tanks we need more capacity now they had a slight problem with that because the engines on the 737 max 8 are so big they don't fit underneath the wings properly this is the old 737 and the new one side-by-side and if you look at the tops of those wings you'll see there's quite a substantial difference they couldn't fit it under the wing so what they did is they moved it forwards and they lifted it up so it kind of hangs off the front it's just a little bit higher but what that means is in one of these planes if you get in and you open throttle the plane is going to go up like this and that's not what any of the old 737s did this was a problem and so they thought I know we'll fix it with software now the 737 is like most modern planes it has a fly-by-wire aircraft the pilot pushes the control surfaces they tell the computer hey go up go down a pilot wants to do those pilot wants to do that the computer flies the plane based on those inputs but the computer can also override the inputs it can inject its own behavior and so they came up with this feature it's called M cast the maneuvering characteristics augmentation system and what they basically did was they wrote some code that is good code that works which says if you detect that the aircraft is rising like this raise the tail and bring the nose back down that's it and don't tell anyone this is happening because we just want to simulate the fact so that the pilots think it's behaving like all the 737s they've ever flown before the two aircraft that crashed the problem they had was something called an angle of attack sensor that one single sensor which is the thing that tells the computer is the plane doing this or not and it appears based on what we know so far that that angle of attack sensor malfunctioned there was only one there was no backup system and because the pilots had been told this is just the 737 like all the rest they didn't know that there was this additional em caste system it was in the manual but you know are you gonna read the manual your plane is doing weird things and you don't know what's going on you're trying to save the thing you're trying to you know look after the passengers who are on board it's not clear whether they knew about the procedures it's not clear whether they just didn't have time to implement them but you know to call this a software problem is disingenuous software is what made that aircraft possible in the first place the problem as I see it is it's systemic it's a failure right along the whole thing the design process the certification process sure the software worked but the people who built the software didn't necessarily understand that there was gonna be this one scenario where there's only one angle-of-attack sensor and that goes wrong and the pilots don't know what to do about it there are all these disconnected pieces and they all fail and when they fail planes crash people die now we owe it to the people in those accidents to learn everything we can about what caused them at that how to do it better about how to stop it happening again and it's just one of hundreds of ways that we need to start thinking differently about the way in which software is becoming a fundamental part of the world all around us in March 2018 a woman called Elaine Hertzberg was killed by a self-driving car it was an uber test program uber is trying to develop autonomous taxis because then they don't have to pay drivers they just put robotic cars out on the street the cars drive around picking up passengers uber get really really rich what happens to the drivers who but probably don't care and this was controversial you know there's a lot of stuff going on in the case of Alain Hertzberg it was actually settled out of court which means it never got before a judge in a jury which means they still haven't decided if you write a module that you put on github that somebody downloads and uses it in the control system for a self-driving car that kills somebody are you liable for that was the person who downloaded it liable was the person who manufactured the car liable was the algorithm liable you know we don't know and there isn't a right answer what we need is a framework a way of dealing with these kinds of decisions the aviation industry has these medicine has these malpractice insurance these things exist as software developers maybe we need to start thinking about it but it goes a lot bigger than you know these kinds of incidents you're not the most popular job in the United States's truck driver there are more truck drivers in the US than any other job three and a half million what is gonna happen to those people when they roll out uber trucks and suddenly you have trucks that can just drive all night they don't need to stop they just stop to refuel and they keep on going one suddenly there's more traffic on the roads 24/7 to three and a half million people suddenly out of work they don't need them anymore autonomous trucks have taken over they're doing all the delivery what impact is that gonna have on society you know the UK where I'm from is having a bit of a political crisis at the moment the biggest political crisis of a generation brexit and brexit was not caused by a natural disaster or a war brexit was caused by the government who were elected saying we're gonna do a referendum and then they did it and it's come to light since that you know that thing happened our government in the UK is in crisis they are completely deadlocked and information has come out about an organization called Cambridge analytic I who were working on various social media platforms to present really really tightly targeted advertising like literally they would identify one person and they would make adverts that were designed to get that person to vote a particular way and they would show them to that person once and then they would disappear now in the UK you are the the media is really really tightly regulated you cannot do this kind of thing in newspapers you can't do on radio you can't do it in television it is against the law and if you do there are records there will be printed newspapers you can take into court and go you printed this this broke the law when you show someone an advert on Facebook or Twitter for 15 seconds and then it's gone how do you know it even happened how do you enforce and regulate that kind of behavior you know Facebook had this motto move fast and break things you remember this a couple of years ago um I didn't realize that the British government was one of the things that they were gonna try and break in the process and if you go on facebook.com right now it has this massive thing on the front create an account it's free and always will be and of course what they mean is you don't have to pay money for this but I think there are all kinds of hidden costs and implications from this sort of software the way it's being used the way people are using it the things that it makes possible that bad actors can jump on and they can exploit straight away and governments and regulators are left playing catch-up and scratching their heads wondering what to do about it now we've all met this guy this is the senior executive you know millions of the dollars or rubles or euros in salary every year and they don't know how to use their own email and they joke about it and they're like stupid machine yeah I got another one of those emails and you know the kind of people I'm talking about and these people make decisions in massive corporations and companies that affect our lives the countries we live in the way our societies work it's not acceptable for somebody making those kinds of decisions to know understand how to use their own email it's 2019 every company is a software company every company is a technology company the companies that aren't are gonna get wiped out by the companies that are we need to start thinking of software as part of a whole connected holistic system we can't just go uh everything's fine but the software doesn't work no the software doesn't work nothing works the software is part of it this year it's 50 years since Apollo 11 50 years since Neil Armstrong and Buzz Aldrin became the first humans to walk on the moon and I think we should celebrate it I think it was an amazing audacious achievement let's not celebrate the 12 white guys who went up there and did it we've been celebrating them for years let's celebrate everybody else let's celebrate the engineers and the janitors and the project managers and the doctors the half-million people all over the world who made the Apollo missions and the moon landings possible and particularly this person Margaret Hamilton Margaret led the software team that built the guidance system that got Apollo to the moon Margaret Hamilton was the first person to use the term software engineering she's the first person who ever advocated what she called a systems view you know software is just one part you can't understand what the software does unless you understand all of the other components on Apollo this was the software system the electrical system the hydraulic system the propulsion system you needed to understand all of these if you were gonna make you know rational conscious decisions about how to build the software how to test it how to know that it's behaving and it's doing the right thing you know we call ourselves all kinds of things hackers coders developers front-end back-end some of us call ourselves engineers and you know maybe if we really want to be engineers that's what we need to do stop thinking of code as just unit tests and integration tests get out there remember that the code is part of a system it's a huge system with Airlines and pilots and lawyers and self-driving cars and lithium mines and all these kinds of things and we have to help people understand you know not just the other people at the conference our parents our friends our kids you know we got to be humble we must be responsible we must be kind our software is going to change the world we're gonna need the whole world to help us understand and manage the cost
Info
Channel: DotNext
Views: 16,578
Rating: 4.9380531 out of 5
Keywords: DotNext, .NET, code
Id: 001SxQCEuv8
Channel Id: undefined
Length: 50min 11sec (3011 seconds)
Published: Fri Aug 16 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.