 So we're about to start our last talk for this session. We have Nothingness and Identity in Python by Daniel Procida, who was keynote speaker last year and has joined us again this year. So thank you very much and let's welcome him. Thank you very much. Thank you, of course, as usual, to the organizers for putting this on. It feels every time that we're being invited to a party that somebody wants to organize for their friends. It's a labor of love. I really appreciate that. So thank you very much, not just for the invitation, but for everything that you've done. It's really wonderful to be here. I'm going to have to rush through this because I only have a short slot and I have a lot to say as usual. So I'll jump straight in. So let me tell you a little bit about me briefly. I'm Daniel Procida. That's what I look like on television. That's how you can get in touch with me. But the best thing is just to come and find me and talk to me. I'm a Django core developer. I'm an ex-vice president of the Django Software Foundation, so I'm no longer on the Django Software Foundation board, which is something people forget, that I forget and the board forget, so it seems you can't get away. I work at DVO. We do cloud hosting for Python and Django and other things, but if you're interested in web hosting and it's giving you some travel, come and talk to me. Maybe we can. There's a better way of doing it. So the other thing that I'm really involved in that I want to tell you about is the very first PyCon Africa. I've been involved in, I've been attending African PyCons for several years, and this year we're holding the first PyCon Africa in Ghana, 6th to 10th of August. Please come and talk to me about that. Also, if you're interested in coming, sponsoring, I'm part of the organisation of that, and that's going to be very exciting. So here we are. This is a 16th-century fresco by Raphael in the Apostolic Palace in Vatican, and it depicts thinkers and scholars, mainly from antiquity. And here, at the centre of the painting, at the centre of attention are Plato and Aristotle. Aristotle, of course, was Plato's most famous pupil, and like every good pupil he felt obliged not just to learn from his teacher, but to respond to him too. And we have Plato pointing up towards the heavens in reference to a world outside space and time, one belonging to the pure forms that all the things in our material world are just a kind of shadowy copy of, whereas Aristotle points down towards the material world because he argues against Plato that form only exists as a form of actual substance, that knowledge and truth require us to generalise from the particular to the abstract and not the other way round that Plato goes. So these two directions of thought represent the single most important axis in Western philosophy, and the question for us is which of these directions do we prefer or turn to or choose to universal ideas and truths that lie beyond the world of the senses or to the actual world that presents itself at our feet? And, of course, you can't actually reduce Plato and Aristotle to something so simple as that. This is a very simple dichotomy, but this difference represents two, let's say, directions of thought, and you don't actually need to be a student of philosophy to recognise them. And people, given an opportunity to reflect on this, will usually recognise themselves in one of these two directions. Some of you will have intellectual sympathies that generally resonate with those of Plato, and some of you will have, find yourself thinking that Aristotle seems to represent the obvious way that our thinking should be formed. And most people seem to know which direction is there, as the Platonic or the Aristotelian, and I'm not saying necessarily that they believe in an ideal world of pure universal forms, but that generally they find themselves preferring to think in a certain kind of way. And you can also see this axis of thought as representing the two different directions taken by Western philosophy over the last 25 centuries. I started learning Python about 10 years ago, and I had a very memorable experience in my first Python lessons. It was a five-day introduction to Python and Django, and we were given a handbook. And I sort of lived in that handbook for years afterwards. It was literally always open on my desk, as you can see from the coffee marks, because I would put my coffee cup down on it. And I took it home one evening in that first week, and I showed it to my girlfriend Carol, and she leafed through it, and then she exclaimed, functions, classes and attributes. It's just, it's all Aristotle. And it is, in his ethics, Aristotle is concerned with virtue. He argues that the defining human function is rational activity. And he's very interested in the relationship between what a human being is, sorry, between what a being is and what a being does. And I mentioned this the next day to the person who was giving us our training. His name was Ian Millington. Some of you may even know the name. And it turned out that as well as having earned a doctorate in the field of artificial intelligence, his first degree was in theology. And he was also familiar with these ideas. And there were three of my colleagues in the room with us. And Ian and I, I were very happily chatting about Aristotle and reason and Python and functions and the human soul. And my colleagues endured this for a few minutes. And then one of them announced, I'm a creationist. And this talk about function and reason is making me feel very uncomfortable, which I wasn't expecting. And I was really taken aback. And I wasn't actually sure whether he was maybe teasing me or with a joke or if I'd misheard. And I started to ask him, what about it made him feel uneasy? And then my colleague Ben said, you needn't look so surprised. I'm a creationist too. And by this point, my mouth was hanging open. I don't think I was looking very intelligent. And then my third colleague said, Daniel, you're outnumbered. I'm also a creationist. And of course, I was completely flawed. And there were so many questions I wanted to ask at this stage, like, should we accept Aristotle's account of virtue as a disposition? Or what do you make of Aristotle's conceptual function as defining activity rather than purpose? Or do you identify a contradiction between Aristotle's form-substance dualism and a creationist account of the soul? So had all these thoughts and more intelligent things to say going around in my head in quick succession, but the only thing that formulated itself into anything resembling a coherent sentence was, what about the dinosaurs? And fortunately, I had some mental capacity left and I didn't actually say anything. And if there's one thing I've learned over the years, it's to recognize when I'm outnumbered. So I was pretty intrigued, but I didn't pursue the question. And I've never forgotten that experience, that how quickly we got from basic concepts in programming to ideas in metaphysics and ontology that are not only important to academic philosophers, but will resonate and trouble and bother people who haven't studied philosophy and that have the power to shake people when they start thinking about them. And shaking people is exactly what important philosophical concepts tend to do. And what I realized as I learned programming was that philosophical concepts are literally expressed in programming itself. And that as programmers, we are working with philosophical ideas when we think about our code. And the more I've learned, the more obvious it has become how deeply embedded in programming these ideas are. And you might think that's expected. Logic is a branch of philosophy. And of course, programming involves logical thinking, putting together sequences of logical operations. But as the experience with Aristotle and Function suggests, it goes deeper and further and it's more interesting. Now, for a programming beginner like me, this connection gave me something to hold onto, a way to understand certain things in programming through something that I was already familiar with in philosophy. Because I already knew my way around things like attributes and ontologies and identity and truth and nothingness around types and instances and abstract classes, which you will all find in philosophy. I can't say I knew exactly what they meant because in philosophy, they're heavily contested anyway. Whereas in programming, at least somebody's gone to the trouble of writing a definition for you. But they were things I was used to talking and thinking about. I felt I was on familiar territory. And another thing that I found that seemed quite familiar about programming and that I also enjoyed were these declarations that I would read or hear. And they had a kind of profound and poetic mystery about them. So my handbook said, functions are first class values. And it said, values have type, variables don't. And it reminded me of Wittgenstein. Truth functions can be arranged in series or can't. Existence is not a predicate. And these are things I couldn't really judge whether they were true or not or what the implications were. And I didn't even know what kind of things they were, whether they were discoveries or axioms or necessary truths or something else. But I could feel, I could tell that there was something important about them. There were significant declarations about something important. And reading these things about Python reminded me of the things I read when I was studying philosophy. And the feeling that I had when I read similar things in philosophy, I couldn't judge whether they were true or false. But they seemed to lie upon a line of truth. They seemed to stand out to me as being important. And that they seemed to me to demand some kind of response from me. And often I would never understand them the first time or the 20th time I read them. But they seemed to demand that I return to them again and again until I did or thought I did. And so did the things that I read about Python. And when you find an idea that seems to lie upon a line of truth, then you feel this obligation to explore it, decide where you belong or which direction you're good to take on this line. Sometimes they have the kind of side benefit of giving me a reason to feel superior, which I'll take any time. So in my handbook, Python correctly distinguishes between an initializer and a constructor. Many languages, like Java, conflate the two, incorrectly calling this a constructor. So you can only imagine the pity and scorn I felt for those who might conflate a constructor with an initializer. And I had literally no idea what a constructor might be. But I knew that I would never be so vulgar as to conflate one with an initializer. And I had the same feeling sometimes reading philosophy. So here's Kant dismissing the appeal to common sense, which he says, the appeal to common sense, a convenient way of being defiant without any insight. So maybe some politicians might benefit from that. So I'll take any opportunity to enjoy a feeling of superiority. However, undeservedly, I've earned it. Now, when I started programming, I kept running into surprises that were not unlike the problems that philosophers find themselves with when they confidently pick up something that looks simple and then have a closer look at it. So a child very quickly learns to use the word nothing with confidence. What are you doing up there? Nothing. And then it turns out that you've got a pair of seven year olds in a bunk bed trying to inflate a balloon with a candle. So we use the word nothing several times a day without doubt or hesitation, not just in speech, but in our thinking about the world too. We use it to represent the world. Nothing is simply the absence of something. And just as in philosophy, nothing starts to look a little bit more troublesome when you unpack it. It also does in programming. One of the most common things I had to do as a programmer was to check for the absence of something. And all of a sudden, it was quite a marvel to me how many different kinds of absences of something could exist. I had to deal with several kinds of them. There was none. And there was zero. And there were empty lists and sets and other collections. There was the empty string. And then when I was doing Django in Django model fields, there was null for the database and blank for the forms. And they were all not something. They were all different kinds of nothing. And they were all different from each other. And in the Django applications I was building, I needed to represent the world, to construct a picture of it, not just of its matter, its content, but also of its logical form. So let's say I needed to represent actual people. Well, then you need a person model to capture that. So there'd be actual persons, persons like you sitting here. And then I would need to figure out my own adequate mental representation of a person in my thinking. And then in my Django models, in the database, in the forms which capture the data, and in the output. And all the different kinds of nothingness didn't really make a difference here, but they made different kinds of difference in all of these contexts. So consider something like a person's name or parts of a name, which parts of these will be allowed to be none or null or blank, and how are you going to deal with it? How are you going to display them? How are you going to order them? It turns out that to be very complex, because nothingness is not a simple business, and it affects everything it touches, and nothing really does matter. Now I found another abiding fascination in the other side of nothingness and negation in being. And just as negation has its origin in nothingness, so identity has its origin in being. Again, very simple. Being an identity, they belong to the verb to be. And even a child learns to use that simply and correctly and confidently. And so does the Python beginner, usually using these in simple and successful ways. And we can say 7 and 7 is 14, or 7 and 7 equals 14. And we know what we mean, and they're both true and they both make sense. And there doesn't seem to be too much pressing need to worry about it, because it works at first, until you do something similar that you thought would be the same, and then it doesn't work. And then you'll continue to run into puzzles in which their expectations, built on apparently similar outcomes of apparently similar operations, are confounded, where you have two operations that are only apparently similar, but not. You might say superficially similar, but I think actually the similarity here is deep and not superficially. It's only because we're human beings with the only human beings would perceive the profound similarity here and as a result get tripped up by the differences. And the puzzles will catch them out in their code. So, well, this works. That's fine. And that also works too. And so does that. And that doesn't. And does anybody know immediately what? Exactly, so the representation of integers up to the value, I think, of 256 in Python is a special case. And as people explore what is is and what equality is and what assignment is, it's quite a time before they internalize these rules and learn to ask the right kind of questions. What somebody thought they were asking was not what they were actually asking. So these are simple things, but the idea of is is such a simple thing. But philosophy has spelt a vast amount of ink trying to understand it. And this might seem like unnecessary quibbling to people who aren't philosophers. People don't like it when you have big discussions about small words. It's very suspicious, like when Bill Clinton said, famously, when he was facing the grand jury about his relationship with Monica Lewinsky, he said it depends on what the meaning of the word is. And he was not a good look. He was squirming and sweaty on television with good reason. But a Python interpreter has got a lot more patience than a grand jury and also no powers of understanding. So when we're dealing with a Python interpreter, we have to get the meaning absolutely right with respect to what the Python interpreter is expecting. We'd better agree with Python on its own internal metaphysics of being. So let's go back to Plato and Aristotle. Carol was very happy to read about functions and attributes in Python because it reminded her of Aristotle. And he has a lot to say about them. So we have Plato with his ideal forms that exist in and of themselves that define concrete things, whereas Aristotle wants us to start with concrete particulars in which we find that form inheres in which we discern the generals. Now this aligns with another nice distinction. Because the object-oriented programming that we do in Python is class-based. And this might be old news to you, but that's not the only kind of object-oriented programming. In JavaScript, you have prototype-based programming. So in class-based programming, we define abstract classes. In prototype-based programming, we create concrete objects. The classes exist as formal ideals from which we instantiate objects. In prototype-based programming, we find the form of our objects in hearing only in the particulars. And we clone concrete objects to create new ones. So the ideal form of an object, the blueprint, the class that defines it, exists in and of itself for Plato and class-based programming. But Aristotle, JavaScript, and prototype-based programming take a different approach. So it seems to me that Plato is to Python as Aristotle is to JavaScript. Maybe Aristotle is a better model. Carol didn't know that, but she's a philosopher, not a programmer. Even I didn't really know this until quite recently. So here we are back again in the Apostolic Palace, with Plato pointing up and Aristotle pointing down. To say that one is right and one is wrong is not really the point. It's a difference that demands somehow that we take sides. And if we want to answer the question, Plato or Aristotle, which side are we going to take? Well, I think kind of a sensible answer is, I don't have to choose. But actually, my answer is Plato, obviously. Because everybody finds themselves on that line. So here for the last time, here they are on the wall of the Apostolic Palace. Plato pointing up, Aristotle pointing down. They're the center around which everything else is revolving. And here's John Travolta in Saturday Night Fever. And he's a center around which everything is revolving. And he's also pointing up and pointing down at the same time. And those two directions give us a line. It's a line of truth. And we can choose for ourselves a direction on that line. We don't have to, but we can. And the important thing is not to choose the direction, but to be aware of the dimension, which gives us both dimensions at once, like John Travolta. And we must live on this dimension in our thinking, I think. We must find our way on this line of truth. When you find something like this, you feel obliged to explore it to choose your direction. And that was the kind of force and the demand that I felt in philosophy. And it has been with me ever since. Now, of all the people I've met in the world, since I started my philosophical studies a very long time ago, the ones who respond most strongly to philosophical questions are actually programmers. Maybe these people who think that way tend to become programmers, or maybe programming does something to the way they think. I don't know. But I've never met any other population of people, including actual academic philosophers, who can think about philosophical questions as intelligently and wisely and illuminatingly as programmers can. And it's an experience that I've had again and again, including when it comes to questions of things like ontology and metaphysics, existence, identity, and nothingness. And they've been, on the whole, much more rewarding conversations than the ones that I've had with actual students or academic colleagues, or, as we call them in academia, opponents. And I'm sure that if programmers became philosophers, they'd have lots of interesting things to say about some of these things. So here's Kant's treatment of nothingness, which is equal in rigor to anything that you'll find in programming. Or his table of judgments, by the way, he calls judgments, logical functions of unity. There we are with functions again. I've read so much rubbish on this subject, mostly not from undergraduates in their essays, but in books that I've gone out to buy with my own money. So that gives you an idea of that. I'm sure programmers would do better at this. And there are so many places to go and things to think about that are connected directly to these ideas, where substance, identity, equivalence, positivity, objecthood, and their corresponding ideas on the side of nothingness. And these things may well be wider and further than you imagine, these connections may be deeper. Now, Plato argued that we'd never have a just society until philosophers became rulers or rulers became philosophers. And I found this very appealing about 30 years ago. But it started to look a little bit more implausible, especially since I got to know a little bit more about the way philosophers actually managed to run things, like philosophy departments. So what about the idea of programmer kings? Well, programmers already have a vast amount of power and influence because their thinking is responsible for much of the construction of our world right now and is becoming increasingly slow. And while it's a subject for another discussion, I think my main response is to say, no, thank you very much. I'd probably even take my chances with the philosophers. But the idea of programmer philosophers is something else. Programmers are made for this. They're genuinely good at this. And I find it nothing less than fascinating that they are. And I continue to have fascinating encounters with programmers that illuminate and add new dimensions to the philosophy that's been one of the most important things in my life for most of my life. So I would say thank you all for the conversations. And I hope there will be many more. I don't know if we have time. I'm happy to have some questions if we have time. So thank you very much. We have time for literally one question. That was quite amazing, Daniel. So clearly, metaphysics has to give way to epistemology. The question of what is has to give way to the question of how can we know anyway. How would you see that as informing your programming style? Well, first of all, I should say that you can spot an Aristotelian a mile off when they ask questions like that. Because I actually dispute that. I think that, for example, we need metaphysics because metaphysics will we need metaphysics to understand how we know how knowledge is possible, how understanding is possible in the first place. So I'm not sure that we can start with metaphysics. About my programming, my programming is actually extremely not even Aristotelian. It's kind of common sense inductive, just trial and error until something seems to work. So I wouldn't, yeah, you showed me up there a little bit because I don't think that you could really map it onto anything so grand. My programming is actually very poor. But I love thinking about these ideas. I loved your talk because of the way it illuminated some of these things. And I was able to look at your description of the construct and say, well, yes, I know that, of course. The constructor cannot be confused with an initializer. So yeah, I think there probably are programmers. But they are programmers who are operating at quite a different level from the level at which I operate as a very clunky, clumsy programmer feeling his way. I think that's probably it, unless we can squeeze one more in. No, we have to go. OK, thank you. Thank you very much.