In this episode, we talk about Python with Meredydd Luff, founder of Anvil. Meredydd talks about why python continues to be one of the most popular coding languages, what the language is best at, and about the tool he created to help developers build full stack web apps with just Python.
[00:00:05] SY: Welcome to the CodeNewbie Podcast where we talk to people on their coding journey in hopes of helping you on yours. I’m your host, Saron. And today, we’re talking about Python with Meredydd Luff, Founder of Anvil.
[00:00:17] ML: Sorry to use a cliché, but good design is timeless. There is nothing about the modern world that makes Python a bad idea.
[00:00:26] SY: Meredydd talks about why Python continues to be one of the most popular coding languages, what the language is best at, and about the tool he created to help developers build web UIs with Python after this.
[00:00:50] SY: Thank you so much for being here.
[00:00:51] ML: Thank you. Great to be here.
[00:00:53] SY: So tell us about how you got interested in coding.
[00:00:55] ML: Oh, I have to confess up front that I got a really lucky and privileged path into it, which is to say that my father, who’s an electronic engineer, chip designer basically, at a certain point sat me down in front of QBasic and showed me how to do basic arithmetic and print the results onto the screen. And I don’t think my parents had seen me sort of take to something like that since possibly the first time they fed me chocolate. From there on in, it was just, “Okay, this is the most fun toy anybody has ever shown.” And so I was hooked since then. And it was several years on from that before I realized that, “Wait, this could actually be a thing you could do when you grew up.” So in other words, I have the best possible introduction to coding, the thought that you would hope everybody would be able to receive, which is to have the door open to this fun world of creativity very early on before people have to make big, dangerous decisions about careers or what they want to do with their lives when they can evaluate it as, “Hey, this is a creative medium. Let’s see what we can do.”
[00:02:07] SY: What was fun about it for you? Do you remember?
[00:02:09] ML: That’s a little bit like saying, “You know, what’s fun about riding on a swing?” The experience of doing it, like the puzzle solving. You know what? There’s a quote in a book called The Mythical Man-Month, which is one of the favorite things about computing I’ve ever read. “The magic of myths and legends has come true in our time. One types the correct incantation and a display screen springs to life showing things that never were nor could be right.” It was almost literally magic. You could write something that was basically like school algebra. And suddenly, your computer was quizzing you on your mental arithmetic. Like, “How did that happen? That was just so cool.” And the ability to sort of pull something like that from the ether and turn it into actual working machinery, I was just instantly hooked.
[00:03:06] SY: How old were you when you got your first exposure to code?
[00:03:11] ML: Seven.
[00:03:12] SY: Seven, nice, nice, nice and early. Good for you, man. So you found QBasic, you’re making some stuff. What kinds of things were you making?
[00:03:19] ML: Oh, I mean, a seven-year-old’s idea of games. So you start with your basic sort of like something quizzing me on my times tables, because that’s probably what I was learning somewhere around there, through to, “Oh, hey, I can draw things on the screen. Oh, let’s draw spaceships that fly around.” And then of course, the very exciting thing we discovered that you could in fact get input from a joystick in QBasic and then you could make proper games of that you could play against your little brother and that sort of thing. So I started out doing that, which is interesting actually, because generally speaking, I've not really been into games since the rush that I see a lot of people getting from games, which is that sense of achievement. I think maybe just like I burnt up my receptors for that sense of rush and achievement by programming or something. I know. I’ve just never really been into it, but those are the things I built first. And actual useful stuff like that was into my teens before I thought, “Hey, maybe I should do something non-frivolous.”
[00:04:20] SY: So then you got a little bit older. You did start thinking about career stuff and what to do with the rest of your life. You went to a university. Did you end up studying computer science there?
[00:04:31] ML: I actually didn’t. I’ve been doing a bunch of programming in my spare time. I had been like a maintainer of an open source project. And by that point, I really firmly knew that computers were going to be a part of my life and I could have that with me forever and I knew I could pick them up wherever and however. So I actually went and studied science. I was a biologist and neuroscientist for what I did my degree, but I then graduated and went to did a PhD in computer science and sort of returned back to where everybody who knew me expected me to end up eventually.
[00:05:06] SY: What caused the return? What brought you back?
[00:05:08] ML: Oh, so I do not mean this as a knock on neuroscience and neuroscientists, but there’s so much we don’t know about the brain. And while that is all inspiring, there was a question on my final exam of my degree, which is, “What’s the function of the parallel fibers in the cerebellum, particular bit of the brain?” And the correct answer, which I attempted to reproduce under exam conditions, was, “Here are the full theories about that that have been current anytime in the last century or so. Here in turn is the evidence why each of them is irretrievably flawed.” End of essay. And you think like the high achieving version of this career is coming up with obviously wrong theory Number 5, or I could go off and actually build something that would be useful. So I went and did that.
[00:05:56] SY: Yeah, yeah, I get that. I totally get that. So now you are the founder of Anvil. What is Anvil? What does it do?
[00:09:00] SY: So before we deep dive into Anvil, I want to talk a little bit more just about Python. Just kind of start with the basics, start at the fundamentals. Tell me about just how would you describe Python? What does it look like to use that programming language?
[00:09:14] ML: So Python is a programming language that prioritizes simplicity. If you look at a program written in Python, it doesn’t have a lot of symbols in it. It looks almost like the pseudocode somebody might use to describe a program’s algorithm to you before you’ve even started programming. Everything is nicely indented. It’s really the only, I think, major popular language where the structure of your code on the page, the spacing and so on is in fact part of the syntax. And so it really pushes you to write clear, simple, easy to understand code. If you are learning to program, you’ve probably already encountered Python because it is the most popular first programming language for beginners and rightly so. And yet, it is the language of the very first beginners. It’s the language of the Raspberry Pi, if you’re into that kind of stuff, physical computing, and it’s also the language that drives Instagram.
[00:10:18] SY: That’s true. Yeah.
[00:10:18] ML: And so the wonder of Python is that it is this language that is sufficiently like incentivizes simplicity. It makes itself accessible that can absolutely scale up all the way to play with the big boys and girls.
[00:10:32] SY: It’s very flexible that way, very versatile.
[00:10:34] ML: Yeah, flexible and I think predictable is a thing that they really emphasize.
[00:10:39] SY: Tell me more about that.
[00:10:40] ML: Okay. So I’m about to compare some different programming languages. If you’re not familiar with lots of different programming languages, that’s okay. And frankly, any of them is a good route into this. So please, if you’re listening to this, don’t interpret this as a, “You must go the Python route or else.” But if you first start learning to program with something like Ruby, which is a superficially similar language, if you see it written on a page, Ruby is optimized for. If you’re somebody who already is an expert in this stuff, you can get stuff done fast. So commonly encountered with Ruby is a web framework called Rails that does a lot of stuff magically. It does a lot of database magically for you. It does a lot of generating web pages magically for you. And that can be very powerful once you understand all the magic and how to use it. But there’s a lot of implicit stuff going on that you may not understand when you first sit down to use something like Ruby, whereas Python has a philosophy. There’s actually a document that was written up early in Python’s design, so The Zen of Python with principles of it. And one of them is, “Simple is better than complex and explicit is better than implicit.” And generally speaking, if you’re using Python, what you will see is every step you take will be explicit. The computer will be doing something because you wrote a line of code telling it to do that. Not because some rules engine has inspected your code and decided that according to the rules that you would know if you’ve read the manual from cover to cover, this thing will happen now. And so I think from the perspective of beginning from a perspective of trying to get yourself replace an understanding quickly, I really rate Python as a language that is sort of no fuss and less likely to be doing magic behind your back you don’t really understand.
[00:13:01] SY: So tell me about a situation where we might want to pick Python as our preferred language of choice. What are some typical types of development things we might build where we probably want to lean more towards Python?
[00:16:45] SY: What I think it’s so interesting about Python is that it was created a while ago, created 40 years ago in the 1980s, but it’s still one of the most popular languages. And given how quickly technology seems to move, that’s really impressive that it’s able to kind of hold on to its place in the industry. Why do you think it’s maintained its popularity over the years?
[00:17:06] ML: Well, first, an awful lot of the languages that we use are actually older than we think. Rather like operating systems, they often actually have quite a long lineage. And I think partially that is because, sorry to use a cliché, but good design is timeless. There is nothing about the modern world that makes Python a bad idea. There are things about the modern world that make writing desktop Windows applications about ideas. These days, everybody expects to use applications through their browser on the web or downloading them onto a mobile device. The platform of Windows desktop applications, it is not dead, but there are really good reasons not to use it. Programming languages, actually, they are ways of telling a computer what to do and we still need to tell computers what to do. And so good programming languages remain a good idea. And so Python has remained a good idea.
[00:18:05] SY: So if people are interested in learning Python, what are some good resources that they might use? Any recommendations?
[00:18:11] ML: So if you want to have like a more interactive experience, Codecademy has a series of exercises that will take you through. I’m not going to lie. They’re going to be a little bit rote, but they will be rote learning, sort of the basics of the syntax and some of the logic.
[00:18:28] SY: And what are some of the most important things people should know before they start getting into Python? What might be helpful to give them a heads up on?
[00:18:36] ML: I guess the one piece of advice I would give is don’t fight it. Python is an opinionated language. It’s steering you towards simplicity. One of the other lines of the Zen of Python document is that there should be one and preferably only one way to do it. So if you find yourself fighting Python to get something done and you can’t quite express what you want, think about whether there’s a way it might feel more simple or too obvious, another way to express what you want. And if you sort of go with the grain, you go with the language of steering, you might have an easier time.
[00:19:12] SY: So now let’s get back into Anvil. Paint a picture for me of what it looks like and feels like to use Anvil.
[00:19:19] ML: Okay. So if you go to anvil.works and click the Start Building button, you are looking at a canvas. It’s a webpage. And that’s in the center of your screen. On the right hand side of your screen is a toolbox of things you can drag and drop onto that page. And so you’ve got your classic user interface components. You’ve got text boxes. You’ve got buttons. You’ve got drop-downs. You can of course put text onto the screen or embedded YouTube videos or maps or there are a bunch of possible components that could make up the actual page of your application images the usual. And then if you click the toggle between Design Mode and Code Mode, you will then find yourself instead of that visual canvas, looking at the Python source code that represents that page. And if you drag and drop the button onto your page and then double click that button, you’ll find yourself editing a function that runs when that button gets clicked or when someone changes something in that text box and you can write the Python code that will update something and make a message appear, they put a call to the server. Then at the top right, you will see a run button which will run the application as far as you’ve built it so far and a publish button that will prompt you to choose a URL and put it live on the internet. That’s mostly what you will be doing when you are using Anvil. You’ll be building your user interfaces or Anvil will be writing the code that makes those user interfaces go. Down the left-hand side of the screen, there are choices for navigating around your application. So obviously you can have several different sorts of pages. You can have extra Python modules. As I’ve talked about, you can have pieces of Python that run on the server. You can set up databases. You can set up user authentication. You can make it talk to Google or Facebook or what have you. But the basic core part is build all user interface, write some Python code that makes it go, choose a URL push online.
[00:21:22] SY: Now obviously, there are a ton of different languages that you could have picked to build Anvil based on. Why did you go with Python?
[00:21:29] ML: I mean, for many of the reasons that we talked about a few moments ago, Python is a really great language for getting started with and it’s a really popular language. And so there’s a lot of people out there who have learned or been taught to code in Python because Python is such a great language to learn as a first language. Therefore, people choose to teach with it. But what that leads to is somebody who can either build a text adventure in Python, which is a really great step to get to because you can actually build something real and interactive. And then a typical thing is, well, I want to show this to somebody. Can I put this online? Time to learn four more programming languages and five more frameworks. Have fun. Did I mention you need a Linux system administration as well? Yeah. Oh, and source control. Don’t forget that. And so people who have already learned Python are often the people who are being most surprised by this learning cliff. There’s also a bunch of people who professionally are already fairly expert users of Python, people who are doing data science machine learning, data processing or system administration where they do data analysis in Python every day. And that’s an ordinary part of their job and then suddenly they want to make that analysis, something that somebody else can see in a nice point-click way, maybe draw some drafts on the screen. And again, they find themselves faced with this learning cliff. And so there’s a whole bunch of people out there who had already learned Python who’d had such a good experience so far in the learning that incrementally each time they wanted to do something, they’d found something easy and now they wanted to do the next obvious thing and suddenly it was incredibly hard. So that was a useful set of people to go find.
[00:23:40] SY: Coming up next, we talk about where Anvil fits into someone’s learning journey and the developer ecosystem as a whole after this.
[00:24:06] SY: So I’m trying to figure out kind of where this fits into someone’s learning journey. Because on the one hand, I appreciate that if we abstract some of the components, if we don’t have people focus so much on learning HTML and CSS and they’re not focusing on source control sysadmin and all that, I get that it would be more approachable and probably more rewarding to be able to see an app show up just from learning Python. But on the other hand, if you want to get a job as a developer, you have to know those things, right? You can’t really get away with not knowing source control or not knowing how to deploy an app or not knowing HTML and CSS. You do need to still know those skills. So how does this product fit in for people who are learning to code? At what point do you graduate, I guess, from an Anvil into kind of the deeper learnings? How do you think about it?
[00:25:00] ML: So I think it embedded in what you just said is a fairly big assumption that everybody who’s learning to code is learning to be a front-end web developer, which is simply not the case. There are huge numbers of people in the world who, I mean, they might be web developers, but they’re back-end web developers, or they work in data analysis or they work in embedded development or they work in scientific compute. And so for a lot of those people actually HTML and CSS is not a necessary part of scaling up for the career they are shooting for. And there’s a lot of web development jobs out there. Don’t get me wrong. And if you’re considering that as a career, I don’t want to slow you down, but there are a lot of really quite interesting and fun career paths there that do not require you to learn all of that stuff. So there’s basically three sets of people I’d say. You’ve got the people who, they’re not going to be web developers. They are really into the embedded stuff or they are really into the data processing or they are really into, I mean, all sorts. One of the favorite sets of people that I’ve met are deep like TV broadcast engineering. I mean, there is so much depth in there and absolutely somebody could make their entire career driving TV broadcast in programming. Does that involve web development? No, it does not. Do you sometimes want to build like a control panel for the piece of equipment you’ve just controlled? Yeah. So there are a whole bunch of people who will have their whole career and they'll be able to pull in something like Anvil to get something done and then walk away and never think about it. So that’s group number one.
[00:26:38] SY: I see.
[00:30:07] SY: Fair. Fair. So what development situation or what goal is Anvil maybe not a great choice for?
[00:31:35] SY: Now at the end of every episode, we ask our guests to fill in the blanks of some very important questions. Are you ready to fill in the blanks?
[00:31:42] ML: Let’s do it.
[00:31:43] SY: Number one, worst advice I’ve ever received is?
[00:31:47] ML: Probably the worst advice, certainly the worst career advice I ever received was when I was looking at a job at an infrastructure company. I'm not going to name them. This was at the end of my PhD. And somebody told me, “Well, they’re doing really well. They’re going to go IPO probably in a couple of years. If you don’t spend those couple of years working for them, you’re throwing money away.” And I did go and interview with them on that recommendation. And I thought, “I mean, I could work here and I can be reasonably satisfied, but this is probably not the most creatively fulfilling work I will be able to do with the next couple of years and there’s no guarantee of anything anyway.” And I didn’t go with them and I went with something that was much more interesting instead, even though it probably did financially cost me. But in terms of my quality of life, I was well out ahead. So yes, worst piece of advice somebody gave me was just think of that, the pecuniary interest. We are lucky in this industry. Once you have succeeded in breaking in, and again, I acknowledge, we have a lot of beginning listeners who are looking to break in and may not be finding life as easy as somebody who’s been in for a couple of years is, it’s actually worth even more important to remember. You will very rapidly remarkably early in your career, earlier than in almost any other career available. You will get to a point where you have enough options. You don’t have to choose the first half decent option. You can choose something that will fulfill you.
[00:33:26] SY: Number two, best advice I’ve ever received is?
[00:33:30] ML: My best advice is probably going to be actually similar. Come to think of it. It was that the person who said, “Yeah, go do that science degree. You don’t have to jump straight into computer science. Computers will always be there. If this is something you want to do, go for it.” People sometimes go overboard on pursue your dream at all costs. And I do acknowledge that you have to have some sense of practicality in it, but we in this industry in particular have so much latitude to be able to swing a little bit in favor of following our dreams. That’s good advice. Remember that you are not your paycheck. Your experience of this life is at least as important.
[00:34:14] SY: Number three, my first coding project was about?
[00:34:16] ML: Testing my mental arithmetic.
[00:34:18] SY: Nice! Number four, one thing I wish I knew when I first started to code is?
[00:34:24] ML: I wish I had known that it was something you could grow up to be that this creativity was available forever. I also wish I had known to write it down and remember more what that experience of having that door opened for the first time was like because you will look back on that and remember quite how much possibility opens to you quite so fast.
[00:34:54] SY: Well, thank you again so much for joining us.
[00:34:55] ML: Thank you very much for having me. It’s just been great.
[00:35:04] SY: This show is produced and mixed by Levi Sharpe. You can reach out to us on Twitter at CodeNewbies or send me an email, firstname.lastname@example.org. Join us for our weekly Twitter chats. We’ve got our Wednesday chats at 9 P.M. Eastern Time and our weekly coding check-in every Sunday at 2 P.M. Eastern Time. For more info on the podcast, check out www.codenewbie.org/podcast. Thanks for listening. See you next week.
Thank you to these sponsors for supporting the show!