← Back to Show Notes

Transcript: Python at Microsoft - Nina Zakharenko

Welcome to another episode of Django Chats, a weekly podcast on the Django Web Framework.

I'm Carlton Gibson, joined as ever by Will Vincent. How are you, Will?

I'm great. Hi, Carlton.

Hello, Will. And today we've got Nina Zakalenko with us. Hello, Nina. How are you?

I'm doing great. Hi, Carlton. Hi, Will.

Hello. Thanks for coming on. So, Nina, we always ask this. It's a good opener. Can you

tell us a little bit about yourself how you got into programming how you found python and django

and you know what's your backstory what's your origin story my superhero oh there we go uh yeah

um so i've always been interested in computers from a young age i started uh hacking together

my first websites on geocities probably around the time when i was 12 or so and i had more of

traditional background. So I went to college for computer science and kind of went went through

that whole misery to start my development career. Super. Yeah, I have I have a ton of pop quiz

knowledge about things that have not been helpful to my career at all. Well, neither of us have

degrees. So we, you know, empathize with that. So I started out my career doing enterprise Java

and working for large financial institutions.

And it took me a bit of time to realize

that that was horribly boring

and not how I wanted to be spending my days.

And I kind of thought about what technologies

the companies I did want to work for were using.

And Python seemed to be a common thread.

I heard great things about the Python community.

And so at some point,

maybe about five to six years of Java under my belt, I decided to switch to Python. I had a

really hard time teaching it to myself on the side because it was just really hard conceptually for

me to switch from using a compiled language full-time to something dynamic like Python.

And so I quit my job for three months and I went to hacker school, now known as the Recurse Center,

which is kind of a self-directed writer's retreat for programmers.

And I taught myself Python over three months and then kind of haven't looked back since.

Recourse Center sounds amazing.

I mean, at any stage in your career, I think the chance to spend a couple months

just learning and having some colleagues.

I mean, I'd like to do something like that right now.

Yeah, it was fantastic.

I recommend it to everyone.

And I went completely broke in the process because a lot of folks who had gone through

the program had spent a lot of time planning for it.

And for me, I was just like, I'm really sick of what I'm doing.

I did not plan for this.

But I think I need to go and make it happen.

But, you know, kind of equaled out in the future.

And then you made your way out west from there, right?

I think I first heard of you in the context of some of your Reddit work.

And I remember it being like, oh, Salt Lake City, there's awesome skiing out there.

I didn't know there was tech out there, though obviously people know there's tech out there now.

Yeah, they call it the Silicon Slopes, which I think is pretty cute.

When you go and visit, you're like, this is perfect.

I got to go to Park City for the first time last year, and you fly in, and 40 minutes, you're there.

Yeah, so I moved from New York City to Park City, and it was a shock.

Oh, you were in Park City?

Because they say, right, you can leave Boston or New York in the morning, and with the time difference, you can be on the slopes by noon, which is actually true.

I did learn two things. Park City in the winter, I think, has a population of 21,000 people. But in the fall, when I had moved there, I think it was between 5,000 and 7,000.

so i moved from one of the biggest cities in the world to a tiny tiny city and it was

i i it took a lot of adjusting uh i'll say that but uh but i mean it's not the middle of nowhere

right you've got the olympic training facility there i mean i use the like the community like

gym there when i went out there i i had to take a shower and it's like the nicest

gym i've ever seen after two months you've kind of you've done all the things uh and

what i learned from living there yeah you know the people you see the same people everywhere

i learned that the skiing in park city was actually not that good and uh big big and

little cottonwood was where it's at so snowbird and and alta yeah yeah and brighton and so i would

drive from park city to snowbird to ski like an amateur and i i moved the following year but uh

yeah lesson learned okay that's a nice little interlude there so i know you need a phone like

um you're massive on twitter you're massive at the conferences you've got all these courses

you've got talks you've got things so can we talk through some of the the things you've done there

so you know one thing i want to talk to you about is your django con talk from um last year where

um about debugging was it goodbye print hello debugger was the yeah and it's just

fantastic you know um i'll just i'll just rant for him a little bit about why i loved it so much

and then you can perhaps just spin off from there but you've been using the debugger for years and

then all of a sudden you just go oh you know and did you know you can use this little interact

command and then you can pull up an ipython debugger and it's like no why didn't i know this

so anyway i've been using that that's been my new hammer ever since um so i want to say thank you

for that but perhaps you can talk a little bit about your talk tell us tell the listeners and

we'll link to it in the show notes and things yeah i'd be happy to i'm actually in the process of

recording a new and improved version of that talk for pycon us it's going to be released on the

virtual pycon 2020 youtube page okay oh great so that should they'll probably be out when this

comes out um so yeah i know quite a few senior engineers who still use the print statement to

debug and to troubleshoot and um my goal with this talk was really to show people that the debugger

is not scary because i think a lot of people's first introduction to it is just like oh this

is a lot of text there's an arrow and a prompt and what do i type in here and how do i set this up

and what packages do i need to install and there's so many commands to keep track of um my my goal

with this talk like a lot of my talks was to just kind of distill it to the basics so what can

somebody walk away with in half an hour where they feel not quite so overwhelmed by all of the

options in all of the commands? How do they kind of get their training wheels on to start using

the debugger right away and then incrementally build on that knowledge in the areas where they

felt like they had gaps? And I was really kind of shocked by how few Python developers use the

Python debugger because every time I give this talk, I think I've given it twice now, I ask

people to raise their hands and kind of show how many folks in the audience use the debugger.

And the first time I gave the talk, I expected the number to be 50, 60%. It was 10%. I was

shocked. It's really not a widely used tool, but it is so helpful. I mean, it saves me dozens of

hours debugging, working on a project. A lot of times I'll just copy code straight out of the

debugger into my code base because that's where i got it working uh and the the first time i gave

this talk somebody uh afterwards approached me and they were just like you know that the head

explode meme yeah yeah that that was good the one with the rainbows the 70s one of their expression

like they were shell-shocked they're they're like oh my god thank you for telling me this

and explaining this this is going to save me uh hours and hours a week at work i can't wait to try

it and so i kind of i feel like i'm spreading the good word you know by giving this talk and and

sharing this information yeah no and i think a little bit of debugger skills just goes a long

way you don't need to know all the when you show you don't need you know if you can just put in a

break point and stop it in a place where something's going wrong and examine a few variables

that can make all the difference and then you know you can step up to that and step through code and

back and up and down and you know move around the stack and that's more advanced but just to be able

to stop it there where you can't necessarily unit test because your code isn't structured right but

you can get the debugger in there and you can see what's happening yeah should we give a quick

overview of debugging uh to your listeners who might not be familiar yeah go on then oh i choose

you chrome oh well okay so what do you do well debugging you want why do you put a print statement

in you put a print statement you put a print statement in because you want them to see what's

happening at a point so you print a value what you can do with the debugger is you can put in

a breakpoint and the code literally just stops there and you get a little console and it's not

quite a python console and like a plain variable you can type you know you could type it and it

We'll print the representation of that variable.

And that's kind of handy.

And you can examine the variables in that point.

And the thing that really amazed me from Nina's talk that I didn't know, and I've been doing the debugger for a long time, was that you can type interact.

And that actually opens a Python shell.

And it's like, and then you've got a proper shell and you can do whatever.

Because to print an object in the debugger, you kind of have to use these arcane commands.

And sometimes you can't examine the variable you want.

But if you type interact and you're into the Python shell,

you can just use, it's just the Python shell and it's amazing.

And it's like, ah, I don't need these crazy debugger commands.

So that's fantastic.

And anyway, you can then, once you've got your breakpoint,

you say, well, actually, I need to see what's happening 10 lines on.

And you can type the file name and then the line number

and you can set a new breakpoint.

And then you can press continue.

And it will go on until it gets to the next breakpoint.

And then you can see what's going on there.

And with this, you've got visibility into your code that perhaps because of the structure or whatever, you can't get with unit testing.

Ideally, it would be perfectly unit testable, but you know, I know, code's not like that.

Yeah, and the fun thing is you can put breakpoints in your unit tests.

Yes, yes you can.

And you can do things like assert false in your unit test.

And then you can run your test runner with the PDB flag so that when it hits that assert false, it will open up the debugger.

And then you can print your variables.

So say, I don't know, you've got your unit test and you don't know what some variable is meant to look like.

But you know what it's going to look like because you can just print it in the shell.

And then you can copy and paste that into your unit test.

And black will format it nicely.

And then you can remove the assert false, run it again, and your unit test passed.

And you didn't have to type it out by hand.

Do you recall how you found out about it and started using it?

Because clearly it's not a standard part of what Python developers are learning.

Like, were you reading the, you know, maybe you're, you know, my, the two things I can

think of is some colleague happened to mention it to you.

It's just like, oh yeah, you should do it this way.

Or you were just as a newbie to Python reading the, you know, standard library or something.

I was like, well, this looks good and didn't realize it was not widely used.

I've been using it for so long that I honestly don't remember, but I know that I came across

the command line shell version of breakpoints first and discovered ide breakpoints second and

so a lot of my workflow around debugging still revolves around interfacing from the command line

but i i honestly don't remember how i came across them but the idea for this talk started out a few

years ago, because I went to a talk about debugging and kind of left a little bit less

than satisfied. I don't remember which one it was, but the talk was just kind of an overview

of all the commands. And so the talk was run this command and this will happen, run this command and

that will happen. And I think I left more confused than I walked in. And I kind of always wanted to

put my own spin on it. Yeah, well, you know, if you did, then certainly a lot of other people did,

but maybe they didn't raise their hand and ask questions to, you know,

bring out the insight that the talk, the speaker could have shared.

And it's been kind of, it,

the talk is just about half an hour and I feel like everybody who walks out of

it, walks out of it a little bit more productive. Right.

Like with the interact command, it's been like, Oh,

cause sometimes it's difficult in the PDB command line.

it's difficult to to do exactly what you want to do because some things you can't type because

they're pdb commands so it's like how do i now examine this but as soon as you can drop into

that's that's literally been a life changer for me for you know nine months i've been like ah

every time i type it i'm like thank you nina i love that even before jango con carlton i remember

you were all excited about it and i do recall that you and i gave our talks at the same time

And Carlton went to your talk, not to mine, though he'd gone to mine the first.

And I was like, what better have been good?

And he's like, oh, I have to go.

Sniped.

I'm so sorry.

I watched the video of Will's.

Yeah.

There's one other thing I want to call out about the talk.

There are some folks who've been doing Python for a long time who also walked away with

knowledge about the pdbrc file, the .pdbrc file, where you could add some configuration and add

aliases. And so one of my favorite bits was configuration where you can set up the ipython

repl, a command that would allow you to open that up from your debugger. So letting you do things

like uh the uh ipython magic commands you know like c paste where you could just cop copy and

paste in a whole code block at once like that was my when i discovered that i was like oh my god i've

been searching for this for years so you've actually just given up coding in an editor now

you just cut you just spin up pdb and just start typing in code and straight to pdb until it's

finished and then print it yeah um sometimes yeah when something is happening where i'm like

what is going on or what does this variable look like it's i just always reach for a break point

or you know is is this code bath being hit or not you know is this method being called just

toss a break point in there there's no need to wonder or search through log files or anything

like that to our break point yeah yeah no so i thought that was a nice segue carlton because

we did want to ask you about visual studio code yeah since you work at microsoft you have

a post if not a talk on that so i'm curious how how do you configure vs code for your your django

work i'm sure there's some tips i'm because i use it personally but i'm sure there's stuff i'm not

using yeah so the nice thing is i mean once you have the python extension set up you really don't

have to do much additional configuration. You do need to kind of, to get visual debugging going in

VS Code, you have to set up your debug configuration just once. But Django is already present in the

debug configuration. So you don't really have to do anything there. It comes with debugging of

Django templates out of the box, which is like... Yeah, yeah, that's super nice. Super nice.

That's one of the killer features and something that at least I haven't figured out how to do with a command line debugger. So if I need to debug templates, which I almost always do, I don't know why templates just give me a lot of grief. You know, the template syntax and

that's where the typos slip in there. And it's always like a, you know, a percent or a bracket that's slightly off. Yeah, for me anyways.

And so in VS Code, to be able to throw a breakpoint in a template and see what the data looks like, that is just huge to me.

It's saved me a ton of time.

And then when I'm debugging more complex applications, the VS Code debugger is great, too, because you can just hover your mouse over variables in code that has already been executed, and it'll just show you the value.

Yeah.

It's a pretty amazing editor.

And I'm trying to recall because I think it's only the last maybe three years where it was Sublime 2, which is still good, but then it was a while before 3 came about.

And then everyone got hopped up on Atom, which I still use and like from GitHub.

And then VS Code came in and I think, you know, I can say a lot of people's reaction was just like, yeah, that's from Microsoft, but it's so good.

it's like it's got the built-in terminal and it's you know since i saw it i think maybe it's two

years ago i've it's you know i haven't really used anything else um and it's just it's just

sort of to me like i know it's microsoft said visual um studio i think for a while for a long

time but it kind of just dropped and was like wow this is amazing and fast yeah and free i i was a

PyCharm user for many years and then I switched over to Emacs for many years um and the thing

that I oh really you went that way you went from PyCharm to Emacs oh wow by the time I switched

from Emacs to VS Code my Emacs configuration was like so out of control that I was just kind of

I was just I was sick of you were using Emacs so let's be honest I was you know it's like when

Linux people complain to me about config I'm like we are using Linux it it was great when my config

was minimal, but then I was like, oh, I need this and I need that. And then, you know, all the

config is Lisp. So I had to look at a lot of Lisp and it was my own undoing. I made my configuration

too complex. And if I had kind of stuck with the basics, I probably would still be using Emacs. But

now I use an Emacs keyboard bindings plugin for VS Code. And the thing I really like about VS Code

is it comes super bare bones, right?

Like it is when you first download and install it,

it's a really lightweight editor

and you kind of pick and choose the plugins

that you want to install

based on the kinds of activities that you do

and the kinds of code that you interact with.

So when you open a Python file for the first time,

if you don't have the Python extension already installed,

you'll get a pop-up that says like,

hey, there's an extension

that can help you edit this kind of file.

And so you can kind of, you get a menu, right?

And you get to choose.

Yeah, it holds your hand and kind of suggests stuff, which is really nice.

You get to choose your own configuration, your own custom setup.

It's almost like maybe all of us are old enough to remember like Clippy with Microsoft Word,

which popped up and was useless.

It's sort of like actually helpful.

Yeah.

Yeah.

I think there's a lot of nostalgia out there for Clippy.

VS Code is like Clippy, pretty.

Um, so you have, you have, you have so much work out there that I, we could, is there

anything else you wanted to add about, um, VS code before I switch gears?

Carlton, I know you use it too.

Do you have any?

Yeah, no, I use it all the time.

So I, um, so I have a, an old and first love, which is BB edit, which is a Mac, a venerable

Mac as it still works more than still works.

I, you know, I have it open all the time, but I also have open VS code all the time.

And there are things that VS Code, you know, I'm typing away in VS Code.

I'm like, I need to do this in BBEdit.

So I've got a little homebrew BBEdit VS Code extension,

which lets me pop the currently working file where I'm at in BBEdit.

I might put that online when I get it nice.

But my JavaScript, anyway, another story.

But yeah, VS Codes, it's just super.

For me, it's the speed at which it gets better, which is amazing.

Like it's, you know, because it started off and it's like, okay, yeah, this is fine.

This is interesting.

And then it's like, oh, but there's this bug.

And by the time you've worked out exactly what the bug is, the next version has come along and fixed it.

And you're like, hang on, that's amazing.

I saw this go past on Twitter the other day.

Someone was complaining about the fuzzy search.

And then, you know, literally the next day or next week, the fuzzy search was improved.

And it's like, yeah, that's where I think VS Code has just so much momentum is that it's just moving so quickly.

It's getting better all the time.

And the language server that came in for Python, it's just phenomenal.

And then Microsoft have just got this Pyrite static type checker, which integrates with it perfectly.

And it's just a smooth environment.

It's lovely.

If I could ever get it to discover my test properly, I'd be happy.

Well, you know where to send that feedback.

You can send it to me, and I'll make sure it gets routed properly.

Okay, okay.

Yeah, do you have a sense of how many people are working on it within Microsoft?

Because my sense is it's a pretty good-sized team.

It's a fairly large team.

I don't have the exact number, but the creator of the Python extension, it was developed by somebody else.

Don, I'm going to butcher his last name, and for that, I apologize.

It's Don Giamatti.

And his software was kind of acquired by Microsoft, but he also came on board.

So he started the extension, and then when Microsoft acquired it, they were able to build

it up and make it this really great thing and have a team that now supports it.

Something that I'm working on that isn't quite ready yet, but hopefully will be by the time

the podcast airs is I'm planning on getting about four folks from the Python extension for VS Code

team to come on my Twitch channel every two weeks and do kind of a community Q&A. So take questions

through the chat, talk about any updates, any, you know, sneak peeks that they can share from

future releases and i'm i'm really excited about that i did a pilot and uh you know everyone who

kind of came on the show and was able to interact had a great time with it and so i think it's going

to be a great way for for the team to interact with the community and then for folks to also

ask questions and meet some of the people who who do the work it's been really nice to see

microsoft's commitment to python i mean also in the realm of uh you know the windows windows 10

the app store now you can install python because i it used to be a lot harder yeah and even i had

i have a install python 3.com site and one of the ways i i was recommending the new way to do it and

i i forget who but someone who's on the team at microsoft came in and made some comments saying

like yes we recommend doing it this way as opposed i forget the other way but also we're adding there

are one or two complaints and people had in a discussion forum and he was saying yeah we're

we're going to work on those and um because it's just you know they're just systematically

removing a lot of the traditional barriers to development on windows machines you can install

like the 3.9 alpha out of the microsoft store it's like that's kind of quite easy that's that

makes testing it more fun you know and if anyway that's awesome yeah i've i've you know as a python

developer advocate at Microsoft. I've been thrilled to see the support and the presence

at PyCon has been really great. So we've been a Keystone sponsor for the past,

oh, I don't know. This would have been my third PyCon with Microsoft, but I believe it would be

four years in a row as Keystone sponsor. And we have a lot of really fun and exciting virtual

events planned for PyCon since we weren't able to meet in person. We're doing a lot of hands-on

labs and online workshops that are going to be released kind of starting mid-April going through

mid-May. Great. So we'll have links to that. There's also, we should mention, you and Carlton

have done a video series on using Azure for deployment. That's from last year, I think,

right? Right after DjangoCon. Yeah. So we're using VS Code with Django, just showing you how

that works and then sticking your um django app on um app service um provisioned a um postgres

instance and um deployed um the django app to azure to the app service they're all from within

the vs code um extension which is quite cool and super easy yeah we should uh drop a link to that

in the show notes because i i think the video came out quite good we got to film it in the

Microsoft Studio in Redmond, which is kind of a full-fledged studio with lots of cameras and

lights. And we had a newscaster desk and it came out quite well. In your work, do you spend much

time on that side of it? Or if people have issues deploying Django stuff in Azure, can they reach

out to you? Or is there someone else on your team who handles that? Yeah, they can reach out to me

and I'd be happy to route the request and take their feedback. Usually the best way is to open

an issue on GitHub, but sometimes it can be hard to figure out what's the right project or what are

the right tags. And if it's something kind of more, if there's a bigger issue, I'm happy to

route and to escalate and to help out. I guess while we're talking about this though, we should

just talk a little bit about Azure because in the cloud world, there's the three, right? There's

amazon aws this google cloud platform and there's azure and a lot of people veer straight to aws

and not necessarily the right option you know the others are good too i mean i don't know what you

think what you'd say from the microsoft stand you know what's the what's what's the azure option i

mean for me it's great you can spin up you can spin up a postgres you've then got things like

the app service you can spin up um compute instances the same as everywhere else you know

it's um if i guess if you're tied into microsoft already it's a good place to look yeah yeah yeah

we we have a fully featured suite of offerings we um offer uh deployment and serverless functions

and kind of all of the all of the standard stuff but i think where we really shine and something

that is really cool that the other cloud platforms don't necessarily offer is we have

VS Code extensions around all of our offerings. So there's a VS Code extension for web apps that

lets you create deployments right from VS Code and do things like add environment variables,

start and stop instances. So there's an extension for our serverless functions,

and uh it's it's just it's really nice to have a different way of interfacing with your cloud

resources yeah and yeah that's one thing i really like as well like the the blob store extension

it's really cool because you've uploaded to the bob store you can just i'm gonna edit my css online

you know it's like when you used to ssh into your server and edit your html live and you can do that

all that again from inside vs code it's like anyway yeah and i think it you know it offers

uh it opens those services up to an audience that maybe is not necessarily quite as familiar

with the command line and doesn't necessarily want to learn the ins and outs of a new command

line tool uh some folks are just visual learners and visual explorers like i am and so yeah to be

able to interface with those resources

straight from your

IDE, you know, in

a way that you're kind of

already familiar, it lives

next to your code, I think is really

fantastic. Yeah, super.

Okay, that's cool.

Well, maybe the last of the talks I wanted to

ask you about is, so you did the closing keynote

at PyCon this past year, I think?

I did.

I mean, that's not really Django related,

it was more about

hardware, but

And I don't know, we'll link to that talk as well.

I thought it was really interesting in person.

I guess, where do you find the time to play around with hardware too?

Well, it kind of started as more of a hobby and then has kind of migrated to something

that I'm able to focus on at work, which I'm really thankful for.

But I started tinkering with hardware quite a few years ago.

And when I discovered CircuitPython, I think that kind of really reinvigorated my interest.

It's a fork of MicroPython that's more focused on education.

And so to kind of move away from writing Arduino, which is kind of more of an analog to C and C++,

to writing Python to interface with microcontrollers, I just thought that was so fun and so awesome.

Uh, and, um, we were going to be, uh, handing out PI badges at PyCon for completing hands-on

labs.

I know, unfortunately that's not happening this year.

We're, we're, uh, we're going to be doing something virtual though.

So, so keep your eyes out.

Um, but I do have, uh, a whole circuit Python repository available where if you do have

a pie badge uh you you can run it and it had some fun easter eggs in it and uh um a little um

a little version of an expo vert meter that i had written because uh i'm pretty introverted but

sometimes you know you're at a conference or an event and you know i love talking to folks and

catching up with old friends so there's an indicator of kind of where your social battery was

um yep yeah spoons you've got left yeah uh with a little red led and a little red message you know

if your social battery was empty or you know could display a green one if you wanted to chat with

folks so there are a lot of cool little things built into the badge and i can share uh a link

to that repository as well if somebody does have the hardware that they can play with it and try

it out because uh you know unfortunately adafruit isn't shipping at the moment yeah well because

last year they gave everyone a chip, a little board. And so I remember going through the airport

being like, I'm sure you've seen a lot of these. Because it is the kind of thing you're like,

I just want you to see.

this thing like it does look scary but it's it's not anyways it's a fun uh swag from last year

carlton you were going to say something yeah no i was just what i was going to say was just that um

i guess the trick with this kind of thing is always getting the right hardware so you know you

you go you find an electronics tutorial and you buy your arduino board and you start a kit and

you get the right you know you get up and running and then you're like ah but i need this piece of

kit which i haven't got and yeah i guess for for is there a do you have a kind of look if you're

getting started by this guide because that's kind of handy i think yeah well so there are kind of

two paths there i think the that adafruit circuit playground express the device that they were

giving out last year is really a good all-in-one kit it it's a microcontroller but it has buttons

there's uh 10 leds on it there's a little slide switch and a whole bunch of sensors

temperature sensor light sensor so if you kind of just want one thing to get started with

i think it's a really good option yeah there's also uh the bbc micro bit which uh

i think kind of has has less on board but is also a great option uh and then kind of these days if

you're not able to get your hands on hardware there are options for emulation so make code

will allow you to use a block-based editor and have a circuit playground express emulated so

you can learn about all the concepts without necessarily having the hardware and then some

of the interns who have interned for the microsoft garage have come up with a vs code plugin called

the device simulator express and uh originally that just simulated the um circuit playground

express but there's been a recent release i believe last week that added support for the

micro bit and the adafruit clue board so if you don't have the hardware you can still run circuit

python and see um how it would look on the actual device so yeah and if you're waiting for the board

or, you know, you can get the board later on.

At least you're up and running.

Yeah, yeah, yeah, exactly.

Do you know, does, so Bitsbox is something I see all the time for kids.

Does that, is that MicroPython?

Are you familiar with that?

No, I'm not familiar.

Okay, yeah, they, and I guess just in my parenting circles,

they have these subscription,

well, they'll send you hardware things for kids 6 through 12.

And I guess I was trying to more generally segue to teaching Python

because you have a course we'll talk about, but one thing I've noted is that, especially for

younger kids, doing hardware-based things is a much more accessible way, a real-world way,

because you don't need that much code and you can do things like... I think Nicholas Tollery was a

guest and was telling some of these stories of you can create a wand and have an Easter egg hunt

in a library, or you can use a tiny bit of Python code with one of these chips, and it's just a

great introduction to students and i think that's being used more and more at the like late elementary

middle school level rather than you know defaulting to building a video game or a website um so i

don't know it's just something i'm very much thinking of and my oldest daughter is in that

age group um but i'm i you know i'm so predisposed to think of software terms but it's like oh yeah

hardware like a teeny bit of python and i'm you know hashtag coding but then you can like run

around and make it interactive makes total sense that especially for a younger kid that would be

a great introduction yeah i mean there's just something exciting about making an led blank

yeah yeah yeah it's i mean it's yeah it's a little more than just this you know your computer screen

showing something or other yeah you've got to teach them about the marquee tag

don't don't teach them about the marquee tag

marquee tag is is over uh yeah one of the i think the first time i ever spoke

one of the first times i spoke about hardware at a at a conference was uh pie cascades um

last year early last year and i did a few uh live demos with the hardware where i had a camera kind

of pointing at the device and i would modify code on it and i think i had three or four demos and

after each demo the audience would just break out in applause and i was like well that's possible

giving a talk i don't i didn't know that yeah i didn't know that either i was not expecting it

but folks were like really excited and really amped up to see the leds change color and you

know like watch me program changing the behavior of the buttons like folks were really invested in

it and i was i was i was taking it back for sure they're probably also impressed that you live

coded and it worked right that's always like right everyone who hasn't spoken before they're like

i'll just live code this little bit and you want to say it's not gonna work so many ways it's not

gonna work but you know you made it work so i i had videos recorded of all of it in case it didn't

work yeah right i was gonna say that like that's the way to do it like is to have yeah have a backup

or um yeah i mean i've even had it like boston related things where i always like throw a copy

of everything online because just because like i have a macbook and the person before me had a

macbook and it plugged into theirs doesn't mean it won't plug into mine and you know not that i

recall it i had to give a 40 minute talk just you know that way and i was like never doing that

again i'm always going to throw a copy up online somewhere in case my my my macbook mysteriously

doesn't work uh i gave uh i did live demos for my pycon keynote and that was terrifying yeah

funny enough it's a couple thousand people i did it i did a practice run and everything worked

great and then on the day of my camera was glitching the camera that i was using to display

the hardware started kind of glitching out every time like well all right this is just happening

i'm gonna roll with it because yeah i'm here and i'm giving the talk so um i want to ask about

recording for um pike because you're doing recorded talks for pike on online this year so

do you feel like the pressure is much higher to make something put you know that the production

quality higher because the you know once you're on stage live you've just got to plow on and if

your camera glitches you've just got to go through it and there's a certain diamond dynamism to that

but if you're recording it you'd be like oh no i'm gonna redo that bit 58 times and

till it's just right do you feel that or well now that you mentioned it carlton

thanks for that yes and no i mean editing is really time consuming um i think i'm lucky

that um i'm kind of i was already familiar with software to record screencast locally on my

machine because uh i do a lot of internal presentations that um take advantage of that

format so um i know kind of a little bit about video editing i have a fair amount of gear for

recording videos and for live streaming. So I've been live stream coding on Twitch for the past

few weeks. So I have a reasonable microphone and good lighting and a nice camera. And so

I feel pretty well set up to do my recorded talks. But I think if you don't have that background and

don't have that experience, it's a lot harder and a lot more nerve wracking because you might want

to make it perfect or re-record or whatever but you don't necessarily know how because the tooling

is not that easy and not that straightforward i guess you've mentioned twitch a couple of times

i want to ask about that as well because i always say oh you know i've seen people doing twitch i

thought could i do twitch and be like is anyone going to watch me reading the docs like do you

have to you sort of plan it in advance or so that you actually do some coding or do you just sit

reading the docs i don't know like i don't um so they're one of the most interesting things about

live coding on twitch i think is at first i thought i would be productive you know as productive as i

might be writing code on my own but actually uh i'm at least half as productive if not less so

when live coding because i mean it's typing in public right that's always error prone to x

anyways yeah it's typing in public there's i keep an eye on the chat and i try to answer questions

and interact and then sometimes we go down rabbit holes um so kind of setting expectations for how

much i can get done which turns out to be little bite-sized pieces but um i don't plan much in

advance and there have definitely been streams that are probably more boring than others there

was one where i forgot to set a callback url properly and so i spent you know 45 minutes

going why is this not working and that's because you know it was a misconfiguration with with an

api that i was using um there was one stream where i read docs about the logger for the most part

yeah and log streams and log filters yeah but i think that's there's real value in that too

both in seeing that even the pros you know miss stuff and like and that but more importantly what

is the process of debugging a situation because and I don't know like like I play I play guitar

and like John Mayer is a guitarist and he does these live streams from home and he'll just like

noodle for 45 minutes and just like not miss a note but that's not what programming is nobody

does that no so I think you know it's helpful just to show people like here's Carlton reading

the docs here's Will looking up on Google and it turns up it's a tutorial he wrote two years ago

like you know this is day-to-day programming yeah exactly i you know i remember almost nothing

google and stack overflow that's my crutch um and a lot of times it's just like poke it with a stick

and see what happens uh it was definitely scary making mistakes at first because it's like oh

everyone's gonna think i don't know how to program and how terrifying is this but you know uh the

community that I've built up on Twitch is very nice and very wholesome. Uh, if you come on the

Twitch stream, you can get information about joining our discord. Uh, and at the moment,

I think there's just 40 wholesome folks who hang out in there and talk about Python and,

and everyone's really nice and welcoming and supportive. And, um, you know, I think it's,

it's good for people to see me make mistakes and, you know, the process of debugging and

troubleshooting and figuring out what went wrong is is really important to show well i almost think

that having having like a q a where people ask you a question and just seeing how you google for it

is would be really valuable or carlton i mean because beginners just don't and i often think

as terms as a teacher how do i teach people how to google better because it it's a it's a little

slippery but you know i think there's some there's some value in that just seeing like well i don't

know. But here's the terms I would type. Here's how I look at something and say, oh, this is

seems valid versus like, this is total trash. You know, how do I scan through Stack Overflow?

You know, that takes a long time to get there. And I don't know of a linear way to do it other

than seeing real people do it. Yeah, I'm not sure. Maybe that's on your next Twitch. People

can ask you stuff you don't know and see like how you would figure it out. Oh, boy, that sounds like

a pranking show. No, but I mean, I'm serious about this. Because I think I mean, to your point about

not making mistakes I mean I'm earlier in my coding career than either of you and I've only

just gotten to the point where I'm like more and more okay with like there's just I'm just never

gonna know a lot of stuff and even if I knew something I probably forgot it but I'm not gonna

apologize for that because I can figure it out yeah like I think that takes a long time it takes

a while to get there yeah I think so too um yeah the Q&A format helps uh one of my favorite bits

is when, you know, sometimes I make a typo or I do something wrong and somebody in chat is like,

hey, did you check this or you forgot to do that? So it's kind of a different style of

pair programming. I like to think that folks are like hanging out with me in my living room,

right? Yeah, yeah. Well, so let's talk about your LearnPython course. It came out last year,

links to it. So you have, this is on front-end masters, but then also you have a lot of the

curriculum um online available i was just asking before we started recording you're using um grov

learn with a hugo site for hosting is that so um so so so why the course and what you know how did

you how did you determine how to structure it because i'm always curious on on that like i

like that you didn't just dryly go like here's data types here's the python flavor here's you

know operators right because it's tempting when you're teaching to a fellow programmer who's

on their third fourth sixth language like we know these are the constructs of computer science

and here's the python flavor of it you didn't um do that as much i think you made it much more

maybe i'm actually new to programming uh kind of style which i like i'm so i really appreciated

that but i'm curious how you got to that point yeah i didn't know that you had gone through the

course uh of course you kind of told me right right before we started the show and so and you

know carlton hasn't read my book so i don't assume you've read my book so it's a i have read your

book do you yeah all three no just two of them okay all right that's that's sweet that's still

okay yeah i sometimes i recommend my course your wife hasn't read that she does listen to the

podcast though so hi sweetie oh that's so sweet sorry so how did you come up with the um the

structure? Yeah. So I have been an author on front-end masters, I believe, since 2014 or 2015.

I did a course with Brian Holt on an introduction to web development, which I think is now pretty

out of date. So it's no longer on the platform. I have a course that I taught on Git. So it's a

six-hour, four to six-hour workshop on Git. And people come out of it just like, oh my God,

i never understood git before and now i know exactly what i'm doing uh like i'll i'll have

folks who see me at conferences and they'll run up to me and be like oh my god you taught me git

which is so like it's so it's so touching and so satisfying um and that's only two years two

years ago i think right i think the git course was two or three years ago yeah i mean because

because git is one of those things like i use the same kind of five commands but i mean just

yesterday i you know committed an api key with a demo i was making which was a which is a no bueno

and then i was like you know how do i totally nuke this and rebase and all these things i'm just like

oh my god um yeah because i certainly haven't i should i should go through the course again

because i'm definitely like how do i do that thing like if it's not a revert and it's not a

git commit or a push or a pull i'm like i don't know i gotta look it up and whenever it's rebased

i get scared or typing you know dash dash force or hard then yeah it's like pseudo and i'm like oh

god yeah rebase is not that scary don't force push to a shared branch so if you're working on

a project with other people don't push to master um and you know i a lot of people don't don't

know this or don't follow this but just before you start fiddling with your branch just make a

branch.

You can just, from your current branch, you can just say git branch whatever.

it'll just make a backup branch and then you don't have to worry so much and i'll admit i'm i've

gotten lazy in my own projects it's just working off of master and it's bitten me like twice in

the last two weeks that i'm you know because in a team setting of course i would create a branch

but it's just me i'm just like cowboy coding and then it's like god yeah i still do branches and

pull requests for my own projects because then i can go back and review the pr and i kind of have

a history there. But yeah, for the Python course, so these courses are available by subscription

on Front End Masters. I think the current charge is something like $40 a month, but you don't have

access to just my courses. There's a really full, vibrant library of courses available for one fee.

It took me months to put my course together. Yeah, I bet. Yeah.

Yeah, this is something that I kind of do outside of work on my personal time,

and it definitely ruined my social life for a few months. Because there's kind of an approach

that I take to teaching this approach of taking complicated topics and distilling it down to the

basics. So, you know, I've done that with conference talks on topics like memory management

in Python and debugging. I've done it for my Git workshop, but Python was kind of a different beast

to tackle because every time I thought I had the curriculum right, it's like, oh wait, I haven't

introduced this foundational topic that will let the person make that aha connection at the next

step. And so now I have to rearrange everything. And so the rearranging happened three, four times.

It took me a really long time to get the curriculum exactly how I wanted it so that each concept that was introduced was the building blocks for the next one.

And there was no section where you're like, well, this is a mystery.

I don't understand how this works because I was able to kind of build it up step by step.

And I was really proud of how the course came out.

I put a lot of time and effort into it.

I was supposed to be recording a new course in June in Minneapolis, but I don't think that will

be happening. It was going to be kind of a one day, you already know some programming, give me

a one day of condensed Python to help me be productive after watching this course. So I

don't know, maybe Front End Masters will be going remote. Maybe I'll have an update to share in a

few weeks. But I, you know, I love that people have a venue to compensate me for my work,

if they find the class valuable, when they watch the course on front end masters, it is

something that I get paid for. But I know that not everybody is able to afford that. And there's

still a lot of folks out there who want to learn Python, and there aren't a lot of good free

resources out there. So I released all of my course materials and all the exercises under

learnpython.dev. It is licensed in such a way where I really don't want other folks teaching

my material, you know, because that's not why I put it out there and put it online. I really put

out there for individual learners who want to learn python don't have resources uh and can't

necessarily afford to watch the full recording uh and then i also released my course and the

videos for free for two weeks uh at pycon last year yeah i remember that that that's when i first

actually took took a look through it um and then i just refreshed before this oh nice yeah yeah i

I mean, because specifically like with Django,

it's a part of the reason I'm thinking about Python

is because people ask me about Python

in the context of Django.

And the big thing that they have confusion about

is object-oriented around classes

and mixins and inheritance.

That's the part where, you know,

if you don't get that,

then Django is really not going to make sense to you.

And so I read with particular interest

how you handled that.

because you put that in the intermediate section. And yeah, I like I mean, I like also how you have

practice things for all of them, because I do think that that's really helpful. And as a teacher,

it's it's sort of like, how do you, you know, in a traditional classroom, you just assign it and

people have to do it on their own. People almost never do these things. But if they are self

motivated, it is nice to have like a, you know, stretch yourself. And then, you know, the answer

out there but um you know really reinforce the learning by by trying to apply it in different

context i think that's i really like doing that without doing some sort of like made up online

validation quiz that you can just cheat on kind of thing right yeah and i think folks learn best

with muscle memory so throughout the whole video course i encourage people to type along with me

because that's how they'll get it to stick that's how the the concepts will really um they'll be

able to internalize them a lot better if they type along with me. And then all of the exercises,

I walk through completing them with the students. So I think the video course came out really great.

And I'm pretty proud of it.

You miss a lot if you just do that, look at the text, for sure. I mean, I do think that that

typing along, I mean, back in the day, Zed Shaw's Learn Python the Hard Way,

one of the real positives of it was it emphasized, type all this stuff out and make it work.

So I think beginners sometimes, you know, copy paste and all the rest and that muscle memory is really important. I mean, that's in a way I mentioned to people, they want to learn how to program like you better be a good typist. Yes, I mean, you know, and quite a few people aren't. Because man, if you're not a good typist, you're it's something people don't think about.

Yeah, and that's actually a skill that you can learn. I realized that I learned to type the wrong way. And so I was going through some typing tutorials. You know, I type really fast, but the way that I type is not necessarily the correct way. And the typing tutorials really helped me minimize, you know, straining my fingers and like figuring out which keys to press with which finger and how to optimize all of that.

so it's painful when you see an educated person of a certain age using just their index fingers

to type yeah it always makes me think of uh i feel empathy for them yeah yeah halt and catch

fire yeah yeah cameron was like the index finger typer yeah yeah i mean there's tons of free

resources to learn to type online so even if you're not good at it it's a skill that you can

learn and it's just same old muslim memory yeah um one last question on the the structure of it

So you go basic data types, and then you go functions, and then after that, lists and tuples and sets.

So that's, in the canon of Python teaching, that's the one where it varies quite a bit on, like, when do you introduce functions?

So I'm curious, why introduce functions before you get into data structures and logic, if you recall?

Oh, I'm going to have to think about that one.

It's been a little bit over a year since I've put the course together.

I honestly don't remember, but if I were to guess, it would be around the concept of arguments.

So I think functions accept arguments, and then a lot of the data structures accept arguments as well.

And I think it's easier to think about it in the concept of a very simple function accepting arguments and then moving on to the more complex.

right a list doesn't really make sense if you don't understand arguments right and i like that

you also have the you take the time to talk about function scope because again for someone who

doesn't have a computer science background scope is is a gotcha um yeah i'm sure have you seen the

python tutor site that philip go does um he's in actually he's uc san diego that will visualize

realize how the interpreter is running your Python code? I've seen it a bit, but I have not

used it on any of my own code. Yeah, well, it's really helpful for, I mean, when you were talking

about the debugger, I was thinking of it because you can just literally step through and see,

you know, how scope is executed from the computer's point of view. But anyways, just call

out, I like that you had the specific section on scope, because I think that's often not included.

yeah and that obviously will get you yeah and i try to think back to all of the things that i

found confusing when i was learning python and you know think back to the aha moment when i

finally figured it out so uh i put a nice uh illustration in there about how uh break and

continue work with colored arrows and everything and i was quite pleased with that yeah well it's

great we're linking to it people should watch the videos um i mean and i find not just as a teacher

but just sometimes i feel like i do django more than i do python so even if it's more the beginner

stuff either i forget it or i just get a little bit different lens on it and um i really enjoy

working through educational stuff i always get something out of it um personally yeah yeah i'm

really glad to hear that what's the tai chi equivalent carlton what are the pose the the

movements right it's like it's not a kata but yeah well a kata is a kata i guess is a japanese

word that's like a karate thing yeah yeah yeah but it's the form isn't it so yeah the the point

it's like scales yeah exactly it's these basic movements which you know you might think oh you

know five minutes i've got this but there's there's 50 years worth of depth in it and it's about

keeping your tool sharp it's about always having we've talked about in the podcast before the

beginner's mind it's about being open to you know the fact that you're everyone's on their

edge and you're on your edge and you're trying to make yourself better and sharper um and you

know reviewing educational materials it's always like yeah okay you know yeah yeah there's a new

aspect i hadn't thought there's always an every person puts it slightly differently and there's

always a some ah brilliant thanks yes and it's and what did it oh it was just this depend but

i hadn't thought of it that way right yeah i mean our our mutual friend trey hunter has python

morsels where it's like weekly python exercises i mean i often i play music my kids play music

um and that's why i have to supervise their lessons and i often think i wish that they're

you know because professional musicians will spend a third half their times

throughout their whole life practicing scales and you know i wish that i did more of that as

a programmer i feel like i just you know airdrop into some project and just start you know putting

out fires yeah and i i kind of wish i had like a ramp up of just you know hitting my scales in the

same way i do on my guitar or the piano um so but is this not part of the um obsession that we all

have with tooling right and it's a lot of guys but that's the thing it's not tooling i feel like

to me tooling is a is can be a waste of time can be a black hole uh whereas this is just like reps

it's just you know

but not in like a you know leet code like

interview I mean those can be a little bit helpful

but I wish

I you know spent half an hour an hour

every day just keeping my Python

sharp to be honest I feel like it gets

gets lazy yeah and it's foundational

skills this is something I

picked up from Raymond Hedinger but he always

stressed the importance of

being able to move between different data types

in Python you know how do you

quickly pull out what's in a dictionary into

a list or tuple and kind of

fluidly move between all these different types because all the types have different pros and

cons and ways that you can work with them and like that is probably kind of one of my my biggest

takeaways being able to to move a a list into a set and figure out you know well you know what

are all the individual elements uh and not even kind of think twice about it or have to think

about oh like which data structure should i reach for uh that's been really useful in my day-to-day

programming well i guess if you're a typical you know bay area startup engineer you bounce jobs

every 18 months so you have to refresh those skills so that's like built-in practice

that's like what one percent yeah well is so we're pretty much up on time um is there anything else

we haven't covered that you'd like to mention your work at microsoft or personal projects um

yeah that there are a few things that i want to mention uh we already covered this kind of in the

middle of the podcast but i really hope that folks can keep an eye out for the um the workshops and

the labs and the tutorials that we're putting out for pycon over the next few weeks uh a lot of

folks on our team have put an immense amount of effort into those and um i've been really happy

with how they've come out so unfortunately we weren't able to bring our booth to pycon but we

tried to digitize as much of that experience uh as we could so that we could still share it with

um you know attendees and python enthusiasts um and the last thing i wanted to mention is uh

i'm going to be kicking off some new live streams on twitch so one is going to be every two weeks

And I'm going to have a Q&A with the Python extension for VS Code folks.

We're probably going to be covering different areas, maybe the debugger, maybe AIML.

So folks would like to keep an eye out for an announcement about that.

They can follow me on Twitch at NNJAIO or Twitter at NNJA.

And in between those Q&As, I think I'm going to do a series on Twitch called

I'm still working out the name, but I think it's going to be called Python Tea Time, where I'm going to have a new guest every two weeks.

And we're just going to kind of talk about what they're working on, how they're doing, maybe any projects or news that they want to share.

Because I feel like we all really miss the hallway track, you know, and just running into people and catching up with them.

So this will be a virtual way of doing it.

And since I'll be streaming it on Twitch, there'll be a chat and a Q&A so people can

come and hang out and interact.

Great.

Well, we will link to all those things.

Awesome.

So Nina, thank you so much for taking the time to hop on.

Yeah.

Yeah.

Thanks for coming on.

Yeah, we talked about this in person at DjangoCon in San Diego last year.

And so I'm really glad to kind of close the loop and go full circle and that we were able

to connect.

Well, we did because we were getting drinks and I was like, Carlton, where were you?

And we were all sitting together.

he's like well i was with nina and i was like you know so that was that was the first time i think i

you and i ever spoke yeah so yes finally it happens and you know to your point on the hallway

track again this podcast came about because of my 2018 jingo con experience where that's my first

time going to a real tech conference to be honest and i love the hallway track and i thought how do

we keep that going so yeah that's awesome well thanks so much for having me it was a pleasure

thanks for coming on super okay i guess that's it join us next time folks bye