Latest / Talk Python To Me / #195: Teaching Python at Apple
Transcript
- 0:00When you think of learning Python, what type of developer or technologist comes to mind?
- 0:04Is it someone looking for their first job or maybe making a move from something like .NET
- 0:08over to Python and looking for a shift in their careers? While these are common moves,
- 0:13you may be surprised how many folks within a tech company learn new languages like Python
- 0:18just to stay within that company. On this episode, you'll meet Ron Hayden. He founded
- 0:22the Software University internal training program at Apple and is now doing his own
- 0:27independent training around Python. I think you'll find his story an interesting element in the mosaic of Python.
- 0:33This is Talk Python To Me, episode 195, recorded January 9th, 2019.
- 0:38Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem,
- 0:56and the personalities. This is your host, Michael Kennedy. Follow me on Twitter where I'm @mkennedy.
- 1:02Keep up with the show and listen to past episodes at talkpython.fm and follow the show on Twitter via
- 1:07at talkpython. Hey, everyone. I want to tell you about a new course we just launched, Introduction to
- 1:13Ansible. This one was created by Matthew Mackay of Full Stack Python. If you're involved with deploying a
- 1:19web app or managing servers, especially Python web apps, you owe it to yourself to check out Ansible.
- 1:25It provides a declarative way to provision, configure, and evolve infrastructure and applications. What
- 1:31makes it even better is it's written in and can be extended in Python. Check out the course over at
- 1:36training.talkpython.fm. Corporate and team options are available too. Ron, welcome to Talk Python.
- 1:43Thanks. Glad to be here.
- 1:44It's great to have you here. I'm really looking forward to this peek inside how Apple teaches
- 1:50their internal folks Python. I think that's going to be a lot of fun.
- 1:53This is my very first non-Apple thing in 25 years, so it's also a big new experience for me. And I'm a
- 1:59big fan of the podcast, so really happy to be here.
- 2:01Yeah, thanks. And that's really cool. So you've, as we'll get into, you've been at Apple for a really
- 2:05long time and now you're just starting off to do a more independent thing. And I think that's a super
- 2:10interesting perspective. So definitely dig into that. But before we get to it, what's your story?
- 2:15How'd you get into programming in Python?
- 2:16It started actually pretty much at the beginning. So I've been at Apple about 25 years. And early on,
- 2:22when we started creating an engineering team and documentation group, I worked in the technical
- 2:28publications. We went to an O'Reilly conference that was for Perl mostly. And I went to a couple of
- 2:35Perl things and Perl did not speak to me. And I ended up in the corner with probably the very first
- 2:42edition of a bunch of the Python books and wanting to use Python. But the problem was the people I was
- 2:49working with on the team all knew Perl. So we created our entire production pipeline in Perl,
- 2:56which I refused to learn for like two years. I was so annoyed about it.
- 2:59I'm not doing this.
- 3:00Exactly. Eventually, I learned a number of things I learned being an engineering manager.
- 3:04It doesn't work to be an engineering manager if you don't know the technology your team is using.
- 3:09So I had to break down and learn it. And I got a lot out of it. And I actually kind of liked something.
- 3:13How good do you think you have to be? Do you have to be able to kind of read and follow?
- 3:18Do you have to be able to write basic code? Do you have to be really, really good to understand?
- 3:22No, when you do this, actually, that uses too much memory. Use this other technique or this
- 3:27other library. What's the level when you say that?
- 3:29Also, this is coming from kind of an Apple perspective where the engineering managers are
- 3:33very technical and involved. You know, there are other companies where that's not so much the case.
- 3:37What I found was if I couldn't get down to those details you were talking about, things would go off
- 3:43the rails. In fact, what happened for a while was the team was developing our production pipeline and
- 3:49things were not working out. And eventually, and this is probably not the greatest engineering manager
- 3:56thing to do. But eventually, actually, when they went off to the next O'Reilly conference,
- 4:00I spent the days they were gone learning Perl and rewriting the production pipeline. Once I realized,
- 4:07oh my God, this is not in good shape. That was a huge lesson for me as an engineering manager.
- 4:13From then on, I never let myself get out of touch with the technology of the team. And later on,
- 4:18remember when we were releasing the first iOS SDK and doing a bunch of web stuff related to that. And
- 4:25they had a web guy. These were good web guys. It was like, oh, it's not possible to do that. And
- 4:29I was like, well, I was working on my personal website yesterday doing this and I did this. So yeah,
- 4:34I think it's possible.
- 4:37And here's a small example on how it's going to work, right? Yeah.
- 4:40Yeah, exactly. Exactly.
- 4:41You know, it's so funny. You get into some of these debates of, should we do it this way? Should we do
- 4:46things that way? Is that going to work? I don't know. It always seems like there's someone that's
- 4:49like, well, that's, you can't do that. That's not going to work. Or it might work in a simple case,
- 4:53but not really. But the thing that solves that debate better than any other is to just have,
- 4:58just go, but this does it.
- 4:59Here it is.
- 5:00Like that's something beautiful about programming is you can say, no, click the button and it happens.
- 5:05And then we can discuss that, right?
- 5:07And a theme for me, and I think we'll probably talk about it a couple of times today,
- 5:09is the biggest jumps in my career and where I made the biggest impact have always been when it was that
- 5:17thing. Oh, this is not possible. And I would go home that night or that weekend and I would figure it
- 5:21out and I would do it and come back with the solution. And there's nothing more effective,
- 5:26like you're saying, than that. And if you just sit there and say, well, I guess they're not going to
- 5:30let me do this. Then you kind of put yourself in a box, you know? Yeah.
- 5:33Getting to the actual Python part. So Zoom, so I always wanted to use Python. I used it a little
- 5:38bit personally. That's not what our technology was built on. So Zoom forward, you know, 20 some years
- 5:43and I'm running a team called Software University, which we'll probably talk a bit more about.
- 5:48And we had an intern come in who was really into Python. And so he did a presentation. We do a weekly
- 5:57engineering presentation that gets put on an internal website and the engineers can look at.
- 6:01Like a brown bag lunch type thing where it's sort of an internal education thing.
- 6:06Yeah. Yeah. Except being Apple, it's really high production value and, you know, huge amounts of
- 6:11effort are put into each one. And it's something I'm really proud of that program. But so this intern
- 6:16comes in and does a Python topic and we're like, well, okay, this is, this is Apple. We have Swift,
- 6:22we have Objective-C, that's what our interns need. This is going to be really niche, but hey,
- 6:26we're, you know, we'll let the intern do this. It'll be a good experience for him.
- 6:29The interest level, just when we announced the talk was off the charts, people were emailing
- 6:34saying, when is it happening? Can I show up? When are you going to post the video? And we're like,
- 6:38what, what's going on here? Why does anyone care about this little scripting language?
- 6:42And then it was a sellout crowd. And, you know, we actually had to turn people away.
- 6:47And I'm like, hmm, that's interesting. So I started looking into it and it turned out
- 6:53that everybody who didn't need to be using Swift or Objective-C was either using Python or wanted to
- 6:59use Python, either just to do daily workflow tasks or more and more to do data science stuff.
- 7:06So I ended up getting back into Python, developing classes. I spent two, three years just developing
- 7:13these classes. And one of the great opportunities you get working in a big company like that is I had a
- 7:19built-in audience. And I could also, I could kind of suck at the beginning because they're getting free
- 7:25training. So they get whatever I got. And then I got to do it over and over hundreds and hundreds of
- 7:30times and eventually got to really know my stuff and to get really, really good responses from the
- 7:36students. And in fact, by the time I left, I never had less than two to three thousand people signed
- 7:41up to take the class. It turned out that Python actually was really, really in demand. And that
- 7:47kind of changed the whole trajectory of my career. And it's some of the reason that I'm here talking to
- 7:52you now was I also, I knew I liked Python, but in the process of developing these classes and doing more
- 8:00and more work with it, I really fell in love with it. And if it had been some other language, I might've
- 8:06taught it, but I wouldn't have gotten to where I was. And I wouldn't have gotten so passionate about it
- 8:10that I really wanted to devote myself to it.
- 8:12That's a great story. You know, I had a similar experience in that I started learning Python and
- 8:19we started working with it in the company I was at around a training perspective. And just the initial
- 8:26demand was so much higher than what I expected compared to what everyone else was doing. Wow,
- 8:33there's really something to this. I better personally pay more attention to this because this seems like
- 8:37it's been way more important and it's going to have a bigger impact than the perception of a lot
- 8:42of people around me, you know? Right. Yeah. That sounds like a little similar for you as well.
- 8:47So you said you have been at Apple for 25 years, but this is one of the first things you're doing
- 8:52outside of Apple. So what are you doing day to day now? What are you working on?
- 8:57To my surprise, I ended up getting a book contract because once I had resigned and there was a couple of
- 9:02months between me resigning and when I was actually leaving, I happened to see a book publisher on
- 9:07Twitter say, hey, send us proposals, anybody. Right. And I thought, well, what the heck? And I sent them
- 9:13a proposal and they accepted it. So I thought I was going to be starting up kind of external training
- 9:19right now because that's something I passionately want to do. But it turns out for a little while,
- 9:23I'm writing a book instead. So that's what I'm just starting to do now. And it's really interesting
- 9:28and a little scary. I mean, I've written many books as being a technical writer and I've edited
- 9:33many books, you know, over the years, but it's a whole different world to be writing the official
- 9:39documentation for a technology, to have all the technology experts available to you and to know
- 9:46that people have to read this, right? If we're documenting the API for iOS, well, if you want to use
- 9:52iOS, you're going to have to read the documentation. Now I have to write a book that people don't have to
- 9:58read. So I got to make it really compelling and interesting and, you know, come through on all
- 10:05that. So it's a really different approach and very interesting challenge.
- 10:10Yeah. Well, congratulations on the book. That's awesome. I've heard writing a book is a lot of work,
- 10:16but it's going to be fun too. And you should know, right? It sounds like you've done quite a bit.
- 10:20Oh yeah. Yeah.
- 10:20That's cool. So that's going to be a lot of fun. You can't talk about it yet?
- 10:24Unfortunately not, but I look forward to being able to in a few months.
- 10:27That's really great. So right now you're working on the book and you just left Apple,
- 10:32I guess maybe to give some folks a little perspective, because a lot of what we're talking
- 10:37about is the stuff that you did at the time you were at Apple. Maybe just tell folks what you did
- 10:42day to day while you were at Apple and then we'll get into the topic.
- 10:45It changed a lot. I had this kind of weird career. I was a manager almost from day one in Silicon Valley.
- 10:50It was another one of those things I was mentioning where what happened was I started at Oracle
- 10:55and two months after I started, the person who hired me left. And I went into the director and said,
- 11:01I want to run this team. Now I was like 20 something and I had no experience. I had no right.
- 11:06And he was like, okay, give it a try. And so I became a manager early on. Over time,
- 11:12I ended up running developer publications at Apple for a while. And that meant as an engineering manager,
- 11:19first we created the publication workflow. So we needed to take XML and turn it into the websites
- 11:25and HTML and PDF. And we also needed to parse all the headers and everything and put that all
- 11:31together into the documentation. So I was an engineering manager. Then I was running developer
- 11:35publications, which was really interesting, intense experience at a place like Apple, because
- 11:40basically everything coming down the pipeline for the next couple of years is aimed at you.
- 11:46And you have a certain amount of resources and you have to figure out what you're going to cover and
- 11:51how you're going to cover it. One of the things I really appreciated about the way Apple works is
- 11:56you're expected to know your job. So of course, people have opinions and they may have insights,
- 12:02but for the most part, you are not told what to do. So let's say there are five really important
- 12:08projects coming up. And you can't put a hundred percent on every one of those projects. You can't
- 12:14put your best people on every one of those projects. Part of my job was simply to look at what was
- 12:20coming, look what the impact on developers would be and decide where the resources were going to go
- 12:25and how we were going to accomplish that. An interesting case, for example, was Swift.
- 12:30Chris Latner, who originally created Swift, came to me two, three years before it launched and said,
- 12:37we're working on this language. There are about 25 people who know about it. It was one of the most
- 12:41secret projects in all of Apple. And he said, we don't know when or if this thing is ever going to
- 12:47launch, but I would like you to put one of your best people on it now. And that's an interesting
- 12:53call, right? Because things, projects like that come up all the time. So I mean, oh, I have a new
- 12:57idea for a language or whatever. They don't go anywhere or they kind of half go somewhere and
- 13:01then they drop or whatever. So to decide to put serious resources into something that might never
- 13:06happen, but if it did happen would be really significant. It was an interesting call. And
- 13:11fortunately, I had a good relationship with Chris and I trusted him. And so I did it. And we hired some
- 13:16great people and put them on the project. That's the kind of thing I was doing from day to day.
- 13:21Yeah. Yeah. That's cool. So let me ask you a little bit about Swift. I think there's a lot
- 13:26of interesting parallels in that language with Python. You know, the playgrounds feel very much
- 13:32like a REPL or Jupyter in some sense. The language has a lot of syntactical similarities. The thing I
- 13:39want to ask you is why do you think it was successful? It's not very common that there's some big company
- 13:44like Apple that's standardized on a language and says, you know, we're just going to completely
- 13:49switch our most important stuff to this new API. And I felt like it was an immediate and complete
- 13:55switch when Swift came along. That kind of surprised me, but I think it's a positive one more or less.
- 14:01Why do you think that was?
- 14:02Well, I'll also say, at least for me, and I think for us in general, the immediate adoption and the
- 14:08language was a surprise to us. You can think, oh, a company like Apple, you know, we're going to say
- 14:14do X and everyone's going to do X. No, we could have put out Swift and everyone could have said,
- 14:18we're not going to use it. So we didn't know what would happen. We didn't know if playgrounds would be
- 14:22good. We didn't know. We just had to put it out. And we also knew that it wasn't ready. But one of the
- 14:28great things about Chris was he knew that they had to put out the language before it could be technically
- 14:32completed. Because there was no way on earth we could come out with a 1.0 of Swift without that process of
- 14:40developers using it and providing feedback. In terms of why it was successful, I think that a simple answer is
- 14:48it simply works or it looks much more like programming languages that people are used to. And Objective-C
- 14:55always had that oddness. I mean, back from when I worked at Next before Apple, and so we would go around trying to get
- 15:00people to use Objective-C. And it was the number one barrier to getting Next Step into businesses,
- 15:07because the engineers would look at these square brackets and they'd be like, what is this? We can't
- 15:11possibly teach our engineers this. And it was a huge problem. So I think that when people saw a language
- 15:19that looked like languages they were familiar with, that was a big, big win. And then the fact that it
- 15:25incorporated a lot of really modern concepts. Interestingly, Swift actually made Objective-C
- 15:30better because a lot of the improvements they made to Objective-C were actually in preparation for switching to Swift.
- 15:37This portion of Talk Python To Me is brought to you by Cloudbolt.
- 15:47Friends don't let friends violate PEP 8, nor do they let them spend their days in an unfulfilling work environment.
- 15:52Good news. Your friends at Cloudbolt want your help developing their state-of-the-art cloud management software.
- 15:58Built with Django and ranked as the number one product of its kind, Cloudbolt's looking for talented engineers of all kinds.
- 16:04Located in beautiful Portland, Oregon, Cloudbolt is an hour from the Pacific Ocean and Mount Hood.
- 16:09You're not in Portland? Not a problem.
- 16:11Cloudbolt offers a relocation stipend to the Pacific Northwest and is also hiring solution engineers everywhere.
- 16:17Whether you're interested in containers, hypervisors, or just writing clean performant Python code,
- 16:23Cloudbolt would love to hear from you.
- 16:25Visit talkpython.fm/cloudbolt for more information.
- 16:30So you were at Apple for a long time.
- 16:32It sounds like if you wanted to work there, definitely knowing Swift and Objective-C might be worthwhile.
- 16:37But also, it sounds like there's just quite a rich community of Python programmers there.
- 16:43What advice would you have for people listening to this show who are really mostly passionate about Python if they want to work there?
- 16:51I've run into this, too.
- 16:52I went to my first PyCon this year, and I was talking to someone, and they're like, oh, I had no idea Apple used Python.
- 16:57I might have applied for a job there if I'd known that.
- 17:00I think that it is absolutely a big part of things, especially if you're doing any machine learning or data science, you will be using Python going in.
- 17:08Unfortunately, the big caveat, I have to say, is because macOS ships Python 2.7, that's what's used internally and almost everywhere.
- 17:19Not everywhere, but almost everywhere.
- 17:21And that's going to be a challenge, right?
- 17:24Especially as we hit 2020, especially as pandas and things are dropping support.
- 17:29Yeah, pandas just announced that they're dropping support soon.
- 17:33Right, right.
- 17:34I mean, these things are happening, right?
- 17:36I think in the data science fields, then, you have a good chance of being able to go to 3.
- 17:41And if I were continuing there, I would have really been pushing that.
- 17:44There are a lot of QA people using Python.
- 17:47There's a lot of internal QA Python libraries.
- 17:50And unfortunately, in that case, I don't see it changing anytime soon.
- 17:55And I think part of my discussion today is that I know we're all excited to get to 3.
- 18:00I'm excited to be using 3 now.
- 18:02The shackles are off.
- 18:04Do whatever you want.
- 18:05And I've been listening to a lot of your recent episodes where people are like, okay, finally, we're there.
- 18:10I have to say, we still can't forget about the fact that there are going to be thousands and thousands of developers in these large organizations with huge amounts of built up technologies that aren't going to switch anytime soon.
- 18:23And I think that's interesting.
- 18:28When you have, let's say, when you have a QA library that is highly specific to what your team does and that has been built up over five plus years and has a huge amount of code in it, we can all say, okay, they're dropping support for Python 2, so you've got to move to 3.
- 18:46Where are you going to go?
- 18:50And I think that's a huge amount of time to do that.
- 18:54I think what I would encourage in any organization at this point is don't let yourself get in that trap.
- 19:01If you're going to go to 3.5 million.
- 19:06And if you're dealing with a technology like this, you've got to take responsibility.
- 19:09It's like those projects I was talking about before.
- 19:11Like, go home and start it in 3 and say, here it is.
- 19:16And start, you know, whatever you can do to move it forward.
- 19:18Don't just accept it.
- 19:20Because what I fear in some of these cases is you're going to be another five years down the road.
- 19:26And then you're really not going to have a choice at some point.
- 19:28You're going to have to switch.
- 19:29And you're going to be kind of up a crick.
- 19:32Yeah, you definitely are.
- 19:34You know, I feel like the two big sticks in this debate.
- 19:38There's lots of carrots.
- 19:39But the two sticks.
- 19:41One is security.
- 19:43And sometimes it doesn't matter, right?
- 19:45Like an internal QA testing library probably is not exposed on the internet.
- 19:49It probably is not a security risk, really.
- 19:51But then there's also the new shiny things that you don't get.
- 19:56Right now, the machine learning libraries are Keras, TensorFlow, and so on.
- 20:01But, you know, wait until either they drop two and come along with some really great feature that you almost have to have.
- 20:08Or there's something better that's Python 3 only, right?
- 20:12At some point, there's going to be like, why can't we keep up with this company?
- 20:17Well, they have all the good tools.
- 20:19And we're stuck on these tools that are last generation.
- 20:21But that's not a this week, next week, one year.
- 20:25That's a by the time you realize it, right?
- 20:28That technical debt is bad.
- 20:29Yeah.
- 20:30It's deep, deep, and it takes a long time to get out of it.
- 20:33Here's a funny thing.
- 20:34In the teaching I would do, I would talk about here's how it works in three.
- 20:39Here's what we don't get if you don't move to three, et cetera.
- 20:42I actually think one of the features most likely to get people personally motivated is f-strings.
- 20:49Yeah.
- 20:49They love them.
- 20:50They're great.
- 20:51I actually have a theory that if that feature had been rolled out early on in three and not put into two, they would have had more conversion because it's just one of those things where you're like, I want that.
- 21:01And then that gets you to start making changes, you know?
- 21:04Yeah.
- 21:04It's definitely really much more concise and it's faster, right?
- 21:08Yeah.
- 21:08So there's like, it's good just all across the board.
- 21:10You say faster.
- 21:11I wonder, you know, in some cases, probably faster is going to be a thing as well, right?
- 21:15Like Python 3 is starting to be faster in general, right?
- 21:18So if you can run a quarter fewer servers, you know, 50 instead of 80 servers, I don't know, maybe that starts to add up.
- 21:24But that's a rare, it's a big company problem, not most people's problems.
- 21:28Most people aren't, you know, scaled that far out.
- 21:31In my experience, the scale issues would be mostly in the data space.
- 21:35And so they've already got lots of reasons, right?
- 21:37It's just one more big reason for them to do it.
- 21:40Yeah, for sure.
- 21:40Okay.
- 21:41So let's talk a little bit about this software university thing.
- 21:44You talked a bit about it.
- 21:45How did you end up founding that, the team there?
- 21:48Tell us what it is and then how you got started on it.
- 21:50Yeah.
- 21:50Well, it's the thing I'm most proud of in my career at Apple.
- 21:54And I first have to say, it's not Apple University.
- 21:57There's a thing called Apple University.
- 21:58And people always confuse them, which is my fault because I worked with Apple University.
- 22:04I was big fans of the people there.
- 22:05They teach sort of culture and how to be successful at Apple.
- 22:09And so when I was coming up with the team, I wanted a way to kind of associate ourselves
- 22:14with them and kind of make it clear what kind of thing we were.
- 22:17Unfortunately, then everybody just thought we were Apple University.
- 22:19But Software University was focused on teaching software skills.
- 22:24We do onboarding and teach software skills across the company.
- 22:27And it started out with that weekly program I talked about.
- 22:31The head of software engineering had asked me to put together this program.
- 22:35And we ran it for like 10 years.
- 22:37Literally, me and a colleague, a couple of colleagues in our lunchtimes would do all the work necessary
- 22:42in addition to our regular job to have this weekly presentation.
- 22:45It was very popular.
- 22:47And eventually, you know, after literally 10 years, we I think there was a big performance move.
- 22:52There was a release where they had to the mandate was to improve performance across the board,
- 22:58like 20 percent or 30 percent or something like that.
- 23:00And we said, well, you know what?
- 23:03We have this mechanism.
- 23:05We have this way that we're able to broadcast stuff that everybody likes and uses.
- 23:09We can help you with this.
- 23:11We can do a special program to educate people about what they need to do to improve performance
- 23:16across the board.
- 23:17And so we did a whole bunch of focus topics on that and had real experts across the company
- 23:24doing it.
- 23:25And we put out white papers, which each one of their talks to help out.
- 23:28And that was so impactful that I was then able to say, well, you know, we could keep doing
- 23:34this kind of stuff if you gave us some headcount.
- 23:37And that became Software University.
- 23:39So a very small team, huge impact across the organization, you know, teaching because one of
- 23:46the funny things for a few years after Swift came out and still true in large part is the
- 23:51outside world was using Swift.
- 23:52We were not because we had such a massive, massive code base in Objective-C that, you know, it was
- 23:59going to take a long time to begin that transition.
- 24:02So we're actually in a situation where before each worldwide developers conference, we would
- 24:07run special boot camps to teach the people who are going to be at the conference.
- 24:12Here's what's going on in Swift.
- 24:13Here's what you need to know.
- 24:14Here's the new features.
- 24:15Because they wouldn't personally have been using it.
- 24:18So that really blows my mind.
- 24:20I've seen that before.
- 24:21But it, you know, you think about it, it makes sense.
- 24:23But just from the outside, it doesn't really.
- 24:25Right.
- 24:26Like I've seen that other big tech companies that, you know, have similar technology stacks
- 24:32and whatnot.
- 24:32And what's really surprising is they'll bring in external training companies to teach their
- 24:38own programming language to their people or their own developer APIs to their people.
- 24:44And it's like, how can this possibly be that you work at company X and, you know, someone's
- 24:50coming in to teach you about the premier technology.
- 24:53It's a big group of people, right?
- 24:55And they all come with different skill sets and they don't all work on the same thing.
- 24:58But it's, it sounds like a similar story here.
- 25:00And you also have to realize they're not necessarily all bought in, right?
- 25:04Like, so something like Swift comes along, a small group of people did it.
- 25:07Yeah.
- 25:07They had, it's a very opinionated language and different people have different opinions.
- 25:12And since they have the option of using another language, they may be like, eh, I don't
- 25:16like it.
- 25:16Our team isn't going to use it.
- 25:17And then you have a whole kind of, you know, education and process.
- 25:22Or even if you like it, you might think it won't succeed.
- 25:24So you're not going to mess up your product and your, your thing by choosing this other
- 25:29library or language.
- 25:30All right.
- 25:31So maybe we talk a little bit about your experience teaching Python at Apple.
- 25:35So you had, sounds like you've done a lot of classes there internally.
- 25:39Yeah.
- 25:40Yeah.
- 25:41So what was that experience like?
- 25:42Well, when I started out, I would teach one set of content two ways.
- 25:49So one was for new programmers and one was for experienced programmers.
- 25:53It was the same content, but for new programmers, I would go about half the speed.
- 25:57And over the years, what I learned was that was the entirely wrong approach.
- 26:02The need of experienced programmers versus new programmers and new programmers, at least
- 26:06my students, these were people who were probably not trying to get a job programming.
- 26:11They had stuff in their, in their job that they wanted to solve with programming.
- 26:14Although for QA people, many QA people came in and did manual, what we call black box testing,
- 26:21especially on iOS.
- 26:22Almost with a script and a checklist, right?
- 26:25Yeah, exactly.
- 26:25And for a long time, that was okay because, you know, there weren't that many features,
- 26:29but now that it's cloud and this and that and five zillion apps and, you know, your whole
- 26:34life is on it.
- 26:35And there are many different models of the phone.
- 26:37We could no longer just do manual testing.
- 26:39So people who had never intended to be programmers were suddenly now being required to be a programmer
- 26:44as part of their job.
- 26:45They were also my students.
- 26:47What I found was the goal for new programmers versus experience is very different.
- 26:53I originally thought my job was to give them a survey of like, this is what, here's a
- 26:57little bit of everything in programming.
- 26:58So you have an idea of what programming is about.
- 27:00And by the end, I dropped probably 75% of my content.
- 27:06And I decided, no, the goal is by the time you leave this class, that you're comfortable
- 27:12with the idea of sitting down, starting a Python file and trying to solve a problem, any problem.
- 27:20So that's what I just tried to get to.
- 27:22And so I put a lot more repetition in because I also realized having been programming for
- 27:27so long and writing about it for so long, I would think, okay, we talked about for loops.
- 27:31Now we move on to the next topic.
- 27:33Well, no, you know, they needed it three, four or five times to understand what a for loop
- 27:39was.
- 27:39Because there's different levels to that, right?
- 27:42Like if you're a professional programmer, you just need to learn Python.
- 27:47So you programmed in C# or Java or whatever, and you've for looped it to death, right?
- 27:53You know, the concept of the for loop perfectly.
- 27:56It's just like, okay, well, how does the syntax work?
- 27:58And what are the gotchas?
- 27:59You're good, right?
- 28:00Like you can get that really quick.
- 28:01But if you're like, well, I got to do this a lot.
- 28:04And I don't want to just write it over and over.
- 28:06Like the whole idea even of a loop, that's a different thing.
- 28:11And that's where the repetition, I think, is super, super important.
- 28:14Because maybe you take one slice of that onion each time through, and eventually you get the
- 28:19whole concept.
- 28:20Yeah, yeah.
- 28:20So that is where I ended up.
- 28:22The other thing I started doing right toward the end that was really successful, to my surprise,
- 28:26is different classes go at very different speeds.
- 28:29So I would have people who just couldn't even get through all the material because the people
- 28:33in the class needed a lot of time.
- 28:34And I would have another class, still a new programmer, that would just zoom through the
- 28:37material.
- 28:38And I'd be kind of like, well, okay, we're done for the day.
- 28:41Go home.
- 28:41And people are like, well, what?
- 28:43We've got another hour or two left in the class.
- 28:46And so what I started doing was saying, okay, we're going to do bonus topics.
- 28:49Does anyone have a question?
- 28:51Or I would even start to teach one of the experience topics or something.
- 28:55Because someone would ask about regular expressions, which I had stopped teaching to new programmers.
- 28:59And I'd say, okay, let's talk about regular expressions.
- 29:01And that turned out to be really valuable.
- 29:04People really appreciated that because they were, first of all, they seemed to really enjoy
- 29:10the fact they could ask any question and I could answer it because I'd been spending so
- 29:14long doing this stuff and I'd developed so much content.
- 29:16And it let them see things that they wouldn't normally see.
- 29:20So that was interesting.
- 29:21It's that combination then of repetition and not teaching too much, but also being willing
- 29:26to satisfy their curiosity and spend a good deal of time just talking about whatever the
- 29:31students wanted to talk about.
- 29:32Yeah, I think that's a good point.
- 29:33Basically, any presentation and teaching training is like a really long presentation, right?
- 29:40Leaving some room for a little bit of slack for exploration, right?
- 29:46Like, I'm going to show them all this stuff, but let's leave five minutes here in like a
- 29:51conference speech or let's leave an hour at the end of this week so that when they say,
- 29:55that's great, but I want to put that on the web.
- 29:58How does that work?
- 29:59Or, you know, I actually need to work with CSV files.
- 30:03How does, is that possible, right?
- 30:05Like, well, actually import, you know, dictatorator, right?
- 30:09So things like that.
- 30:10I think that's a huge value.
- 30:12It often gets lost because you're like, well, we've got to cover all these things.
- 30:15Yep.
- 30:15Yep.
- 30:16And then for experienced programmers, the goal I developed was, of course, a lot of times
- 30:20they are just coming in wanting to know how does a for loop work in this and how to,
- 30:23and my goal was to kind of trick them into saying, okay, I'm going to teach you Python.
- 30:29But what I really focused on was teaching them to be Pythonic and really getting across like,
- 30:34don't do that thing where you learn a little bit of the language over the weekend and then
- 30:39you never really know how it works.
- 30:41And I can't tell you how many times people who had been using Python for a while would
- 30:45take the class and they'd say, oh my God, I never actually understood what a comprehension
- 30:50was before.
- 30:50I was just copying and pasting these things.
- 30:52I didn't really know what they did.
- 30:54Now I understand what they do.
- 30:55And that, so that was my goal was to get them to actually understand it.
- 30:58And also to use things like comprehensions, which as I'm sure you've experienced non people
- 31:05who've not immersed themselves in Python don't end up using something like that because it's
- 31:09not, it doesn't exist in where they came from.
- 31:11Right.
- 31:12If you don't, you don't change your mindset.
- 31:14Yeah.
- 31:14You don't even know this is now a tool in your toolbox or when it applies, right?
- 31:18Same with generators.
- 31:19I have to believe that generators are out there in other languages,
- 31:22but I never ran into that myself.
- 31:24And so I would have to spend a lot of time explaining not only what they were and how
- 31:29they worked, but like why you would want to use these.
- 31:32And of course, if you're dealing with large amounts of data, that can be a really critical
- 31:36feature.
- 31:37I think generators and generate expressions and all that are, they're just like magic and
- 31:41people haven't taken the time to get to know them.
- 31:44Like you say, if they're doing anything with lots of data that coming off of the network,
- 31:49it's coming off of disk, like it, it can just make all the difference.
- 31:52Yeah.
- 31:53There's some other languages.
- 31:54I think maybe even JavaScript is getting it.
- 31:57I haven't been tracking the new JavaScript that much, but I heard something about, about
- 32:01that.
- 32:02But anyway, it's, it's out there some other places, but I, it definitely is really well
- 32:06embraced in the Python language.
- 32:07Right.
- 32:07I think that's great.
- 32:08Yeah.
- 32:09There was a recent article blog post, whatever you call it by somebody who said, I can't remember
- 32:16what the name of it was.
- 32:16Something to the effect of like eight reasons.
- 32:18I hate Python and I'm just going to say it.
- 32:20I hate Python, something like this.
- 32:21And it was, it was basically the prototypical example of the person that you described not
- 32:28going through the process.
- 32:29Right.
- 32:29Right.
- 32:30They had to work in Python and they really just liked C and some other languages that
- 32:37were basically C languages and they just learned enough to make it work.
- 32:42Right.
- 32:42They're like, okay, well I have to type this to get the library.
- 32:44I have to type this to, but they didn't actually bother to, to learn.
- 32:48Learn very much about any of those features.
- 32:49So they're like, this thing completely sucks.
- 32:51The way that you import stuff is horrible.
- 32:53I don't know where stuff comes from.
- 32:55It's like, well, there's a different way you can do it.
- 32:59You don't have to do imports, you know, from this import star, there's other options.
- 33:03Right.
- 33:03But it was, it was basically, this person was really frustrated with Python because they
- 33:08had said, well, look, Python is easy.
- 33:10I'm going to learn it in the weekend.
- 33:12I'm going to learn it really quickly.
- 33:13But soon as I get it to work, I'm going to stop investigating.
- 33:17As soon as I get something that works.
- 33:18And I think that's actually a little bit of, a little bit of the language is curse of
- 33:22its success, right?
- 33:24Like you can get a cursory understanding of it quickly, but then if you don't keep going,
- 33:29you actually miss why people like it.
- 33:31Right.
- 33:31And I would say for myself, the feature that I really just started using more and more,
- 33:37and the more I understood it, the more problems it solved is the exception handling.
- 33:41I wish there was a different phrase than even exception handling, because that implies, oh,
- 33:46this is just what you do to deal with errors.
- 33:48When the more you absorb the full set of features around exception handling, the more you start
- 33:54to realize, no, I can really solve code problems and structure my code around this in ways that
- 34:00other languages just don't allow for, right?
- 34:02The fact that you can basically return any kind of value in an exception allows you to
- 34:09do just really great things that if you just think of it as, oh, this is what I have to
- 34:14do when there's some error that might show up.
- 34:16You'll never do those things.
- 34:17Yeah, absolutely.
- 34:18And the more subtle stuff like with statements and context managers for sort of durability
- 34:24and all those kinds of things.
- 34:25Absolutely.
- 34:25This portion of Talk Python To Me is brought to you by Rollbar.
- 34:31Got a question for you.
- 34:33Have you been outsourcing your bug discovery to your users?
- 34:36Have you been making them send you bug reports?
- 34:38You know there's two problems with that.
- 34:40You can't discover all the bugs this way.
- 34:42And some users don't bother reporting bugs at all.
- 34:44They just leave, sometimes forever.
- 34:46The best software teams practice proactive error monitoring.
- 34:50They detect all the errors in their production apps and services in real time and debug important
- 34:55errors in minutes or hours, sometimes before users even notice.
- 34:59Teams from companies like Twilio, Instacart, and CircleCI use Rollbar to do this.
- 35:04With Rollbar, you get a real-time feed of all the errors so you know exactly what's broken
- 35:09in production.
- 35:10And Rollbar automatically collects all the relevant data and metadata you need to debug the errors
- 35:15so you don't have to sift through logs.
- 35:17If you aren't using Rollbar yet, they have a special offer for you.
- 35:20And it's really awesome.
- 35:21Sign up and install Rollbar at talkpython.fm/Rollbar.
- 35:25And Rollbar will send you a $100 gift card to use at the Open Collective, where you can
- 35:31donate to any of the 900 plus projects listed under the Open Source Collective or to the
- 35:36Women Who Code organization.
- 35:37Get notified of errors in real time and make a difference in Open Source.
- 35:41Visit talkpython.fm/Rollbar today.
- 35:46When you're teaching the class, you said you use Jupyter.
- 35:50I want to tell people a little bit about how that works.
- 35:52Yeah, I actually, this came out of going to the PyCon.
- 35:56I knew about Jupyter, IPython, et cetera, but I'd never really got around to playing with
- 36:02it.
- 36:02And then when I saw, I took some tutorials there.
- 36:04And when I saw how it was being used, I was like, oh my God, I have to use this in class.
- 36:08And I literally went that evening from the conference and rewrote all my material in Jupyter.
- 36:14And now I've become obsessed.
- 36:17I basically, I write my website in Jupyter.
- 36:19I do my coding in Jupyter.
- 36:22And I've written my own conversion scripts to produce things in HTML and that sort of thing.
- 36:28And I've just found it to be this amazing environment.
- 36:31And I'm also a big fan of Markdown.
- 36:35And I think that Jupyter is a great way to get more use out of Markdown because what
- 36:40people would typically do, and this is where you end up with restructured text and all that,
- 36:43right, is they just keep adding features.
- 36:45And the brilliance of Markdown is simplicity.
- 36:48And if you start adding more and more tags to it, you lose the benefit.
- 36:52Jupyter, because each cell, you can put tags in there and do other things.
- 36:56You can put a structure on top of the Markdown.
- 36:58So for example, what I'll do is I will add a tag to a cell that says center.
- 37:04And then when I output the HTML, I center that content.
- 37:07Well, I didn't have to add to Markdown some kind of center tag.
- 37:10And so Markdown does what it does.
- 37:13Jupyter does what it does.
- 37:15And I just find the combination to be really brilliant.
- 37:18And I think one of the reasons I'm so passionate about it is because I spent my career dealing
- 37:23with documentation formats and creating formats, you know, creating templates in XML and such.
- 37:30So what I saw how hard it is to do a simple format is almost impossible to design a simple
- 37:37documentation format because the minute you have customers start using it, they start saying,
- 37:41oh, well, I want you to add this and I want you to add that.
- 37:44And I spent a lot of my career saying no to writers.
- 37:47We're not going to give you that because we give you that.
- 37:49It's going to cause this problem and this problem later down the track.
- 37:52So when you look at that combination or you like you look inside a Jupyter file and see
- 37:57that it's just a JSON file, a very simple JSON format that is extremely easy to parse, you
- 38:02realize this could only happen by one or two people doing this thing and then not letting
- 38:07themselves get sucked into adding all these features that would then turn it into a mess.
- 38:13Right.
- 38:13They didn't try to write Word for Python.
- 38:15Yeah, exactly.
- 38:16They just tried to create this nice little notebook format.
- 38:19That's cool.
- 38:21I think, I do think there's a lot of value for using Jupyter notebooks.
- 38:25It must be nice to have as like class handouts, like here's the notebook that we went through
- 38:30because it lets, you know, it's great to have like a PDF of the slides, right?
- 38:34Okay, super.
- 38:34I can type that back in or get it somewhere.
- 38:37But, you know, the Jupyter version, you get to explore.
- 38:40Right.
- 38:40It solves many class problems for me because I used to, I have the students using Sublime
- 38:45Text usually.
- 38:46I like Sublime Text for teaching because in addition to having good syntax coloring and general good
- 38:51Python support, it shows the results of the script in line, which is most other things
- 38:57you use, you know, it either a DB editor or something's going to pop up a different window
- 39:01or people have to look somewhere else for the results.
- 39:03So Sublime Text is really good for students.
- 39:05And I was teaching with Sublime Text live, but then someone would ask a question and I'd had
- 39:10to comment out some of the code and put in some new code.
- 39:13And then especially for new programmers, they would have no idea what was going on because
- 39:17I'm changing around everything.
- 39:18When I moved to Jupyter and someone asked a question and I can just enter a new cell and
- 39:24put the code in and run it, it solves so many problems.
- 39:28So it's really elegant for teaching.
- 39:29Yeah, it definitely seems like it.
- 39:31I mentioned earlier that I felt that the Playgrounds was something like Jupyter, the Swift Playgrounds.
- 39:38Do you think if Jupyter had been something that, say, Chris Lattner and folks had been playing
- 39:44with already and maybe had a little more traction, do you think Swift Playgrounds would not exist?
- 39:48And there'd just be a Jupyter version that ran Swift?
- 39:51It's a good question.
- 39:53And I know that I've seen there's at least a couple of projects out there of people working
- 39:56to get Swift integrated into Jupyter.
- 39:59I know, I mean, Chris and company were experts on all sorts of languages.
- 40:04And I know that there were various influences on Playgrounds.
- 40:08I guess the way I'll answer your question is I would say if I had known about Jupyter at
- 40:13the time when our department got to be somewhat involved in the process of designing Playgrounds
- 40:19because it was in part a documentation feature.
- 40:22And so we worked with them on all that.
- 40:25I think if I had been aware of it, I certainly would have pushed for more of that because I
- 40:31feel that that simplicity would be served.
- 40:33However, it may not have been the right thing for Apple.
- 40:36An important thing about something like Playgrounds is that the fact that you can run these really
- 40:41cool little games and other things and show visually what's going on there, that's a really
- 40:45helpful thing to promoting the language and promoting the learning aspect of it.
- 40:49So, you know, you have other concerns that you have to think about.
- 40:53Yeah, of course.
- 40:54So you've had a lot of experience at these large tech companies working with Python.
- 41:00And we talked a little bit about the two and three divide and some of that technical debt.
- 41:06You had a story about converting from one language to another back in the publishing days.
- 41:12Tell us a bit about that.
- 41:13Well, so we had this whole publication workflow and we decided to do the next big jump, right?
- 41:22And we wanted to get out of Perl and we wanted to fix all the problems, you know, that you
- 41:28have when you have a big thing that's been running for a long time.
- 41:30You just think if we could just write this from scratch, it would be all the problems would
- 41:34be gone.
- 41:34It'd be perfect.
- 41:35I made every mistake and I've learned now that this is a pattern, right?
- 41:39And it's a pattern that I warn people about, which is, okay, well, yeah, we're just going
- 41:44to write the new thing.
- 41:44And then what we will do is because in the meantime, we have to keep things publishing every day,
- 41:51we'll write a bridge script.
- 41:54So it will bridge from the previous stuff, you know, the previous version of the content,
- 41:59source content to the new version.
- 42:01And then at some point, we'll just cut off the bridge and we'll go forward with the new
- 42:06stuff.
- 42:06That's not how it works.
- 42:09And what happens is when you have an enterprise level production workflow that's been around
- 42:16for a long time, there are hundreds or thousands of edge cases in business cases that have been
- 42:23built in or bolted on or whatever to fix all sorts of problems.
- 42:28When you write the new thing from scratch, you're rediscovering all of those.
- 42:33So what happens is you start saying, well, we'll have the bridge script fix those things.
- 42:39Well, the bridge script is supposed to go away, but it starts becoming the biggest part of the
- 42:44project and it starts taking up all of your time.
- 42:46And now you're doing duplicate work often because some new feature will come along and you have to
- 42:49put it in your old production workflow because you're still using that.
- 42:52And you have to put it in your new one or you have to do something.
- 42:54And so the end of the day, we had this great new version of our workflow.
- 42:59The HTML output was wonderful.
- 43:01It was a huge improvement.
- 43:02And I had to kill the project because every time you clicked around, every third or fourth
- 43:07link would crash this thing because it couldn't deal with all of those edge cases and everything.
- 43:15And so at the end of the day, what I learned, and I think a lot of people have learned this,
- 43:19is if you have a large enterprise level workflow, accept it.
- 43:23You have it.
- 43:24Your only option is to gradually convert it piece by piece.
- 43:29Find ways to isolate certain pieces of functionality and then upgrade that portion of it and do it
- 43:36piece by piece.
- 43:37But don't think that you're going to be able to run two different workflows and then switch
- 43:40from one to the other.
- 43:41Maybe someone out there has made it work, but I think it's a recipe for disaster.
- 43:45And it's one of the biggest mistakes I ever made.
- 43:48That sounds really not so good.
- 43:50So you had the Perl one before and you tried to switch it over to Python through this bridge
- 43:56thing, right?
- 43:56No, we weren't doing Python.
- 43:58I even forget what it was we were switching it to at the time.
- 44:01This was before Python was a factor.
- 44:03Sure.
- 44:03So, but if that one got canceled, did you just go back to the Perl one or is there now
- 44:07something new?
- 44:08Well, I haven't been doing that for a long time and I know, I think they finally did do
- 44:12a whole new production workflow.
- 44:13But yeah, we were stuck with the Perl for another five plus years.
- 44:18And it wouldn't surprise me if there's still a bunch of it in there because, you know, it's
- 44:23really hard to get rid of all that.
- 44:24Then you get into the situation.
- 44:25I think this is where we're headed with Python 2 as well, where you start having to ask engineers
- 44:31to join your team or join your company to do something like Perl, right?
- 44:37And you get fewer and fewer people who know how to do it and you get fewer and fewer people
- 44:41who want to do it.
- 44:42I'm always going to do this classic joke.
- 44:44If you've heard this of the guy who's a COBOL programmer and he was so sick of everybody hiring
- 44:48him for COBOL because there weren't COBOL programmers around that he had himself frozen so that in
- 44:53the future he could have a different career.
- 44:54And when he's unfrozen and wakes up, you know, Bill Gates is standing over him and he's like,
- 44:59oh, Bill, great.
- 45:00What can I do for you?
- 45:01And Bill's like, you're the guy who knows COBOL, right?
- 45:03Exactly.
- 45:04Yeah, I can totally see that.
- 45:06And there are so many projects that are stuck in these old languages, you know, BB6 even.
- 45:14There's so much in the enterprise space that people put together.
- 45:17Really complicated.
- 45:18And there's better paths forward.
- 45:20But I think it is all these little tiny details, right?
- 45:24You know, it's one thing to say, well, it has to do X, Y, and Z.
- 45:28It's like, well, but there's like a hundred little bizarre tweaks that we catch it under this
- 45:33circumstance or we do that differently if it's from that department or whatever, right?
- 45:36It's crazy.
- 45:36Yeah.
- 45:37Well, I definitely think there's going to be some good consulting opportunities for people
- 45:42that know how to take Python 2 code to Python 3 code.
- 45:46I don't know when the peak of that opportunity will be, but, you know, maybe spring 2020 or
- 45:53after the first really bad security problem found, it's Python 2 that's not going to be fixed.
- 45:58But like this COBOL programmer type person, having those skills and knowing how to do that
- 46:03switch actually might be really valuable.
- 46:05In the meantime, what people can do, and I started pushing this really heavily in my experience
- 46:09classes, is start using Python 2 like 3.
- 46:13You know, use the features that were backported, especially for dictionaries and such.
- 46:18As near as I could tell, I could rarely find a tutorial or a book that talked about the features
- 46:23that had been added, say, to dictionaries after the fact that turned them into the same
- 46:28thing that they do in 3, right?
- 46:29So it's where you're getting those different objects.
- 46:33Instead of getting a list, instead of everything being a list, you're getting the objects back
- 46:38that don't take up memory and such.
- 46:41Like X range and that kind of stuff, right?
- 46:43Yeah.
- 46:44And in the dictionaries they have, what they have is for each thing, if you ask for values
- 46:47or keys, there's another method, which at the moment now I'm spacing on it, which will,
- 46:52instead of giving you a list, will give you what you would get in Python 3.
- 46:56And so that's an easy way, because I think that's some of the code that is most problematic,
- 47:00right, are things that are relying on you getting a list back, and it's no longer a list in Python 3.
- 47:05So some of the easiest ways to future-proof your code is just to use those things when they're
- 47:10available.
- 47:10Yeah, for sure.
- 47:11So on these big projects, do you think you can test your way through that?
- 47:17Like, if you could imagine every single case that is like one of these weird edge cases,
- 47:23and you just wrap up the app and you feed it the inputs and you check the output, possible?
- 47:27Reasonable?
- 47:29I think it's great if a team has been disciplined enough to do that.
- 47:34And there are times when I, like anybody, well, I really like unit testing.
- 47:38I literally like test-driven development.
- 47:40I fall in and out of it, as I think most engineers do.
- 47:43But when I was really good, especially on projects like when I created, say, a CSS parser,
- 47:47and so for every single feature that I would put in tests, then my parser wasn't very fast,
- 47:54so my team got annoyed about that.
- 47:55And one of them did to me what I did to people, which is went home and wrote a faster version.
- 48:00But because I had put a test in for every single feature, we were able to just swap in the new code with no problem.
- 48:07Right.
- 48:07Run it.
- 48:08Does it pass?
- 48:08Good.
- 48:09Yeah.
- 48:09But I would argue it's, I think it's getting more common as people have gotten better about this,
- 48:14and testing functionality has gotten integrated into the languages and frameworks.
- 48:19It's relatively rare that people have done that amount of testing.
- 48:22Yeah.
- 48:22That's probably true.
- 48:24All right.
- 48:26Well, it's definitely an interesting problem.
- 48:27And I know a lot of people have it both trying to cross languages,
- 48:30and we're going to have it with this 2 to 3 thing that's coming.
- 48:34I do think it's less bad with 2 to 3.
- 48:37It's not like you're starting completely from scratch.
- 48:40I mean, you may decide to start from scratch with Python 3 and rewrite the thing,
- 48:45because that's both tempting and sometimes the right way to go.
- 48:48But at least it's more of an upgrade, like it's a really big upgrade to your project,
- 48:53rather than you can't add Python to Perl progressively to it, right?
- 48:59I think there's the same risk, which is if you don't spend some time truly learning
- 49:03what's different about 3 and the philosophical changes to deal with memory usage
- 49:09and such more generators everywhere, that kind of stuff.
- 49:12If you start converting your code without philosophically understanding the differences,
- 49:16then you're not going to get the benefits from 3.
- 49:19And you may not even realize some of the stuff that you need to change.
- 49:22Yeah, that's a good point.
- 49:23It's very similar there.
- 49:24All right.
- 49:25Well, you've done all this cool stuff at Apple, and you've been there for a long time,
- 49:28and you hear a lot of good things about the company,
- 49:32but leaving and breaking on your own, that's a pretty big step.
- 49:35I know from personal experience, it's a big deal.
- 49:38What was the decision making there?
- 49:40Yeah.
- 49:41Well, it was great working at Apple.
- 49:43I had a great career there, and people were very supportive of me
- 49:47and let me do all these wonderful different things.
- 49:49And actually, I feel a little unfortunate that there's been some stock hits recently and stuff.
- 49:56So people have been saying to me, oh, you're getting out because of that.
- 49:58And it's like, no, no, no.
- 50:00Actually, if anything, that would make me want to stay because as one of the people
- 50:03who's been around a long time, you know, I have experience with the ups and downs of things.
- 50:07It's been a lot lower historically at some point.
- 50:10Oh, yeah.
- 50:12So every once in a while in your job, something comes up that's a little annoying,
- 50:16and you think about things.
- 50:17And I realized, oh, it has been 25 years.
- 50:22And oh, I'm really loving this Python stuff, and I want to be part of the community.
- 50:27And for all the wonderful things at Apple, the way it works right now is that you kind
- 50:32of have to be invisible when you work there.
- 50:34You know, you're not really allowed to speak, or you have to do a lot of work to be able
- 50:38to speak.
- 50:38You know, you can't necessarily write articles or write a book or whatever.
- 50:42So realizing that, okay, I've been here 25 years.
- 50:46This is a really nice career progression.
- 50:47I want to be a part of the Python community.
- 50:49So I want to be able to be on a podcast, for example, and write a book.
- 50:55And also, honestly, to say, you know, well, if this is what I'm going to spend the next
- 51:00chunk of my career on, yeah, I want to be working in the latest, greatest stuff.
- 51:04And I felt personally that my responsibility, if I stayed, would be to put a lot of time and
- 51:10effort into, you know, some of your other episodes have covered getting the whole organization
- 51:15to switch.
- 51:16And I've been through those conversions many times in my career, and it's just not what I
- 51:21wanted to focus on.
- 51:22I just wanted to make the jump.
- 51:24And so you combine all those things, and it's like, yep, this is the right time to
- 51:27do this.
- 51:28Yeah, it's definitely a good time to switch into Python.
- 51:30It's, you know, so much energy, and it's definitely building.
- 51:33And I can relate to a lot of those things.
- 51:35You know, I worked at many small companies, but also at a large company.
- 51:39And I just, for me personally, I just decided, you know, every day I get up and I go to these
- 51:44meetings and I work on these features and these projects.
- 51:47And there's a non-trivial chance this project is getting killed.
- 51:51I'm pretty sure this feature is not actually going to make a difference to anybody, you
- 51:55know?
- 51:55And I just thought, well, is that kind of stuff what I want to put my energy into every
- 51:59day?
- 52:00Like, what if I could wake up every day and work on what I think is going to be most valuable
- 52:05to the community or people or customer, whatever, right?
- 52:08Like, that would be really great, right?
- 52:10So that's kind of what gave me a similar boost is just like, I feel like maybe I'm giving
- 52:15like 20% of what I could to the world at my job.
- 52:18Right, right.
- 52:18Not because I'm not trying, but because I'm being told to work on X, Y, and Z.
- 52:22And like, only Z is like partially valuable, right?
- 52:25Yep, exactly.
- 52:26Yeah.
- 52:26Interesting.
- 52:27Okay, so you're starting off on this journey to do training, teaching, and your sort of own
- 52:33thing.
- 52:34How can people, you already have some classes that you're teaching, right?
- 52:36Yeah, I am definitely set up, as it happens, both in Python 2 and 3, to do the general new
- 52:42programmers and experienced programmers.
- 52:43And the same focus I talked about, for new programmers, it's just getting them comfortable
- 52:48with what programming is and that they can solve problems and kind of setting them up to learn
- 52:53more.
- 52:54And with experienced programmers, it's really teaching them how to be Pythonic and how to
- 52:58use the language the right way.
- 53:00Nice.
- 53:00And where can people find out about it?
- 53:01So I have a site, which I'm still kind of, you know, working on getting up to speed.
- 53:06But that is conquerprogramming.com.
- 53:08So I like the concept of conquer programming by learning Python.
- 53:12And they can go there.
- 53:14And I'm on Twitter as conquerprogram1.
- 53:17There was some other conquer program out there.
- 53:20And that will do it.
- 53:21Nice.
- 53:21Okay, yeah.
- 53:22So people can check that out if they're interested.
- 53:23That's great.
- 53:24All right.
- 53:25Well, I guess we'll probably leave it there for the teaching at Apple topic.
- 53:30And I'll just ask you the final two questions.
- 53:32So if you're going to write some code, and based on what we talked about, I may have two good
- 53:38guesses.
- 53:38But what editor do you use for Python anyway?
- 53:42So basically, I have three answers, right?
- 53:43Sublime Text I use in classes, at least for students.
- 53:46PyCharm I use if I really am needing to solve some bigger problems and use more of the profiling
- 53:53and debugging sorts of stuff.
- 53:55As you can guess, at this point, my day to day coding and what I'm doing all my personal
- 54:00stuff in is Jupyter.
- 54:01Because I actually find it to even be a good development environment.
- 54:05Because everything is in memory, when I'm having a problem, I just, I can interact live with what's
- 54:12going on.
- 54:12It's like a super debugger, right?
- 54:14You can just go, what is X?
- 54:15And I love the fact that I can have actual documentation and links.
- 54:20So I think now, if I were doing team development in Python, I would seriously consider having
- 54:26the source be in Jupyter with actual documentation and actual links, and even things like screenshots.
- 54:30So you can actually put in screenshots to show what it is that you're dealing with, say, on
- 54:34a web page or something like that.
- 54:35And then if necessary, just export it to Python to be run on a day-to-day basis, but do the
- 54:41actual source in Jupyter.
- 54:42So I know that there are then challenges about importing things and other stuff.
- 54:46So there'd be things to figure out.
- 54:48And I know that there's these JupyterLab and other stuff, which I haven't played with yet.
- 54:51But that's definitely where I'm at.
- 54:53And that's an interesting idea.
- 54:54OK, notable PyPI package?
- 54:56Well, I was thinking about what made the biggest difference.
- 54:59And so in Python 2, the biggest difference to me was a package called Unipath, because it
- 55:04brought all the file functionality under one class.
- 55:06And so you didn't have to have three different libraries and different APIs.
- 55:10And it really cleaned up my code.
- 55:12And I know they proposed it.
- 55:14There was like a PEP for it at one point.
- 55:16It got turned down.
- 55:17And now there's Pathlib, which is part of Python 3.
- 55:22So I guess I would just say, if you're doing all the file stuff, I really would consider
- 55:26looking at Pathlib, because it just cleans up your code a lot.
- 55:30And it's a much nicer way to deal with things.
- 55:32Yeah, that's a good recommendation.
- 55:34And way to grab one out of the standard library.
- 55:35That also works.
- 55:36So the other thing that I've started pushing in my experience classes when getting to the
- 55:41data science stuff is in figuring out how to teach pandas, I started splitting out series
- 55:46and teaching that first as kind of a fancy list and dictionary.
- 55:49And then a data frame just becomes a dictionary of series.
- 55:52And it was easy for the students to absorb.
- 55:54And I started to realize, you know, as far as I'm concerned, I think the series class should
- 55:59be thought of as more of a general case problem solver, because it's a dictionary and it's
- 56:05a list and it does things really fast.
- 56:06And it takes regular expressions, which is huge when you're doing a lot of the tech stuff.
- 56:10So I've started pushing the idea of, hey, don't think of series as a spreadsheet thing.
- 56:19Think of it as a really useful list class that you could use for anything.
- 56:23So that's the other notable thing.
- 56:25Yeah, very interesting.
- 56:27I definitely like the Pathlib stuff these days.
- 56:29I'm starting to really appreciate it and think about, you know, ditching os.path and all
- 56:34because of the fluent API, the chaining, right?
- 56:37Like create a path, dot, rename, you know, dot ensure the parent stuff, all that kind of
- 56:43like all in one line.
- 56:44It seems really, really clean.
- 56:45So yeah, I like that recommendation as well.
- 56:47All right.
- 56:48Final call to action.
- 56:48People are out there learning Python or they want to teach Python.
- 56:52You know, what advice do you have for them?
- 56:53Well, I think I'm going to come back to a theme of this whole thing, which is if you're in an
- 56:58organization that's in Python 2, you've got to take personal responsibility to do something
- 57:04about it.
- 57:04Either get your organization to change or think about your own role in that because do you want
- 57:09to be in a 10-year-old version of the language for the next five years or more?
- 57:13You know, coming from where I'm coming from, that's sort of the biggest thing for me.
- 57:17I think the one other thing I would say in terms of teaching is one of the things I'm
- 57:22evolving towards and working on in this book I'm working on is I kind of think that teaching
- 57:27new programmers programming is almost the wrong thing.
- 57:31And for many people, they're not there to become a programmer.
- 57:36They're there because they have stuff in their work life that they want to improve and they want
- 57:42a new tool to do it.
- 57:44And I think that if we focus more of our teaching of new programmers around, hey, here's a problem
- 57:51you can solve.
- 57:52And by the way, along the way, you're going to learn some programming.
- 57:54That's a much more practical way to do it.
- 57:57One of the books I really like along those lines is the Automate the Boring Stuff with Python,
- 58:01which is very focused on that and influential to me.
- 58:04So even though I teach a generic learn how to program class, more and more I'm moving away
- 58:09from that and I'm going to focus on helping people solve specific problems.
- 58:12Yeah, unless you're committed to a four-year computer science degree, you need those short
- 58:18little wins.
- 58:18It's not like, well, this year I'm going to learn all about loops and data structures.
- 58:22Next year I'll do something with it, right?
- 58:24Yeah, exactly.
- 58:24That's not reasonable for most people, especially if it's a week-long class or something online
- 58:29for a few hours or something like that.
- 58:31I totally agree.
- 58:32All right, Ron.
- 58:34Well, thank you for sharing your experience and your story.
- 58:36It's really interesting.
- 58:37Appreciate you being on the show.
- 58:38Thank you very much.
- 58:40This has been another episode of Talk Python To Me.
- 58:43Our guest on this episode was Ron Hayden, and it's been brought to you by Cloudbolt and Rollbar.
- 58:49Spend your work time fulfilled.
- 58:51Write Python and Django code at Cloudbolt, developing their state-of-the-art cloud management software
- 58:56in beautiful Portland, Oregon.
- 58:58Visit talkpython.fm/cloudbolt to join the team.
- 59:02Rollbar takes the pain out of errors.
- 59:05They give you the context and insight you need to quickly locate and fix errors that might have
- 59:10gone unnoticed, until users complain, of course.
- 59:12Track a ridiculous number of errors for free as Talk Python To Me listeners at talkpython.fm slash
- 59:18rollbar.
- 59:19Want to level up your Python?
- 59:21If you're just getting started, try my Python Jumpstart by Building 10 Apps course.
- 59:26Or, if you're looking for something more advanced, check out our new async course that digs into
- 59:31all the different types of async programming you can do in Python.
- 59:34And of course, if you're interested in more than one of these, be sure to check out our
- 59:38everything bundle.
- 59:39It's like a subscription that never expires.
- 59:41Be sure to subscribe to the show.
- 59:43Open your favorite podcatcher and search for Python.
- 59:45We should be right at the top.
- 59:47You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 59:51and the direct RSS feed at /rss on talkpython.fm.
- 59:56This is your host, Michael Kennedy.
- 59:58Thanks so much for listening.
- 59:59I really appreciate it.
- 1:00:00Now get out there and write some Python code.
- 1:00:02Bye.
- 1:00:03Bye.
- 1:00:04Bye.
- 1:00:05Bye.
- 1:00:06Bye.
- 1:00:07Bye.
- 1:00:08Bye.
- 1:00:09Bye.
- 1:00:10Bye.
- 1:00:11Bye.
- 1:00:12Bye.
- 1:00:13Bye.
- 1:00:14Bye.
- 1:00:15Bye.
- 1:00:16Bye.
- 1:00:17Bye.
- 1:00:17Bye.
- 1:00:17Bye.
- 1:00:17Bye.
- 1:00:17Bye.
- 1:00:17Bye.
- 1:00:18Bye.
- 1:00:19you
- 1:00:19Thank you.
- 1:00:21Thank you.
- 1:00:22Thank you.