Transcript
PosRteenGvQ • Bjarne Stroustrup: Simplification is the Key to Reliability and Efficiency in Code
/home/itcorpmy/itcorp.my.id/harry/yt_channel/out/lexfridman/.shards/text-0001.zst#text/0185_PosRteenGvQ.txt
Kind: captions Language: en what was the origin story of C++ you you basically gave a few perspectives of your inspiration of object-oriented programming that's you had a connection with C and performance efficiency was an important thing you were drawn to efficiency and reliability reliability you have to get both what what's reliability i I really want my telephone calls to get through and I want to quality if what I am talking coming out at the other end the other end might be in London or wherever so and you don't want the system to be crashing if you're doing a bank here is you must crash it might be your your bank account that is in trouble there's different constraints like in games it doesn't matter too much if there's a crash nobody dies and nobody gets ruined but I am interested in the combination of performance partly because of sort of speed of things being done part of being able to do things that is necessary to do to have reliable energy of larger systems if you spend all your time interpreting a simple function call you are not going to have enough time to do proper signal processing to get the telephone calls to sound right either that or you have to have 10 times as many computers and you can't afford your phone anymore it's a ridiculous idea in the modern world because we have solved all of those problems I mean they keep popping up in different ways as we tackle bigger and bigger problems so efficiency remains always an important aspect but you have to think about efficiency not just as speed but as an enabler two important things and one of the things it enables is this reliability is dependability you won when I press the pedal the brake pedal of a car it is not actually connect it directly to to anything but a computer that computer better work let's talk about reliability just a little bit so modern cars have ECU's millions of lines of code today so this is certainly especially true of autonomous vehicles where some of the aspects of the control or driver assistance systems that steer the car that keeping the lane and so on so how do you think you know I talked to regulators people in government who are very nervous about testing the safety of these systems of software ultimately software that makes decisions that could lead to fatalities so how do you how do we test off our systems like these first of all safety like performance and like security is a systems property people tend to look at one part of a system at a time and saying something like this is secure that's all right I don't need to do that yeah that piece of code is secure I'll buy your operator right if you want to have reliability if you want to have performance if you want to have security you have to look at the whole system I did not expect you to say that but that's very true yes I'm dealing with one part of the system and I want my part to be really good but I know it's not the whole system furthermore if making an individual part perfect may actually not be the best way of getting the highest degree of reliability and performance and such the steamer says see from France type say not type safe you can break it sure I can break anything that runs on a computer I may not go through your type system if I wanted to break into your computer I'll probably try ask you an injection it's very true if you think about safety or even reliability at a system level especially when a human being is involved it's starts becoming hopeless pretty quickly in terms of proving that something is safe to a certain level yeah there's so many variables it's so complex well let's get back to something we can talk about and it actually makes some progress on yes we can look at C++ programs and we can try and make sure they crash this often the way you do that is largely by simplification it is not the first step is to simplify the code have less code have code that are less likely to go wrong it's not by runtime testing everything it is not by big test frameworks that you're using yes we do that also but the first step is actually to make sure that when you want to express something you can express it directly in code rather than going through endless loops and convolutions in your head before it gets down the code that if if the way you are thinking about a problem is not in the code there is a missing piece that's just in your head and the code you can see what it does but it cannot see what you thought about it unless you have expressed things directly when you express things directly you can maintain it it's these years who find errors is easier to make modifications it's actually easier to test it and lo and behold it runs faster and therefore you can use a smaller number of computers which means there's less hardware that could possibly break so I think the key here is simplification but it has to be to use the Einstein code as simple as possible and no simpler not simpler well there are other areas with under constraints where you can be simpler than you can be in C++ but in the domain and dealing with that's the simplification I'm after you