Guido van Rossum: Python and the Future of Programming | Lex Fridman Podcast #341

Guido van Rossum is the creator of Python programming language. Please support this podcast by checking out our sponsors: - GiveDirectly: https://givedirectly.org/lex to get gift matched up to $1000 - Eight Sleep: https://www.eightsleep.com/lex to get special savings - Fundrise: https://fundrise.com

can you imagine possible features that python 4. 0 might have that would necessitate the creation of the new 4. 0 given the amount of pain and joy suffering and Triumph that was involved in the move between version 2 and version 3. the following is a conversation with Guido van Rossum his second time on this podcast he is the creator of the Python programming language and is Python’s Emeritus pdfo benevolent dictator for life this is the Lex Friedman podcast to support it please check out our sponsors in the description and now dear friends here’s Guido and Russell python 3. 11 is coming out very soon init C python claimed to be 10 to 60 percent faster how did you pull that off and what’s C python C python is the last python implementation standing also the first one that was ever created the original python implementation that I started over 30 years ago so what does it mean that python the programming language is implemented in another programming language called C what kind of audience do you have in mind here people who know programming no there’s somebody on a boat that’s into fishing and have never heard about programming but also some world-class programmers you’re gonna have to speak to both imagine a boat with two people one of them has not heard about programming is really into phishing and the other one is like uh an incredible Silicon Valley programmer that’s programmed in everything C C plus plus python rust Java it knows the entire history of programming languages so you’re gonna have to speak to both I imagine that boat in the middle of the ocean yes I’m gonna please the guy who knows how to fish first yes please he seems like the most useful in the middle of the ocean you got you gotta make him mad I’m sure he has a cell phone so uh he’s probably very suspicious about what goes on in that cell phone but he must have heard that inside his cell phone is a tiny computer and a programming language is computer code that tells the computer what to do it’s a very low level language it’s zeros and ones and then there’s assembly and then oh yeah we don’t talk about these really low levels because those just confuse people I mean when we’re talking about human language we’re not usually talking about vocal tracts and how you position your tongue I was talking yesterday about how when you have a Chinese person and they speak English uh this is a bit of a stereotype they often don’t know or they they can’t can’t seem to make the difference well between an l and an r and I have a theory about that and I’ve never checked this with linguists uh that it probably has to do with the fact that in Chinese there is not really a difference and it could be that there are Regional variations in how China native Chinese speakers pronounce that one sound that sounds to L to some like L to some of them like R to others so it’s both the sounds you produce with your mouth throughout the history of your life and what you’re used to listening to I mean every language has that Russian has exactly the Slavic languages have sounds like the letters like uh Americans or English speakers don’t seem to know the sounds they seemed uncomfortable with that sound yeah so I’m sure oh yes okay so we’re not we’re not going to the shapes of tongues and the sounds that the mouth can make fine words similarly we’re not going into the ones and zeros or machine language I would say a programming language is a list of instructions like a cookbook recipe that sort of tells you how to do a certain thing like make a sandwich well acquire a loaf of bread cut it in slices uh take two slices uh put mustard on one put the jelly on the other or something then add the meat then add the cheese I’ve heard that science teachers can actually uh do great stuff with recipes like that and trying to interpret their students instructions incorrectly until the students are completely unambiguous about it with language see that’s the difference between natural languages and programming languages I think ambiguity is a feature not a bug in human spoken languages like uh that’s the dance of communication between humans well for lawyers ambiguity certainly is a feature uh for plenty of other cases uh the ambiguity is is not much of a feature but we work around it of course well what’s more important is context so with context the Precision of the statement becomes more and more concrete right but you know when you say I love you to a person that matters a lot to you the person doesn’t try to compile that statement and return an error saying please define love right no but I imagine that my wife and my son uh interpret it very differently yes even though it’s the same three words but imprecisely still oh for sure lawyers never had a lot of follow-up questions for you nevertheless the context is already different different in that case yes fair enough so that’s that’s a programming language is uh ability to unambiguously State a recipe actually let’s go back let’s go to Pepe you go through and pepe the style guide for python code some ideas of what this language should look like feel like read like and the big idea there is that code readability counts what does that mean to you and how do we achieve it so this recipe should be readable that’s a thing between programmers because on the one hand we always explain the concept of programming language as computers need instructions and computers are very dumb and they need very precise instructions because they don’t have much context in in fact they have lots of context but their their context is very different but what we’ve seen emerge during the development of software starting in the probably in the late 40s is that software is a very social activity a software developer is not a mad scientist who sits alone in his lab writing brilliant code software is developed by teams of people uh even the Mad scientists sitting alone in his lap can type fast enough to produce enough code so that by the time he’s done with his coding he still remembers what the first few lines he wrote mean so even the mad scientist coding alone in his lab would would be sort of wise to adopt conventions on how to format the instructions that he gives to the computer so that the thing is there is a difference between a cookbook recipe and a computer program The cookbook recipe the the author of The cookbook writes it once and then is printed in 100 000 copies and then lots of people in their kitchens try to recreate that recipe that that particular pie or dish from the recipe and so there the the goal of the cookbook author is to make it clear to the human reader of the recipe the human amateur Chef in most cases when you’re writing a computer program you have two audiences at once it needs to tell the computer what to do but it also is useful if that program is readable by other programmers because computer software unlike the typical recipe for a cherry pie is so complex that you don’t get all of it right at once you end up with the activity of debugging and you end up with the activity of so debugging is trying to figure out why your code doesn’t run the way you thought it should run that means brother could be stupid little errors or it could be big logical errors it could be anything spiritual yeah it could be anything from a typo to uh a wrong choice of algorithm to building something that does what you tell it to do but that’s not useful yeah it seems to work really well 99 of the time but does weird things one percent of the time on some edge cases that’s pretty much all software nowadays all good