Monitor performance issues & errors in your code

#149: 4 Python Web Frameworks, Compared Transcript

Recorded on Tuesday, Jan 30, 2018.

00:00 Michael Kennedy: Are you considering getting into web programming? Choosing a web framework like Pyramid, Flask, or Django can be daunting. It would be great to see them all build out the same application and compare the results side-by-side. That's why when I heard what Nicholas Hunt-Walker was up to, I had to have him on the podcast. He and I chat about four web frameworks compared. He built a data-driven web app with Flask, Tornado, Pyramid, and Django and then put it all together in a presentation. We're going to dive into that right now. This is Talk Python To Me, Episode 149, recorded January 30th, 2018. Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities. This is your host, Michael Kennedy, follow me on Twitter where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm, and follow the show on Twitter via @talkpython. Nick, welcome to Talk Python.

01:05 Nicholas Hunt-Walker: Thanks for having me.

01:06 Michael Kennedy: It's great to be here. It was really nice to meet you last week at PyCascades. It was a fun conference.

01:11 Nicholas Hunt-Walker: Oh man, that was awesome. That was my second Python conference ever, and it was on-par for me with PyCon.

01:18 Michael Kennedy: Yeah, it was definitely a different vibe. I wasn't like a huge expo hall or things like that, but I felt it made up for it in the richness of conversations. You could sit and talk with three or four people, and those people were amazing.

01:30 Nicholas Hunt-Walker: Right, and the one thing that's been different is, I've done a lot of academic conferences. I used to do astronomy, so I've been to a few national conferences, and I've always missed out on talks, and this is the first conference that I've gone to where I had the actual opportunity to sit and hear every talk. I didn't feel like I'd missed out on anything.

01:46 Michael Kennedy: Yeah, and the talks were really good. So, congrats to everyone. That's a new conference, and you missed it this year, but it's coming to Seattle next year, and then Portland the year after, and it's supposed to kind of go up and down the Cascades and the West Coast of the U.S., the mountain range. So, it should be a lot of fun. I'm looking forward to going next year already. But that's not what we're here to talk about exactly, although we are going to cover a talk that you gave there which sort of surveys a bunch of the popular web frameworks and we'll get into that, so let's start with your story. How'd you get into programming and Python?

02:14 Nicholas Hunt-Walker: Sure I had actually... I didn't think I'd ever be programming, ever. I started doing astronomy back in about 2007. I just got really interested in how stars lived and died, and so I started doing astronomy, started doing science.

02:27 Michael Kennedy: It seems like one of the most amazing parts of all science is astronomy these days.

02:32 Nicholas Hunt-Walker: Yeah, I mean, there's a lot going on in astronomy. A lot of former colleagues are doing some amazing work, finding planets, learning about black holes we didn't know existed, all kinds of great things. When I started doing astronomy I thought, I naively thought that I would just be looking through telescopes, and taking down notes, and thinking through equations, and that kind of thing. I didn't think I'd be writing any programs, at all. And so when I got into grad school, even before I got into grad school I had to learn how to program a little bit, and I used FORTRAN 77, and that was... I hated it, I hated it, I hated it.

03:04 Michael Kennedy: I did too. I had to take it. I was in engineering at first, and they told me... I said, "Could I please take C++?" They said, "No, you have to take Fortran. It's the most important language you'll ever learn." I'm like, "No."

03:14 Nicholas Hunt-Walker: Well, it's one of those things where when you're in academia, and you're an undergrad, or you're in grad school, you learn the language that your advisor knows.

03:24 Michael Kennedy: Exactly.

03:24 Nicholas Hunt-Walker: And my advisor knew Fortran, so I learned Fortran. And then, when I went... That was at Columbia. I was in the Bridge to PhD program there. It's a great program for the sciences, and when I transferred into a graduate program at the University of Washington, then my advisor was using a language called IDL. I forget what that even stands for, but it's a proprietary language, so you have to have a license on your computer to use it, and if you wanted to be able to do work at home you have to have a license on your home computer to use it, and so it's a whole lot of stuff with that. You have to be connected to the Internet so they can verify your license.

03:57 Michael Kennedy: Oh, it's that intense? It has like almost like a dongle type thing?

04:00 Nicholas Hunt-Walker: No, it's not a dongle, it's more like if you're not connected to the Internet then you can't use the IDL editor.

04:06 Michael Kennedy: Wow, that's intense.

04:07 Nicholas Hunt-Walker: And you can't run your IDL program.

04:08 Michael Kennedy: That's kind of the opposite of Python.

04:09 Nicholas Hunt-Walker: Which sucks. Yeah, it's terrible. Exactly, exactly. And so I actually learned Python partially to get away from IDL. It was kind of my way out. I had been introduced to this language and I was like "Oh, this is a free thing. I don't have to have a separate license to do this. I can install it on any machine. It looks like English."

04:29 Michael Kennedy: Yeah, yeah.

04:30 Nicholas Hunt-Walker: Why not, yeah, absolutely. So I used Python for my research. I used Python for my homework. And then, one of my colleagues at the time, and this is kind of where it really took off for me, he had been doing blog posts about science. And I was like "Oh, that sounds cool, I should do that too." And I used Python to help me learn more about the science that I was doing, and I was using the science to help me learn more about the Python that I was writing. And so I kind of got a lot of that practice, after hours, just using Python to answer interesting questions.

05:00 Michael Kennedy: Yeah, that sounds really cool. It's a very organic story of just like, I kind of just found my way into it, and it just sort of grew as you played with it. That's awesome. So, like I said, I'm a big fan of astronomy. Are you still doing that today? You're not, right? You're sort of--

05:13 Nicholas Hunt-Walker: I'm not, not actively.

05:15 Michael Kennedy: You took the path that I did, like let me work on a PhD, and actually do nothing, and just go program with it later.

05:20 Nicholas Hunt-Walker: No I just feel bad, but yeah.

05:22 Michael Kennedy: No, I know I do, too. I kind of look at my advisors and stuff when I left, I'm like, "Yeah, I'm sorry, but I'm going." It was tough, actually, but I think it was totally the right choice for me. I don't know about you.

05:34 Nicholas Hunt-Walker: Yeah, it was time. I wouldn't make a second choice in a second. You know I met some great people there, but I'm much happier doing what I'm doing now.

05:43 Michael Kennedy: Yeah, I feel like the PhD experience, all of grad school, kind of taught me how to do what I do now, but I feel like I'm applying it in a place that makes a bigger difference for more people.

05:52 Nicholas Hunt-Walker: Right, I'm still doing as much reading as I was doing during my PhD program. I'm still doing as much thinking, but it's toward... So one of the problems that I had with the work that I was doing in my PhD program was it was not very easy to explain to other people, why it was interesting or important. I knew why it was interesting and important. I love aged stars and seeing what's happening as they were dying, but in order to explain that, I've got to explain, "Okay look, this is how stars evolve. This is what all the stuff means." I've got to apply all this background. Whereas, what I'm doing right now, I'm teaching at Code Fellows, and I can just say I'm teaching people how to program. I'm teaching people how to make websites. So, this is the kind of stuff you see on Google.com, or anything.com. I'm teaching people to do that, at least at the basic level, so they can go out into the real world, and get a job, and do that stuff for real.

06:39 Michael Kennedy: Yeah, and it's a great experience to help people sort of change careers, or advance their career down some other path they weren't doing before. So, what does a typical day... So, Code Fellows is a bootcamp, for those who don't know, right? And what's a typical day there look like?

06:54 Nicholas Hunt-Walker: Yeah, Code Fellows is one of the coding schools in Seattle. I'm a little biased. I think it's one of the best ones, but I also work here. And I know some really good people, but a typical day when I'm teaching looks like, three hours of lecture. Let's say I'm teaching one of my Python lectures. It's like, okay, we do about an hour of code review, and then we talk about some topics, we do some data structures, we do some algorithms, practice. I'll teach them about a web framework, or some aspects of web framework, like what a model is, or what a view is, or how to do routing, or security, that kind of thing. And then we go to lunch, and afterward they come back, and they work with each other on lab assignments. We build the lab assignments to complement the lectures. So, I teach a thing, and then they use that concept in their application. And after that point in time, they're kind of on their own. They're still on location, but they're on their own, building the projects. Myself and the TAs are here to grade their assignments, and to be resources when they need help.

07:53 Michael Kennedy: That sounds like a really fun job. And how long does the bootcamp run for?

07:56 Nicholas Hunt-Walker: The full sequence, so there's three levels to it: 201, 301, and 401. 201 is four weeks, and that's the basics of HTML, CSS, and JavaScript. And then the 301 is also four weeks.

08:07 Michael Kennedy: 'Cause you have to do that, there's no way to avoid JavaScript.

08:10 Nicholas Hunt-Walker: Right, there's no way to avoid it. That is the language of the web, let's be honest here.

08:13 Michael Kennedy: Yep, it is.

08:14 Nicholas Hunt-Walker: So 301 is also four weeks. That's more intermediate HTML, CSS, and JavaScript. We talk about jQuery, talk about more libraries. We kind of get people more interested in the wider scope of being a web developer. We start dipping into the back end a little bit with Express, but not too much. And then in the 401, that's 10 weeks, and we have several 401s. We have Python. We have JavaScript. We have Java. We have C#, .NET. And that's 10 weeks. For the Python class, that's basics of Python, a preliminary web framework like Pyramid, and then a more advanced web framework like Django, this is actually where my talk came from, 'cause I've been teaching this course, or at least being part of the teaching process in some way, shape, or form, for the last almost two years. And having all this exposure to it I was like, "Huh, I wonder what these other frameworks look like?" 'Cause I'd only ever taught. I'd never actually learned Python for web development in my graduate work. I was doing astronomy. I was doing data analysis. I only learned how to do this stuff on the job.

09:11 Michael Kennedy: They don't have web frameworks for, machine learning across... Tell it, like that's just You don't build web apps, right? You do build other stuff.

09:20 Nicholas Hunt-Walker: Yeah, it's all custom software.

09:22 Michael Kennedy: Yeah, exactly.

09:22 Nicholas Hunt-Walker: I had never actually used Python for web development, so I only learned this stuff when I was on the job. And so, I'd only been exposed to Pyramid and Django. I'd done a little bit of Flask just kind of as a one-off thing, but I didn't really understand what I was doing. So, I didn't really take the time to dig into these web frameworks. So, I was like, "Okay, I wonder what these other ones are like. I'll just try to talk about that, 'cause I'm sure I'm not the only one who thinks this."

09:46 Michael Kennedy: No, I think it's a super-interesting idea, because a lot of times what I find is people, they kind of do a quick survey. They're like, "All right, what's out there? Django, okay, there's a lot of building blocks already built, and they're kind of big." Okay, or there's the micro frameworks and they're really small. I put pieces together. This one or that one is mine. That's my style. I'm going to go do it And then they kind of just stop, right?

10:05 Nicholas Hunt-Walker: You learn what you need to know to do the job you're trying to do. And most people aren't doing, unless you're a contractor, you're not doing a new project every three months.

10:13 Michael Kennedy: In a different framework.

10:16 Nicholas Hunt-Walker: In a different framework or a different language entirely. You just, you have your job. You might jump around from company to company, but you're still like, most places are hiring for Django, so you learn Django, or they're hiring for Flask, so you learn Flask or you're just building tools for the backend. But yeah. In my 10 week class it's all that plus data structures and algorithms, and a little smattering of machine learning, so it's like end to end. With the week break in between each class, it's about 20 weeks total.

10:43 Michael Kennedy: Wow, it sounds really fun. It's something I could actually kind of enjoy hanging out there and just being part of that. That sounds fun.

10:50 Nicholas Hunt-Walker: It's great. It's super intensive. Honestly, now that I've taught it, I really wish that I had learned to program this way. It's really directed. When you go through undergrad and you get your degree, you've got to do a lot of ancillary stuff, which is great for being a well-rounded person, but if you're focused on just wanting to do one thing it tends to get distracting. Whereas with this, the goal is clear. We want you to get a job, right. So we're going to train you to be able to do the things that jobs are asking you to do. And that's it. There's no humanities requirements. There's no other paths here. It's just like you're here for a specific reason. If your cause doesn't fit that reason then you want to go somewhere else, but it's directed, it's focused, and it's cheaper than an undergraduate degree, by far.

11:37 Michael Kennedy: Yeah, by quite a bit, yeah in time and money. That's cool. I mean, I'm a huge fan of the liberal arts education. I feel like it's good to be a well-rounded person, but I'm not entirely sure how much college should drive career training, you know? More like be a good person in society and be well informed. Now go learn the thing, right?

11:58 Nicholas Hunt-Walker: Yeah. And I mean it's also good for networking. It's good for expanding your interests beyond whatever you learned in high school. But most of the people that we get are people who are changing jobs, not people fresh out of high school. I've had a few people who were fresh out of high school, but most folks have gone through, they might have an undergraduate degree. I've even had a few people with CS degrees, but they've had a job before. They want to do a different job. They don't need all the ancillary stuff. They just want to know how to do a new job. Which is fine, and we teach them how to do that.

12:27 Michael Kennedy: Yeah, that's cool, that's excellent. Yeah, so let's talk about the four frameworks that you chose and maybe even start with the app, because your idea was, I'm going to build the same app in four different frameworks, right? So what's the app?

12:44 Nicholas Hunt-Walker: Yeah, so the app itself, I tried to keep it as simple as possible while still displaying the aspects of what a web framework should handle. So I chose a to-do list. Which is, you know, everyone knows a to-do list, so it's not much that needs to be explained in that way. So, when I give the talk it's like, hey, you know what a to-do list is. This app does that. With this application, you can add new users through registration. You can login, logout. You can add new tasks, edit existing ones, or complete existing ones. You can even delete them if you want to. And so, that's just kind of the backdrop for investigating how these four frameworks work.

13:19 Michael Kennedy: Yeah, that sounds pretty simple, but actually it touches on a lot of stuff. You've got a data-access layer. You've got a database. You've got forms, 'cause you got to post back information to register. You've got secure-user management. There's a lot of stuff actually going on there.

13:33 Nicholas Hunt-Walker: Oh, absolutely, and I didn't get to go into all of it in my talk. I didn't even get to finish writing all the code, just 'cause time got away from me, but it's not just, I'm going to send some data somewhere and it gets handled, it's okay, how exactly is it being handled, what exactly am I handling, and how is every web framework supposed to be doing it? And so, when I originally wrote this talk it was looking at each aspect of a web framework, across all four, and then I revised it to look at each web framework, one at a time, doing all the things that the app requires. So, I started with Flask, and the setup and installation, and then getting through the configuration, and then how to make a view. So like a view is just a function that handles a request, so an incoming HTTP request, and sends back a properly-formatted response. And the benefit of web frameworks, this is definitely something that my students learn, because I have them build a web server from scratch as part of the course, is that you don't have to worry about a lot of the stuff that goes into building a response or parsing an existing request. There's so many different ways that an incoming request can go wrong, and you don't want to have to think through all that logic, you want to think more about how your app is supposed to work.

14:45 Michael Kennedy: Right you could open a socket and just go to town on that thing, right?

14:49 Nicholas Hunt-Walker: Right, you know splitting strings, and using regex to find different parts of the request headers, and all that stuff, but no one wants to do all that.

14:57 Michael Kennedy: No no no.

14:58 Nicholas Hunt-Walker: Something that's already prebuilt, and people smarter than myself have done it, so why should I do it myself?

15:05 Michael Kennedy: Exactly, and there's people actively working on it. So the four frameworks you chose, you chose Flask, and then Tornado I thought was an interesting option.

15:13 Nicholas Hunt-Walker: Yeah, I had heard about Tornado and I didn't have any idea what it looked like, what it would do, but I heard the word async and I was like, "That should be useful."

15:25 Michael Kennedy: That sounds fun, yeah that sounds really fun, that's cool.

15:27 Nicholas Hunt-Walker: So yeah, I'll dig into it.

15:28 Michael Kennedy: Yeah, and you've got Pyramid and Django, so those are the four. And let's, I guess start, with Flask. It's on the smallish side, right? It doesn't bring a lot to the table. It's one of these micro frameworks. But for your example you still use Flask, Flask-SQLAlchemy and Flask-HTTPAuth, right?

15:46 Nicholas Hunt-Walker: Right, and I have to have those external packages because Flask really is the barest-bones web framework, it's just, you can make a function that handles requests and returns a response, and that's all that Flask does on it's own.

16:00 Michael Kennedy: Yeah, pretty much.

16:01 Nicholas Hunt-Walker: And so if you want to talk to a database, or if you want to do any sort of authentication, you've got to use something else or write your own. So Flask, there's benefits and drawbacks to each of those. So, if you want to use a database like a MongoDB database, you download the package that someone has written, so you use Flask-MongoDB in this system, or you can even just write straight-up queries on your own without using a go-between, and that'll work.

16:30 Michael Kennedy: Right, just write the couple lines of code and sort of piece it together yourself.

16:34 Nicholas Hunt-Walker: Right, and that's something you can do, especially if you only need a very small application, Flask is the way to go. Once you want to start doing more of the classical CRUD application, CRUD being create, read, update and delete functions, you might, you're going to start wanting to move away from Flask. Just because, it can still do those things, but it becomes harder.

16:52 Michael Kennedy: Yeah, you do even more of the legwork yourself. Yeah, so maybe let's go through, we'll kind of go through the same section for each framework. For Flask, let's talk about how do you connect to the database and sort of incorporate that?

17:05 Nicholas Hunt-Walker: Sure, so I'm a fan of the 12-factor application.

17:10 Michael Kennedy: Give us the quick summary on what 12-factor app is, if you can.

17:14 Nicholas Hunt-Walker: Sure, and the way that I'm trying connect to it here is that one of the parts that's important is having your code not change between development and production. Instead, be dependent on your environment and the variables that are set in your environment. So, my application should have the same code running whether it's on my own machine, or on Heroku, or on AWS. All that I'm changing are some flags, like, am I in debug or not? Is my database a local database, or is it a remote database? And so, one of the ways that I do that is I use an environment variable. I call it DATABASE_URL just because I use that everywhere. That's used in several places. One of the places it's used is Heroku, so it makes it very easy for that. So, I use an environment variable called DATABASE_URL to point to my database's URL, and then I use an environment variable called FLASK_APP to point to the directory of my Flask app. And then I put all my working code in the location on my Flask app, that app.py file.

18:09 Michael Kennedy: Yes, you just have the app.py, and basically you can just use Flask-SQLAlchemy, and what is that, set integrated? It creates a sort of a base model, right? If you do SQLAlchemy on it's own, you've got to create the declarative base, and do all of that stuff, and so the Flask-SQLAlchemy kind does a little bit of that work for you, right?

18:28 Nicholas Hunt-Walker: Yeah, Flask-SQLAlchemy takes care of a lot of that work for you. It just gives you this model object that you use that includes the declarative base and all those SQLAlchemy machinery, but just lets you focus on building the actual objects that you want to insert into your database. And it also does a nice thing for you where it includes a method No, I guess it's not a method, it's an attribute on the model object you create, that will talk to the database for you so you can query for one object, like I was saying, object being .query.all, that'll give you all the instances of that object in your database.

18:59 Michael Kennedy: Oh yeah, that's really cool, 'cause otherwise you have to create a session, and then use the session to create the query--

19:04 Nicholas Hunt-Walker: Right.

19:05 Michael Kennedy: Yeah, so it's kind of like a convenience wrapper around the SQLAlchemy stuff, but for the models and everything, you just define them the same, more or less.

19:12 Nicholas Hunt-Walker: Right, you set up columns by declaring columns, you yeah, it's really all, you set up columns by declaring columns. If you want a primary key field, you say this column's going to have a primary key, and it's going to be true, like the primary key flag was true. If you want to set up an explicit table name, you have a table name, attributes that you set in your class, any of the behavior you want to have. It's still a class in Python, so you can still add whatever methods you want to to do special things, but--

19:35 Michael Kennedy: Right right, I find I don't do that often, but a little bit. There's sometimes just a few things you want to compute in Python, related to that entity, and it's like it just needs a property or something here and it'd be perfect.

19:47 Nicholas Hunt-Walker: Exactly, and one of the things that I used that for was... So in my models, I have two models, I have a task model, which is the actual to-do list task, and then I have a profile model, which is the user who has the tasks, and one of the things I wanted to do was, when you register a user, automatically give them the joined, and then automatically give them a secret token they can use to log in and log out with, and that's not handled by SQLAlchemy, and so in the __init__ method I just say, do whatever you were going to do in your __init__ method, but also set these properties on the class.

20:20 Michael Kennedy: Yeah, I really like that. This portion of Talk Python to Me is brought to you by Linode. Are you looking for bulletproof hosting that's fast, simple, and incredibly affordable? Look past that bookstore and check out Linode at talkpython.fm/linode. That's L-I-N-O-D-E. Plans start at just $5 a month for a dedicated server with a gig of RAM. They have 10 data centers across the globe, so no matter where you are, there's a data center near you. Whether you want to run your Python web app, host a private Git server, or file server, you'll get native SSDs on all the machines, a newly-upgraded 200-gigabit network, 24/7 friendly support even on holidays, and a 7-day money-back guarantee. Do you need a little help with your infrastructure? They even offer professional services to help you get started with architecture, migrations, and more. Get a dedicated server for free for the next four months. Just visit talkpython.fm/linode. So then, they also, the Flask-SQLAlchemy, comes with sort of a create_all function that would be the, you go get the metadata, and then do that on the base, right? There's a little bit of a nice utility method there. Then when you talk about view, so in Flask, views are basically functions with a decorator, and they're super-simple, right?

21:39 Nicholas Hunt-Walker: Yeah, absolutely. That decorator is the app.route, so your Flask app is the app object, and everything goes through there, including the routing, and you decorate every function that you want to be a view, with app.route, and you pass as an argument to that decorator the actual route that's going to connect to this view. So, let's say I want to have a home route, I say /home is that route for my decorator. I say, the @-symbol, app.route, and then /home for my route, and then directly in the app, the function is going to be whatever handles that route, so when the home route is accessed, that function will run, kind of like a callback in JavaScript.

22:16 Michael Kennedy: Yeah, the other thing that's interesting about Flask, I think, is this global request object that's kind of always there, right?

22:23 Nicholas Hunt-Walker: That was one of the weirder aspects of Flask. I had never encountered that before using Flask, because typically, with other web frameworks, the request object is populated--

22:32 Michael Kennedy: With a parameter.

22:33 Nicholas Hunt-Walker: Just as a local variable--

22:34 Michael Kennedy: Yeah.

22:35 Nicholas Hunt-Walker: Yeah, it's a parameter in a function, or a method in a class, but it's just populated for that one instance, and it's only usable by that one function unless you pass it somewhere else. With Flask, the request object is a global variable. It is the incoming request, and it's usable not just by your view function, but any function, or any thing that you have in that file, that script file, you could use it to do whatever you want to, and so you can set up background tasks if you want to, using that request object without any actual reference to your view.

23:06 Michael Kennedy: Yeah, and that's kind of funky, but it also makes it pretty easy. I had the guys that did Quart, the guy who did Quart on, and Quart is an async-ified version of Flask, and this type of stuff was one of the things that made making it async really challenging, because how do you control when the request thing points at the right one, and then you release the thread, another one runs. It gets a little tricky.

23:32 Nicholas Hunt-Walker: Yeah, I have no idea how that would work, honestly.

23:36 Michael Kennedy: It took some crazy monkey-patching from what I understand.

23:38 Nicholas Hunt-Walker: Good God. I mean, it's certainly possible, and I'm sure there's use cases for it, but I can't imagine the mess that must be under the hood when you're trying to do that.

23:46 Michael Kennedy: Yeah, it gets interesting. All right, speaking of interesting, the one that is the most out there, of the four that you chose, I think is Tornado. I'll just read the quick summary for Tornado that they put on their website, the paragraph, so: Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed, which is some interesting early social media, for non-blocking network I/O, right, so it says it scales to tens of thousands of open connections, and makes it ideal for long polling, WebSockets, so on. So, if what you're doing is waiting on stuff, I'm calling web services, I'm calling database things, and I want to not block up my web's tier when that happens, Tornado's pretty cool. There's other options that are more modern, but this a really popular one.

24:31 Nicholas Hunt-Walker: Yeah, definitely. Yeah, Tornado is useful for if you want to have a long-lived connection, or if you want to do anything that requires some long-running input/output. This particular use case, this to-do list, is not the best place for Tornado to be used. You don't need to do async stuff with Tornado. You can use it just like a Flask, or like a Django. It'll work the exact same way. It just handles requests and sends back responses, but if you do have a long-running task like a database query that's going to take a while to aggregate some data, or maybe you need to send a request to somewhere else, you can set up your views as co-routines that'll run in their own time, and still free up the web service to handle the request or do other operations, and it's really cool that way, and it's actually fairly simplified, where all you really need to do is know exactly which part of your code you want to or which will be long-running. You set that up as being what's called a future object, something that's going to be running in the future, and set up the method as being a co-routine. Tornado will handle all the rest. You don't have to worry about the event loop. You don't have to worry about most of the other asynchronous issues. It's just done for you.

25:40 Michael Kennedy: Yeah, and so you're using SQLAlchemy here as well, and what gets interesting is, SQLAlchemy itself is not async-enabled, co-routine-enabled, or things like that, so you have tornado-sqlalchemy, which lets you do that, right?

25:55 Nicholas Hunt-Walker: Mm-hmm. And the way it does it is by setting up a context object, where in that context you have access to this session, and then whatever you would do with that session gets handed off as a task to your async event loop, and so you hand it off to the event loop, your event loop continues to run, and you're not necessarily waiting for that process to finish before you handle your next request, it's just that when that process does finish, and the event loop is aware of that, then that response to that specific user is sent back as it needs to be sent back. The thing that it's not doing for you is, if you have some long-running computation, that's not going to be handled by Tornado. It's really just for input/output from some external service or from some client.

26:42 Michael Kennedy: Right, exactly. You've got to have one of those things to make a future and wait upon it, right, and if that's just compute is just going to block up the same thread anyway, so--

26:49 Nicholas Hunt-Walker: That's an interesting thing. I was never actually trained in understanding async and so--

26:54 Michael Kennedy: It's pretty mind-bending, the more you dig into it.

26:57 Nicholas Hunt-Walker: Yeah, it really is, it really is. It was interesting, and this goes back to PyCascades, where I had kind of dipped my toes into it with Tornado, but I was like, "Oh, I don't know that much. I know I can decorate this method with a co-routine, it'll make it a co-routine." and then I got the privilege of being able to sit next to Guido during the speakers' dinner after the first night, and he talked to me for a while about how async works, and I still didn't quite fully grasp it, but it was really interesting in how Python is still being a single-threaded process, but it's handing off tasks to be working in the background, and then I had tweeted about, okay I'm really going to be serious about learning about this async stuff, and he tweeted back at me, and he was like, "Hey, you want to check out this book," and it's been great thus far. I've read been reading I've read through this just one chapter in this book about twice now. I'd say my understanding's at about 25% level.

27:48 Michael Kennedy: That's awesome. What was the book he recommended?

27:50 Nicholas Hunt-Walker: It was, let's see if I can, I don't have it on this machine, do it? Let's see. I'm going to look for it, and if I find it I'll send it to you.

27:58 Michael Kennedy: Yeah, we'll put it in the show notes, or something like that. Yeah sure.

28:00 Nicholas Hunt-Walker: Absolutely, but it's an open-source book about there's various chapters about the architecture of software.

28:06 Michael Kennedy: Oh, is it the one where they build all these different things in 500 lines of code or less?

28:10 Nicholas Hunt-Walker: Yes, that's what it was.

28:12 Michael Kennedy: Is it the article with Jesse Davis and Guido's article, maybe?

28:15 Nicholas Hunt-Walker: Yes, that is the exact one.

28:17 Michael Kennedy: Yeah, that's a good one. That is a really good one, uh-huh.

28:20 Nicholas Hunt-Walker: A web crawler with async I/O co-routines, and it actually builds up what a co-routine is from ground level. It starts with your blocking sockets, and then it's still sockets, but non-blocking sockets, and then it goes to an actual web crawler using co-routines, and it's pretty awesome.

28:37 Michael Kennedy: Yeah, that's a really cool one, and I love the 500 lines or less aspect of it. That's pretty cool.

28:41 Nicholas Hunt-Walker: Yeah, and for being 500 lines or less, for such a complex topic they do a really good job of explaining what async is, and how it's supposed to work in the context of Python.

28:49 Michael Kennedy: Yeah. Yeah, that's really cool. All right, so we've got these async co-routine view methods. Are they methods, or are they classes in Tornado? I can't remember.

28:59 Nicholas Hunt-Walker: So, the views themselves are classes, and you connect the views to routes in Tornado's central Application object. You can have multiple applications running at the same time, which goes back to that event loop thing. You can have, in your one Tornado project, four or five applications running at the same time, handling different things, if you want to, but the actual method that gets run depends on what kind of requests that come in. So, you know that you have several types of HTTP requests, you can GET, POST, PUT, DELETE. Those are the main ones. There's other, like HEAD and OPTION, or whatever, but no one really uses those, and then there are corresponding methods for those. So, when an incoming GET request comes in, whatever code that I've written for the GET method will get run for that request, and then the response is built from that request, from that method, and sent back to the client.

29:43 Michael Kennedy: Yeah, that sounds really cool. So, the sort of fundamental building block in Flask is you have a decorated function, and the fundamental building block here is, I have a class, one URL points at it, but it can have different methods for the various HTTP verbs. So, it's a little RESTful in that sense.

30:00 Nicholas Hunt-Walker: It's a little RESTful in that sense. It works really well for RESTful API, and the benefit of having it be a class is that you can set some instance attributes to only run for that one class, for that one type of request. You can think of them as semi-global things that only apply to that class, and you can have other methods in that class that work just for that class and whatever you want to do with those methods for those specific kinds of requests, in this particular case the to-do list. I add some methods to some base request handler for constructing responses for steady default headers, for converting incoming data from POST requests into Unicode, 'cause they come in as bytecode instead sorry, byte streams instead. And it's really simple. It's just a method and a class.

30:46 Michael Kennedy: Yeah, that's cool. I find that that's a really nice design pattern, 'cause there's probably like five or 10 things every web method wants access to, and if you put that in a base class and bundle it up, that's sweet.

30:56 Nicholas Hunt-Walker: And now it's very simple to do.

30:57 Michael Kennedy: Yeah, cool. And then, for the SQLAlchemy, even though it's the tornado-sqlalchemy, you still basically define it exactly the same, right? Declarative base and all that?

31:05 Nicholas Hunt-Walker: It is almost the exact same thing as Flask, in fact when I had first written the project, I wrote it in Pyramid, and then when I was going through Tornado, I was like, "Oh, you could just copy and paste everything over from Pyramid into Tornado, and copy and paste everything over from Pyramid into Flask, 'cause it's all SQLAlchemy under the hood."

31:22 Michael Kennedy: And that's one of the things I like. If you have an ORM, or I use Mongo a lot, so an ODM that you really like, they kind of are portable, right? You've learned the data part... It's almost like the 12-factor app idea that you were talking about. You understand this part of your architecture independent of the framework, right? The pieces, you put them together, they're not locked, and they're not one and the same like, say, Django, which we'll get to in a second, right?

31:48 Nicholas Hunt-Walker: Right right. Well yeah, that's the benefit of using things like Pyramid, or Flask, or Tornado. They're similar in the way that there is some basic framework, but all the rest is just building. It's just Legos. It's all the same stuff.

32:00 Michael Kennedy: Nice. So, let's move on to Pyramid. I think Pyramid lives somewhere in between Flask and Django, maybe a little closer to the Flask world, but I really like their philosophy there, the start-small, finish-big, stay-finished framework, and they say their philosophy is, it should be very quick and easy for you to learn to start with a web framework, but the stuff that you need, as it grows more complex, is just there, and so that's kind of a nice philosophy, I think.

32:26 Nicholas Hunt-Walker: One of the things that was nice about Pyramid is that... So, I used the Cookiecutter template for building a Pyramid application, where Cookiecutter is a separate Python package that you download, and then you point at a repository to copy over some files for you to build your application. There are Cookiecutter templates for Flask, Tornado, and even Django. I didn't know how to use those as well as I knew for Pyramid, so I just used the one for Pyramid.

32:50 Michael Kennedy: Yeah, it's the official way to get started with Pyramid, where the others, you theoretically could use Cookiecutter, but it's like, there's some other sort of official starting point.

32:59 Nicholas Hunt-Walker: Yeah, and actually so, it's interesting that you say that, because when I first started teaching Pyramid almost two years ago, Cookiecutter was not the way to do it. I was using Pyramid 1.8.

33:07 Michael Kennedy: Right, it was pcreate.

33:09 Nicholas Hunt-Walker: Yeah, it was pcreate. When you install Pyramid, it installs for you a command, it's actually still there in the current version of Pyramid if you still want to use it.

33:16 Michael Kennedy: I think it delegates to, it just, it's a wrapper around the Cookiecutter now, I think.

33:20 Nicholas Hunt-Walker: Oh is it? I haven't actually looked at it.

33:21 Michael Kennedy: I think so. I'm not entirely sure either.

33:23 Nicholas Hunt-Walker: Ha, that makes sense. Okay, cool. But yeah, the pcreate command would say, "Okay, you want to create a Pyramid application. You want to do certain things, and there are various templates you can use." The basic Pyramid template says, "Okay, you have some main function, which is your main configuration. Maybe you want to hook up some views. Maybe you want to hook up some routes. Whatever, we got you." With the SQLAlchemy Cookiecutter template, it says, "Oh, you want a database. Well, instead of having you write your own, because we know you don't know what you're doing, we're going to we're going to give you a script for initializing your database. Here it is. It's called the initializedb. It does exactly what you think it's supposed to do without you worrying about the actual implementation details." One of the things that I wish they had was an Alembic template. Maybe they have one now. I haven't checked in a few months, but that'd be cool too, because one of the things that's hard to teach when I'm doing Pyramid is, you can actually, if you know how to use Alembic, you can set up these things called migrations, which are snapshots of your model as you change it over time, and that's a lot easier and better for production than just destroying it all and rebuilding it from scratch every single time you want to make a change.

34:31 Michael Kennedy: Yeah, the migrations are where that gets tricky, and so if that were built in, that would be sweet, right?

34:36 Nicholas Hunt-Walker: Yeah, and I'm sure that at this point in time someone's done it. I just haven't looked.

34:40 Michael Kennedy: Maybe. I mean, one of the things that you could do for your courses is, you could take one of these Cookiecutter templates and make one that's a little more focused on what you guys are trying to end up with a end goal. Like I have my Python for Entrepreneurs course, which has just a crazy amount of different things brought into it, like Bootstrap set up in a certain way, and all sorts of templates, and so I actually created a Cookiecutter template that is the... If you wanted to take what we built through the 20-hour course, and start a new project from it, you would just run that new Cookiecutter template, and you would start, basically, at the end of the course.

35:13 Nicholas Hunt-Walker: Yeah, that's awesome.

35:14 Michael Kennedy: Yeah, it's really fun.

35:14 Nicholas Hunt-Walker: That's a great idea.

35:15 Michael Kennedy: Yeah, it was really like you teaching the same thing. It's similar things. You could help yourself by tweaking one of these and forking it.

35:23 Nicholas Hunt-Walker: Yeah. Actually, that might be a thing that I do in the future. I have been trying, as I've modified the course, so, it's worth noting that I wasn't the one who created the course. The course was created by this awesome guy Cris Ewing, great developer, great friend, extremely smart, and he created the course with Pyramid in there. He had done Flask before, but he decided to do it with Pyramid instead, as it's kind of a more-basic web framework that could do a lot, and his idea was to not have the things that they learn be too heavily tied to just the course that we teach, because when they get out in the real world, they need to be able to understand what's happening, and not just fall back only onto what we talk about, but be able to build up from scratch whatever they need to build up for whatever job they have. The benefit of using someone else's Cookiecutter template is that someone else has done it, it's more likely to be used widely if someone's building a project, and they can kind of just get direct they can feed directly into that pipeline, but I think, now that you mention it, I'm going to see if there's an Alembic template out there for Pyramid, and if there isn't one, I might actually try to write one.

36:30 Michael Kennedy: Yeah, it'd be really cool.

36:31 Nicholas Hunt-Walker: It would be useful.

36:32 Michael Kennedy: Yeah, I don't mean to derail you, but I do find these Cookiecutters are really interesting to roll with. So, this is how you could start it in Pyramid, and I would say that in terms of views, the default, fundamental building block is very much like Flask, right?

36:44 Nicholas Hunt-Walker: Oh yeah, it's just a function with a decorator. The difference between Pyramid and Flask is that your decorator... So your routes, in Pyramid, are separate form your views. They are just a listing of routes, and you can put them in a separate file. You can put them in your main configuration directly, and they have a name. So, again, the home route would be called home, and then the actual pattern that's supposed to be matched to go to that route, and then your view has this view_config decorator, where you say, "Okay, here's the name of the route that I want you to connect to. Here's, also, the way in which I want you to render the response of this view." You can have several options. One of those is JSON, so I could take my response, like if I pass a dictionary to my return value, then my response will just be a dictionary, and that's JSON serializable, or I could make it use a template, like a Jinja template, or a Chameleon template, or any other template system that I want to, and just pass my response to that template, and Pyramid will build a response for me and send it back to the client.

37:42 Michael Kennedy: You could also go with the Tornado style, and create these handler classes that get one URL. They're called view classes, I think, and you can create handler classes. There's a whole bunch of different ways, and I think that's one of the challenges of Pyramid. It's the framework I like most. My web apps are built in it, but I do feel like there's all these different ways to do the same thing, so I'm never sure, like, am I doing it the best way, or I'm just doing it the way that I know? You know what I mean?

38:08 Nicholas Hunt-Walker: There's always a better way. It's more a matter of... My students often come to me with the question of like, "Is this best practice? Is what I'm doing best practice?" And my response is always, "Well, best practice is oftentimes just defined by the person who's paying you. What do they want?"

38:24 Michael Kennedy: It's a trade-off too, right? If I'm building Google, I'm making different trade-offs than if I'm building a small hotel's website. A best practice for Google is wasting money for the hotel, and vice versa.

38:37 Nicholas Hunt-Walker: The point there is that it always comes down to your use case, right? If your use case would be better served by using class-based views, and having the mixin pattern that Django has, then that's your best practice, but if your use case is better served by a function, then use the function and be okay with it, as long as the thing works. That's what matters more, is that the thing that you're building works, and then you can optimize as you need to for your specific use case.

39:05 Michael Kennedy: Yeah, for sure. All right, so you brought up Django. Let's move on to Django. So the summary there is it's a high-level Python web framework, and it encourages rapid development and pragmatic design. So, it comes with lots of pre-built stuff, and the building blocks are kind of large. They're more like Duplo rather than Lego building blocks, I like to think of them as, right?

39:27 Nicholas Hunt-Walker: Exactly. I mean, I would even say they're more like, if you know Power Rangers, where the robots come together to make one larger robot. There's still machinery in the individual robots, but their job is not to be inspected individually. Their job is to make one larger conglomerate, and one of the things that Django doesn't say in their description is that it is extremely opinionated about the way that things should be done, and so, yes, there are function-based views in Django. There's a whole class-based views in Django. There's the ability to talk to a database in Django, but the database you're talking to should probably be a SQL database, and the way that you build models in Django, at least through the tutorials and the documentation, assumes you want rows and columns. There are ways to incorporate a thing like Mongo into a Django application, but that takes a lot of extra legwork that you may not want to do.

40:19 Michael Kennedy: You're kind of fighting, you're going against the grain a lot of times, even though it's possible, I feel like.

40:24 Nicholas Hunt-Walker: Django, it encourages rapid development as long as you want to do things the Django way, which is oftentimes a good way to do things, but if you want to go outside that norm, you're going to have to pull apart some code to do that.

40:36 Michael Kennedy: I think Django is good. A lot of people use it. It certainly seems to be super-effective for people who want to kind of get started quick and stuff. I personally lean more towards a microframework, 'cause I want to pick that little data access layer, and that little bit over here, and just put it together, but I think that's just my personality.

40:56 Nicholas Hunt-Walker: Yeah, but if you want to start quick and build big to start, then Django's pretty much the way to go.

41:02 Michael Kennedy: Yeah. So, in here you design the models differently, in a similar but different way, 'cause you use the Django ORM, not the SQLAlchemy style, right?

41:11 Nicholas Hunt-Walker: Well, the SQLAlchemy style has you inherit from this thing called the base. It's actually fairly similar. With Django, when you're building a model, you inherit from Django's own base model, which handles the database interaction layer for you, and then, instead of having columns, or column objects, you have field objects, but it's still the same thing underneath. One of the benefits of using Django's fields is that there are some specific keyword arguments you can set for specific fields. One of my favorites is the auto_now_add, that comes with the DateTimeField, which says when you create a new instance of this object, then I'm going to just set the datetime on for now, whatever now is, that's the datetime on this field.

41:48 Michael Kennedy: Yeah, and you could do that with SQLAlchemy, but it's easy to make mistakes on it, right? Like you could say, instead of saying the now function, you say now with parentheses, and you get every model is marked at the time when the app started , funky stuff like that.

42:03 Nicholas Hunt-Walker: Exactly.

42:04 Michael Kennedy: One thing that's always kind of put me off on Django is the way you define URLs is regular expressions. That's always sort of driven me crazy.

42:13 Nicholas Hunt-Walker: Yeah, I mean, to a degree you do that in Pyramid as well if you want to have any variable routes.

42:19 Michael Kennedy: Right. If you want to, as you say, this can only be an integer here, right? You say the variable name, but if you want to constrain it, then it's a regular expression.

42:26 Nicholas Hunt-Walker: Up through Django 1.11. I'm not sure if that's still the case in Django 2, actually, because the have the pattern now.

42:31 Michael Kennedy: They changed it. They changed the new pattern to make it a lot nicer.

42:34 Nicholas Hunt-Walker: Up through Django 1.11, which is what I built the app in, you have to have a specific regular expression to be matched for your pattern, and the way that you the whole pattern itself is a regular expression, not just the variable part. Whereas with Django 2 now, it's a little bit more natural, a little less nuanced for just regular expressions. You can still do the old way if you want to, but they're encouraging you to use the new pattern that isn't a regex, unless you absolutely need it.

43:00 Michael Kennedy: Yeah, so instead of having a regular expression for the integer, you just say, angle bracket int colon. Ah, so nice.

43:10 Nicholas Hunt-Walker: Right, but if you want an integer that must be four numbers long, then you want to get more into doing regular expressions.

43:18 Michael Kennedy: Yeah, that's cool. All right, so you went through this whole experience. You've went through these four frameworks, and to be honest, you've just scratched the surface. There's a bunch more web frameworks. There's Bottle, and there's web2py, and there's--

43:32 Nicholas Hunt-Walker: There's CherryPy, there's Twisted, there's--

43:33 Michael Kennedy: Sanic, and CherryPy--

43:35 Nicholas Hunt-Walker: There's Hug, which is apparently a web framework.

43:40 Michael Kennedy: Which is based on Falcon, which is another web framework. It's like, "Oh my gosh." So, just to, like on one hand, this is just a sampling, but it is a sampling of the major elements of the Python web frameworks. So, what are your takeaways here?

43:54 Nicholas Hunt-Walker: My takeaways here, for these four specifically, 'cause I just didn't have the time to dig into any other ones--

43:59 Michael Kennedy: Well, and it's a talk. How many more could you have actually presented in 35 minutes, right?

44:04 Nicholas Hunt-Walker: Right. I mean, when I gave my talk, I had 25 minutes, and even with just these four, and with just a little bit of detail that I gave for each one, I still ran over time, and had to get cut off toward the end.

44:15 Michael Kennedy: They're shaking that red thing at you, like, "Oh, you're over time!"

44:18 Nicholas Hunt-Walker: Yeah, exactly, but my impressions were as follows. For Flask, Flask is good for small tasks, or tasks that don't require a database. You can still do a database up with Flask, but it becomes harder. So, if you're going to start small, and stay small, and be simple, Flask is the way to go. It's really quick to get up and running. It's really simple to put together, and you can think more about the actual implementation of some of the logic you want to do. Pyramid is great if, as the slogan says, if you want to start small but you anticipate getting larger. Pyramid is great for that. If you anticipate getting larger, and you still want to know what's going on, you want to have a hand, and you still want to have that do-it-yourself feel, Pyramid will give that to you, but it'll also hand you some of the pieces to work with so you don't have to do too much thinking for yourself. Tornado is kind of like an in between, between Flask and Django. It can do Flask stuff if you want it to do Flask sort of stuff. It can Django stuff if you want Django sort of stuff, but it's specifically good for any sort of asynchronous work you want to do. If you want to build a chatroom, that's good for Tornado. If you want to have access to more of the bare networking layer of a web framework, Tornado's good for that as well. Django is, if you want to build big and stay big. If you anticipate a lot of complexity, and you don't want to have to think too much about the details, you want to think more about how it's supposed to all fit together, Django's good for that.

45:43 Michael Kennedy: All right. That sounds pretty good. What other frameworks were you thinking about, or have you thought about, that maybe we sort of touched on them a little bit, but what else did you consider for this list?

45:54 Nicholas Hunt-Walker: I was thinking So it's interesting. One of the things that I only noticed after I had started teaching about web dev is that we use Jupyter Notebook, which is a popular data science tool for displaying your analysis, displaying your code. When you install Jupyter Notebook, in fact let me just check installing it right now. When you install Jupyter Notebook, one of the dependencies is a web framework, and that web framework is Tornado. I think in the past it might have been Twisted, which is another asynchronous web framework. I didn't get a chance to look into it. From what I understand, it's a little twisted for writing, but yeah, that's another web framework that I kind of wanted to get into. I had seen web2py but never actually used it. My friend Cris Ewing, he's a big proponent of KLone, which is an older web framework, where Pyramid learned a lot from what KLone used to do. It's still around.

46:41 Michael Kennedy: Yeah, it's almost like the next generation of PLone, almost. The same people seem to work on it and stuff, yeah. It's got some same idioms.

46:48 Nicholas Hunt-Walker: When I started to do web dev, I had started with WordPress, and this is a long way from WordPress, and I'm glad I didn't have to go through WordPress again.

46:57 Michael Kennedy: Yeah, that's cool. Those are all interesting ideas. I guess the other ones that kind of capture my imagination now are the async/await enabled Python 3 ones like API Star, Sanic, Japronto, Cort. They're sort of the Python 3 only ones that are pretty interesting.

47:15 Nicholas Hunt-Walker: I think I might look into those then, because I've kind of really had the fire lit under me for async. I feel like it doesn't need to be this esoteric thing. It's a pattern in Python, and it should be learnable.

47:27 Michael Kennedy: Yeah, it definitely should be learnable. I think, well, you and I are teachers on one aspect of what we do, so we can work on that stuff, right? We can build it out for people. Yeah, awesome. So, I want to throw an idea out there that I just had while you were doing this, that would be amazing, that you could build for the community. You may be busy and not interested, but it would be amazing if there was a website whose job was to have these comparisons, and somehow if it was open to PRs, like somebody was like, "Oh, I want to submit an API Star version of the same app to you." That would be a killer community resource, if it was available for the community to write this app, and sort of write an article for every framework that existed.

48:08 Nicholas Hunt-Walker: The GitHub organization that holds all four of the web frameworks is there. I'm perfectly happy to have PRs for that.

48:15 Michael Kennedy: Yeah, that's actually a pretty good starting point, isn't it, so we'll be sure to link to your repo for this in the show notes so people can-- Are you open for people to do PRs for you, to do another one?

48:24 Nicholas Hunt-Walker: Sure, oh yeah.

48:26 Michael Kennedy: All right. So, we talked about the web frameworks. We talked about your bootcamp. What else have you got going on that you want to chat about, that you'd like to let people know about?

48:36 Nicholas Hunt-Walker: Yeah, absolutely. If you're in the Seattle area, the meetup group PuPPy, Puget Sound Programming Python, is really awesome. I've been lucky enough to be involved with them for the last about year and a half or so, and they're really open to new people, to new developers. In the last year or so we started it. We have a Slack channel. We've started the Q&A channel in the Slack team for people to just ask questions. We kind of have our own little Stack Overflow going in there, and also just random stuff. Pretty much whatever interests you have, the organizers, Don and Alan, two of the people who helped put together PyCascades, they're always open to new ideas, to fresh ideas, to people who want to get more involved. So, that's been cool to be a part of that. I've been really lucky there.

49:15 Michael Kennedy: Yeah, that's really great, and PuPPy seems like a good organization. What was surprising to me is how many people from Seattle and Portland we met in Vancouver. We left the country to meet people just down the street.

49:27 Nicholas Hunt-Walker: It's time and opportunity, right? The conferences bring people together, but when you're at home, you have your work schedule, you have your home schedule. I have a kid. I can't even go out that much anymore.

49:35 Michael Kennedy: I know, I have three kids. It's like, "Go out at night? What are you talking about." It's super-rare that I can go just hang out at some tech evening event 'cause my wife's teaching or something. I got to be home.

49:44 Nicholas Hunt-Walker: Right, if I'm going to go to PuPPy, I need to know like two months in advance, so I can warn my fiancee, I can warn her again two weeks later, and warn her again two weeks later after that, that I'm going to be going to this thing. We have to get a sitter, or you have to stay home. Something's got to happen so we can-- There's a lot of logistical stuff going on in there.

50:04 Michael Kennedy: Right, but you go to a conference, you've already stepped away from that. You've created that space, and so it's easy to meet people, right?

50:10 Nicholas Hunt-Walker: I'm here for this one specific reason: just learn about Python and meet people, so that was cool, and actually, through PuPPy, one of the things that I'm trying to do in the coming year is to be more of a mentor. I've been the beneficiary of some really awesome people who have been mentors in the short term or the long term, to give me advice, every once in a while give me some advice, or help me deliberate through a process, and I kind of want to give that back to the community, and so, as a teacher for the last two years, I've been able to graduate about 100 or more people from the Python program, and I kind of want to get back in touch with those people and kind of figure out what they're doing, what they're working on, where they're headed in their careers. Maybe, if I can, even if it's not a mentorship position, more like an accountability partner, help them move forward through their careers, 'cause I like being able to have a hand in developing talent in the same way that people helped me develop my talent.

50:56 Michael Kennedy: It doesn't take a lot of effort on somebody who's experienced, on their part, to just give a little bit of guidance, because when you're new you just look around, and it's even It gets worse every day. There are more frameworks. There are more languages. There are more libraries. You're like, "I have no idea what to do. I know I want to learn this stuff, and I want to accomplish this, but where do I start, right? How do I go about this?" And so, you can give them some guidance.

51:17 Nicholas Hunt-Walker: It goes beyond that, too. It's like, "Well, I never thought about giving a talk at a conference, or, I never thought about giving a talk at a meetup." I hadn't though about giving a talk at a meetup until my friend Cris said, "Hey, you should give talks at meetups." and I was like, "Oh, I can do that. That's a thing that I can do."

51:32 Michael Kennedy: Yeah, there's no gatekeepers. You just have to decide that you can do it. Then you can do it.

51:35 Nicholas Hunt-Walker: Exactly, exactly. There are going to be some things that I'm aware of, that people who are my former students are not aware of, like if it's a panel going on, like, "Hey, you should be on this panel," or, "You should attend this panel," or, "You should meet this person," "You should go to this coffee meeting, and see these people, and be aware of these concepts, of these environments." because I've been in a lot of different spaces in the last, let's say, 10 years or so, and what I've noticed in each of those roles has been that most of the work is just being in the right place at the right time, or meeting the right person at the right time. If you never meet that person, or if you're never in that place, you don't even know that those opportunities are there to be taken advantage of. I've been able to make some great contacts at Facebook just by going to a hackathon once, and chatting up one of the organizers of the hackathon, or Twitter has been an amazing resource to meet people, see what they're into, learning about other things going on in the field of Python development, just being aware, being around, and being able to help new people get into that community.

52:39 Michael Kennedy: Yeah, I find that a lot of these little hands that you offer to people to help them actually come back in unexpected ways, and there's a lot of karma in the world, in that sense.

52:49 Nicholas Hunt-Walker: Oh absolutely, absolutely. I never would have gone to my first conference as an astronomer if my advisor never told me about that it existed, and then I wouldn't have met the person who introduced me to Marcel Agueros, who runs the Bridge to the PhD program at Columbia, and if I'd never gone to that, I would probably never be here in Seattle doing Python instruction at Code Fellows because I never would have gone for a PhD, and you know, and so there's so many things in the chain of events that could have gone a different way if I hadn't just been in the right place at the right time, or talked to the right people.

53:17 Michael Kennedy: I think the big takeaway here is, you can't deeply overthink these little variations, because your life could be so different, just sort of chaos theory, right, butterfly wings type of thing.

53:28 Nicholas Hunt-Walker: Absolutely.

53:29 Michael Kennedy: Yeah, cool. All right, well I think we're getting close to the end of our time together. Let's let me hit you with the two questions that I always put at the end. So, if you're going to write some Python code, what editor do you open up?

53:40 Nicholas Hunt-Walker: My first instinct is Sublime Text, but I've been going more toward Visual Studio Code in the last week.

53:45 Michael Kennedy: Okay, yeah nice. Visual Studio Code with a Python plugin is quite nice. I use Visual Studio Code for if I just want to open up one file and stuff. If I'm doing a big project, I usually use PyCharm, but I definitely like Visual Studio Code as well. All right, and then notable PyPI package.

54:00 Nicholas Hunt-Walker: I love the Requests library. I also love BeautifulSoup, and then pandas. When I was a researcher, pandas changed my life: how I did research, how I did analysis. I was using NumPy and NumPy arrays, pandas all the way.

54:12 Michael Kennedy: Oh, that's awesome. Yeah, pandas is really, really cool and important, and to me, Requests and BeautifulSoup literally feels like magic, like there's this web page with stuff, and then I write like five lines of code, and then I have it in structured data on my machine. I'm like, "That just blew my mind that that just happened." right? It is really cool. All right, so final call to action. People are excited, maybe, about checking out these web frameworks, your project, or maybe even your bootcamp. What do you say?

54:40 Nicholas Hunt-Walker: If you want to talk to me, the easiest way to reach me is on Twitter. It's just @nhuntwalker. I'm on there literally all the time, probably more than I should be. If you're interested in learning how to code, Code Fellows is a dope place if you're in Seattle or in Portland. Code Fellows, great place to learn JavaScript, Java, C#, or Python. We have some really dedicated instructors who are really they're really focused on getting people into careers as best they can.

55:04 Michael Kennedy: All right, awesome. Well Nick, it's really been great to share the four-framework comparison with you, and the stories. Thank you so much for being on the show.

55:11 Nicholas Hunt-Walker: Thanks for having me. I hope this was helpful to somebody.

55:13 Michael Kennedy: Yeah, I'm sure I will be.

55:14 Nicholas Hunt-Walker: All right, bye.

55:15 Michael Kennedy: Bye. This has been another episode of Talk Python to Me. Today's guest was Nicholas Hunt-Walker, and this episode has been brought to you by Linode. Linode is bulletproof hosting for whatever you're building with Python. Get four months free at talkpython.fm/linode. That's L-I-N-O-D-E. Are you or a colleague trying to learn Python? Have you tried books and videos that just left you bored by covering topics point by point? Well, check out my online course Python Jumpstart by Building 10 Apps at talkpython.fm/course to experience a more-engaging way to learn Python, and if you're looking for something a little more advanced, try my Write Pythonic Code course at talkpython.fm/pythonic. Be sure to subscribe to the show. Open your favorite podcatcher and search for Python. We should be right at the top. You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm. This is your host, Michael Kennedy. Thanks so much for listening. I really appreciate it. Now get out there and write some Python code.

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon