WEBVTT

00:00:00.001 --> 00:00:01.320
Talk Python To Me.

00:00:01.320 --> 00:00:04.980
Episode number four, with guest Mahmoud Hashemi.

00:00:04.980 --> 00:00:08.020
Recorded Tuesday, April 7th, 2015.

00:00:08.020 --> 00:00:38.000
Music by Ben Thede

00:00:38.000 --> 00:00:45.680
You may have noticed that we have new intro music for this show.

00:00:45.680 --> 00:00:49.880
If you're a fan of the Developers, Developers, Developers music by Smix,

00:00:49.880 --> 00:00:52.300
don't worry, he's not gone. He'll be back next time.

00:00:52.300 --> 00:00:57.680
However, I chose this music for this show because it's actually not a performance,

00:00:57.680 --> 00:01:03.780
but rather sounds from an auditory experience for Wikipedia called Listen to Wikipedia.

00:01:04.380 --> 00:01:08.020
This is a project written in Python by our guest, Mahmoud.

00:01:08.020 --> 00:01:10.080
We'll talk a little bit about that during the show.

00:01:10.080 --> 00:01:14.900
The sounds you hear corresponds to edits, additions, and deletions to Wikipedia.

00:01:14.900 --> 00:01:20.080
Reading off a few of the topics that cause those sounds are kind of random, but here they are.

00:01:20.260 --> 00:01:29.340
Asphalt, Geography of Peru, Subobject, Fox, 2013 European Olympics, Pretty Little Liars, and Carrie's Grammar School.

00:01:29.740 --> 00:01:35.160
If you need some sweet Zen sounds to program to, or are just interested in this project,

00:01:35.160 --> 00:01:44.000
check it out at listen.hatnote.com and experience Python and Wikipedia and audio all wrapped up into one for yourself.

00:01:44.000 --> 00:01:49.280
That's listen.hatnote.com.

00:01:49.280 --> 00:01:50.720
Now, on to the show.

00:01:51.400 --> 00:01:59.240
Hello, and welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystems, and the personalities.

00:01:59.240 --> 00:02:00.820
This is your host, Michael Kennedy.

00:02:00.820 --> 00:02:07.140
Follow me on Twitter, where I'm @mkennedy, and keep up with the show and listen to past episodes at talkpythontome.com.

00:02:07.280 --> 00:02:13.540
This episode, we'll be talking to Mahmoud Hashimi about Enterprise Python and large-scale Python projects.

00:02:13.540 --> 00:02:19.740
Mahmoud Hashimi is the lead developer of the Python infrastructure team at eBay and PayPal,

00:02:19.740 --> 00:02:27.140
where he focuses his development and instruction energies on service frameworks, API design, and system resiliency.

00:02:27.140 --> 00:02:34.040
Outside of work, he enjoys coding on his open-source projects, which you can find at github.com/Mahmoud,

00:02:34.500 --> 00:02:41.160
as well as creating and maintaining several Wikipedia-based projects, such as Listen to Wikipedia and The Weeklypedia.

00:02:41.160 --> 00:02:42.620
You got it.

00:02:42.620 --> 00:02:43.180
Excellent.

00:02:43.180 --> 00:02:44.640
Mahmoud, welcome to the show.

00:02:44.640 --> 00:02:45.860
Oh, yeah.

00:02:45.860 --> 00:02:46.240
Thank you.

00:02:46.240 --> 00:02:47.940
It's great to be here.

00:02:47.940 --> 00:02:55.360
Like I said before, I'm a very big fan of the prior two episodes, just listening to the MongoDB episode on my way here today.

00:02:55.360 --> 00:02:56.380
Oh, that's fantastic.

00:02:56.380 --> 00:02:58.560
Yeah, we just released that a few hours ago.

00:02:58.560 --> 00:02:58.860
It was great.

00:02:58.860 --> 00:03:00.440
Yeah, it popped up on my phone.

00:03:00.440 --> 00:03:01.280
I listened to it right away.

00:03:01.760 --> 00:03:07.220
All right, so it sounds like you have some amazing stuff going on with Python at PayPal.

00:03:07.220 --> 00:03:14.720
And, you know, the way that I sort of got to know you, I just ran across this blog post that you did called 10 Myths of Enterprise Python.

00:03:14.720 --> 00:03:32.800
And I was just, I was seriously blown away at the detail and sort of the power of your message that Python is this really fantastic, powerful, flexible, and, you know, surprisingly to some people, not to me, but some people, large-scale development platform.

00:03:33.220 --> 00:03:36.000
Well, and, I mean, I don't know what took me so long, honestly.

00:03:36.000 --> 00:03:41.360
Like that post, you know, we were looking for that post years ago.

00:03:41.360 --> 00:03:46.780
And, like, when we were just starting to evangelize Python and, like, work on Python here at PayPal.

00:03:46.780 --> 00:03:51.700
But, you know, like, it was instead, it was, like, scattered throughout the whole Internet.

00:03:51.700 --> 00:03:52.820
The evidence was there.

00:03:52.920 --> 00:03:58.400
I was just looking for something that summed it up in that, like, you know, very sort of, like, modern Internet fashion.

00:03:58.400 --> 00:04:08.400
But, you know, and then I guess, like, I think I wrote the first draft of this maybe, like, a year ago and started using it in internal presentations and so forth.

00:04:08.560 --> 00:04:12.520
But, I mean, yeah, we really did need it something like four or five years ago.

00:04:12.520 --> 00:04:14.020
And what is that quote?

00:04:14.020 --> 00:04:15.840
You should be the change you want to see in the world.

00:04:15.840 --> 00:04:16.300
Exactly.

00:04:16.300 --> 00:04:26.540
Eventually, like, you know, I just went through the whole process to get onto the corporate blog and, like, just get it out there to help, like, you know, anyone else who might be in the same sort of bind.

00:04:26.700 --> 00:04:42.500
You know, just looking for, like, a comprehensive set of evidence to sort of quash these very persistent arguments that seem to be coming up in, you know, the sort of corporate meetings that we all know and love.

00:04:42.500 --> 00:04:44.100
Yeah.

00:04:44.100 --> 00:04:47.720
And what I really love about your article is it's so full of evidence.

00:04:47.720 --> 00:04:55.840
Like, you know, every sentence, every, at least every paragraph has a couple of links to other sort of richer articles that back up whatever it is you're talking about.

00:04:55.840 --> 00:04:56.300
That's great.

00:04:56.300 --> 00:04:57.040
Yeah.

00:04:57.040 --> 00:05:00.280
And, I mean, so, I mean, that's the thing.

00:05:00.280 --> 00:05:03.740
It's, like, I don't even really feel, like, that responsible for all this.

00:05:03.740 --> 00:05:05.520
All of the evidence was there.

00:05:05.520 --> 00:05:10.140
It just needed to be collected under one roof and then hopefully have some sort of credible source to it.

00:05:10.140 --> 00:05:16.880
I mean, the real, like, seller for me here at PayPal is often that Bank of America has thousands of Python developers.

00:05:16.880 --> 00:05:23.500
You know, that's a financial institution, arguably, like, much more important and larger than PayPal.

00:05:25.500 --> 00:05:29.140
And they, like, you know, trust Python with all sorts of, like, activities.

00:05:29.140 --> 00:05:32.780
So, if it's good enough for them, you know, them, it should be good enough for us.

00:05:32.780 --> 00:05:35.860
But the thing is that that's, like, not really advertised that much.

00:05:35.860 --> 00:05:39.600
Even though they're at PyCon, like, doing recruiting, looking for people.

00:05:39.600 --> 00:05:41.920
If you're looking for a job, maybe call it Bank of America.

00:05:42.780 --> 00:05:43.740
So, yeah.

00:05:43.740 --> 00:05:47.080
I mean, we'll go through them one by one here, I guess, today.

00:05:47.080 --> 00:05:58.960
But for the most part, I guess, I came to write that blog post by way of, like, you know, originally joining, like, PayPal as a PHP developer.

00:05:58.960 --> 00:06:01.520
Not for PayPal, mind you.

00:06:01.700 --> 00:06:03.400
But that was just what I knew.

00:06:03.400 --> 00:06:11.920
Like, coming into the company, I saw that there was sort of this, it was like code archaeology, if you would, right?

00:06:11.920 --> 00:06:16.140
Like, there was some evidence of Python usage dating back to the early days of PayPal.

00:06:16.980 --> 00:06:19.820
You said prior to HTTP or something like that, right?

00:06:19.820 --> 00:06:20.740
And prior to Java.

00:06:20.740 --> 00:06:21.640
Quite a way back.

00:06:21.640 --> 00:06:22.740
Yeah, no.

00:06:22.740 --> 00:06:23.880
Way before.

00:06:23.880 --> 00:06:29.300
So, I mean, basically, when, like, original PayPal was all C++.

00:06:29.300 --> 00:06:36.840
And I think still the majority of the traffic in the data center is, like, you know, going between, like, C++ services and so forth.

00:06:36.840 --> 00:06:37.740
So, yeah.

00:06:37.740 --> 00:06:41.820
I mean, there's a long history here going back to, like, 1998.

00:06:42.220 --> 00:06:50.380
Pretty much when I came, like, sort of that ancient civilization was, you know, for the most part gone in 2008, 2009.

00:06:50.380 --> 00:06:52.040
Where had it moved to?

00:06:52.040 --> 00:06:52.900
What were people using?

00:06:52.900 --> 00:07:08.200
You know, I mean, people went and founded YouTube and Yelp and LinkedIn and used Python to much, you know, like, more visible good than I guess probably has come from my own role here at PayPal.

00:07:08.200 --> 00:07:10.560
But it all has to start somewhere.

00:07:10.560 --> 00:07:11.820
Yeah, that's pretty amazing.

00:07:11.820 --> 00:07:18.040
Like I was telling you before the show, I just talked to the Chris McDonough from the Pyramid guys.

00:07:18.040 --> 00:07:20.540
And he said that also Pyramid is being used at Yelp.

00:07:20.540 --> 00:07:23.260
So, a lot of things coming together in these two shows.

00:07:23.260 --> 00:07:24.480
That's really cool.

00:07:24.480 --> 00:07:37.740
I think YouTube is really one of the major sort of things we can put up on a pedestal and say, before you say that it can't, look at this and see if you could build that with whatever your, you know, pet project or pet technology is.

00:07:37.740 --> 00:07:39.280
Another one is Dropbox.

00:07:39.360 --> 00:07:45.580
Those guys are really doing interesting stuff, especially with Guido moving over there full time, which is pretty cool.

00:07:45.580 --> 00:07:46.200
Yeah, yeah, yeah.

00:07:46.200 --> 00:07:55.640
It's pretty neat the sort of, like, energy-inducing effects he has when he sort of, like, moves between these companies.

00:07:55.640 --> 00:08:06.940
Like, he was previously at Google and, like, you know, worked on App Engine there and, you know, was, I guess, like, probably a very key, probably subconscious influence, I would guess, in PayPal.

00:08:07.360 --> 00:08:13.000
Sorry, in Python becoming sort of the third, like, you know, stack there at Google.

00:08:13.580 --> 00:08:14.240
Yeah, that's really cool.

00:08:33.800 --> 00:08:34.580
Michael here.

00:08:34.580 --> 00:08:39.020
Thank you so much for listening to and spreading the word about Talk Python TV.

00:08:39.020 --> 00:08:42.660
The response to the podcast continues to be wonderful and humbling.

00:08:42.660 --> 00:08:45.520
I have a quick comment about supporting and sponsoring the show.

00:08:45.520 --> 00:08:53.500
I'm still looking to line up stable corporate sponsorships, but I wanted to tell you about a community-based campaign I'm launching to allow listeners to directly support the show.

00:08:53.740 --> 00:08:55.960
We are running a Patreon campaign.

00:08:55.960 --> 00:09:04.560
You might not have heard about Patreon, but it's kind of like Kickstarter for things like podcasts, which release frequent small deliverables rather than one-off large engineering projects.

00:09:04.560 --> 00:09:16.560
Visit patreon.com slash mkennedy, that's p-a-t-r-e-o-n dot com slash mkennedy, and watch the video to see how you can donate as little as $1 per episode to support Talk Python To Me.

00:09:16.560 --> 00:09:22.420
This is your chance to ensure that the Python community continues to have a strong public voice.

00:09:22.420 --> 00:09:26.660
Consider supporting us today at patreon.com slash mkennedy, and thanks for listening.

00:09:46.800 --> 00:09:54.660
Before we move into the myths, let me just ask you, how did PayPal and eBay sort of adopt Python so broadly?

00:09:54.660 --> 00:10:01.140
So there was this history, and then some of those people kind of moved on to do minor things like YouTube.

00:10:01.140 --> 00:10:07.000
And then it sounds like you guys are doing a lot of Python stuff now, right?

00:10:07.440 --> 00:10:08.240
Oh, yeah, absolutely.

00:10:08.240 --> 00:10:14.960
So, I mean, basically every aspect of PayPal, and it is like a large business with many different concerns.

00:10:14.960 --> 00:10:24.520
So every aspect you can name, we basically have some contingency of like, you know, some contingent of Python in that group.

00:10:24.680 --> 00:10:36.840
So whether it is like, you know, data analysis in the risk group, or it is like, you know, sort of, let's see, I'm trying not to give away too much here.

00:10:37.320 --> 00:10:40.700
Yeah, don't spill any super secret things you can't talk about, but, you know.

00:10:40.700 --> 00:10:57.420
But, yeah, but I mean, you know, admin tools, batch jobs, mid-tier services, even like, let's see, even, I mean, even some web development and web service like front-end type stuff is going on as well,

00:10:57.660 --> 00:11:00.660
even though it's primarily shifted to other stacks at the moment.

00:11:00.660 --> 00:11:03.160
Sure. Okay. Well, that's really interesting.

00:11:03.160 --> 00:11:04.040
Mm-hmm.

00:11:04.040 --> 00:11:07.740
I think that's a nice lead-in to sort of some of the myths.

00:11:07.740 --> 00:11:16.640
So on your post, you say that you have actually over 50 Python projects running their PayPal, eBay,

00:11:16.640 --> 00:11:20.300
and you sort of go through a list of all the different kinds of things.

00:11:20.300 --> 00:11:23.960
You know, how many people are working on these projects, and are they all active, and what's the story there?

00:11:24.300 --> 00:11:31.540
Well, I mean, Python is sort of, like, you know, kind of renowned for being able to let you move fast,

00:11:31.540 --> 00:11:38.920
and it's interesting how one Python developer can sort of sweep through, like, his new team or his new organization

00:11:38.920 --> 00:11:43.500
and, like, you know, fix a whole lot of things and get a whole lot of balls rolling.

00:11:43.500 --> 00:11:53.340
So, I mean, the 50-plus number is really definitely immediately attributable to, like, Python's own, like, high efficiency.

00:11:53.680 --> 00:11:59.840
Right. It's easy to start and complete 50 projects, more so than, say, C++ or something like Java.

00:11:59.840 --> 00:12:06.980
Right. I think one developer in 2014 got something like three services launched on, like, the eBay side

00:12:06.980 --> 00:12:12.060
using some of our new, like, cloud integration stuff, and that's just one guy.

00:12:12.060 --> 00:12:13.060
He's a team of one.

00:12:13.060 --> 00:12:15.100
And so...

00:12:15.100 --> 00:12:16.040
The meetings are short.

00:12:16.860 --> 00:12:17.680
Oh, yeah, yeah, yeah.

00:12:17.680 --> 00:12:23.020
So, basically, I mean, when I started out, like, there were maybe...

00:12:23.020 --> 00:12:28.240
It started with me making, like, a DL or, like, you know, sort of having an email list on a listserv,

00:12:28.240 --> 00:12:30.520
and they...

00:12:30.520 --> 00:12:33.400
I think maybe, like, 25 people joined up, right?

00:12:33.400 --> 00:12:40.960
And then I think now the DL has on the order of 260 people who use Python on a somewhat regular basis.

00:12:40.960 --> 00:12:44.060
And, you know, I mean, I can't take much...

00:12:44.060 --> 00:12:49.500
I mean, I can't take all the credit for this because, like, a lot of it is due to the sort of, like,

00:12:50.040 --> 00:12:52.000
burgeoning, like, OpenStack wave.

00:12:52.000 --> 00:12:56.020
Like, eBay is one of the main contributors to OpenStack, main users of OpenStack.

00:12:56.020 --> 00:12:57.760
PayPal has also followed suit there.

00:12:57.760 --> 00:13:05.680
And then, also, we've done some acquisitions, you know, of, you know, companies that use Python pretty, like, heavily.

00:13:05.680 --> 00:13:09.480
So, I mean, it sort of, like, had a lot of organic growth.

00:13:09.480 --> 00:13:14.280
I'd say most of the growth is organic, but a lot of it is also attributable to those external projects as well.

00:13:14.280 --> 00:13:15.440
Yeah, sure.

00:13:15.520 --> 00:13:20.240
So, some of it came from the outside and sort of pollinated the internal folks, right?

00:13:20.240 --> 00:13:20.980
Something to that effect.

00:13:20.980 --> 00:13:21.180
Right.

00:13:21.180 --> 00:13:27.120
And that's why I think it's really important that PayPal and eBay sort of participate in that, you know,

00:13:27.120 --> 00:13:34.740
open source ecosystem so that they can continue to derive benefits from that, as we've seen, like, in the past few years here.

00:13:34.740 --> 00:13:35.500
Yeah.

00:13:35.500 --> 00:13:40.100
Do you guys have, like, a corporate GitHub place where you're doing things or anything like that?

00:13:40.100 --> 00:13:40.920
Absolutely.

00:13:40.920 --> 00:13:42.940
GitHub.com forward slash eBay.

00:13:42.940 --> 00:13:44.660
GitHub.com forward slash PayPal.

00:13:45.460 --> 00:13:52.560
You know, I don't personally maintain the Python SDKs by any means for these companies, but I do know the maintainers quite well.

00:13:52.560 --> 00:14:00.700
So, I, you know, I'm willing to take some email spam if you want to email me at mahmoud at PayPal.com.

00:14:00.700 --> 00:14:06.040
And, you know, I'll forward your messages on to the folks in charge of those.

00:14:06.040 --> 00:14:08.900
But they also are pretty responsive on GitHub issues.

00:14:08.900 --> 00:14:20.140
And, I mean, all in all, I think that, like, these Python developers that are in our, like, Githubs are pretty much on the ball when it comes to, like, the whole open source philosophy.

00:14:20.140 --> 00:14:20.880
That's cool.

00:14:20.880 --> 00:14:24.320
Can you open, like, an issue on GitHub for the team?

00:14:24.320 --> 00:14:24.640
Yeah.

00:14:24.640 --> 00:14:24.840
Okay.

00:14:24.840 --> 00:14:25.340
Very cool.

00:14:25.340 --> 00:14:26.620
So, you can participate there.

00:14:27.240 --> 00:14:32.880
Even the Python infrastructure team, you know, which is mostly an internal team, now has, like, a repo up there.

00:14:32.880 --> 00:14:35.280
It's a mid-tier server framework.

00:14:35.280 --> 00:14:39.900
It can be used for Frontier as well, but we primarily use it here for mid-tier stuff.

00:14:39.900 --> 00:14:42.800
And it is called support.

00:14:43.100 --> 00:14:46.540
So, you just go GitHub.com forward slash PayPal forward slash support.

00:14:46.540 --> 00:14:50.260
And, you know, hopefully you'll see me updating the docs.

00:14:50.260 --> 00:14:51.060
Fantastic.

00:14:51.060 --> 00:14:51.920
Fervently.

00:14:51.920 --> 00:14:52.820
Yes.

00:14:52.820 --> 00:14:54.440
That sounds really cool.

00:14:54.440 --> 00:14:55.260
Mm-hmm.

00:14:55.260 --> 00:14:57.440
So, you want to touch on some of the myths?

00:14:57.440 --> 00:14:58.600
Absolutely.

00:14:58.600 --> 00:14:59.640
That's what we're here for, after all.

00:14:59.640 --> 00:14:59.800
Yeah.

00:14:59.800 --> 00:15:06.120
I think there's probably 50 myths if we sat down and brainstormed over enough beer and over enough time.

00:15:06.120 --> 00:15:06.900
It's true.

00:15:06.900 --> 00:15:08.700
I had to cut it down to these 10.

00:15:08.700 --> 00:15:09.280
But, yeah.

00:15:09.280 --> 00:15:11.860
I think you really did hit some interesting ones.

00:15:12.060 --> 00:15:18.000
You know, maybe this is just my sort of myopic view of the world.

00:15:18.000 --> 00:15:24.020
But, to me, it feels like Python is becoming quite a bit more popular in the last five years than it has been.

00:15:24.020 --> 00:15:25.240
Yeah, absolutely.

00:15:25.240 --> 00:15:31.820
And I think that is what is leading into what I think I had as myth number one, which was that Python is a new language.

00:15:31.820 --> 00:15:32.680
Exactly.

00:15:32.680 --> 00:15:34.460
People are just now starting to hear about it.

00:15:34.460 --> 00:15:35.820
They feel like, oh, this thing's taken off.

00:15:35.820 --> 00:15:38.080
But it's not new, is it?

00:15:38.080 --> 00:15:39.180
Yeah, yeah, yeah.

00:15:40.320 --> 00:15:42.380
No, I mean, it's technically older than Java.

00:15:42.380 --> 00:15:47.080
You know, its first release happened three years before the first release of Java.

00:15:47.080 --> 00:15:52.440
And, I mean, it comes from, like, a really long history as well.

00:15:52.440 --> 00:15:55.240
Like, it's not just, you know, sort of.

00:15:55.240 --> 00:16:02.680
Yeah, so it's not a, like, sort of, like, designed in a weak kind of language that just, like, appeared out of nowhere.

00:16:02.680 --> 00:16:09.940
It's based on, like, Guido's long experience with languages like C and ABC.

00:16:09.940 --> 00:16:11.080
Absolutely.

00:16:11.080 --> 00:16:12.480
And I think he took, like, two years.

00:16:12.480 --> 00:16:15.560
He started in, like, 1989, maybe, I seem to remember.

00:16:15.560 --> 00:16:18.100
And it came out in 91, version 1.0, something like that.

00:16:18.100 --> 00:16:21.680
Yeah, well, I was, you know, just a wee one, right?

00:16:21.680 --> 00:16:22.240
Exactly.

00:16:22.240 --> 00:16:24.660
Like, running around, not even thinking about, like, programming.

00:16:25.060 --> 00:16:29.340
But, yeah, it is very mature language on top of that.

00:16:29.340 --> 00:16:34.480
And, I mean, I don't think I go into this in the post, but it has evolved so remarkably.

00:16:34.480 --> 00:16:48.520
Like, all of the changes after, like, version 2.2 with new style classes and all of the, like, you know, rationalizations that have occurred have really, like, proven that it still has the flexibility of a new language, right?

00:16:48.520 --> 00:16:50.180
Where it's constantly under development.

00:16:50.180 --> 00:17:00.200
And you can see a lot of that in, sort of, like, the interesting, sort of, like, discussions and tensions that arise, like, you know, with the Python 3 issue.

00:17:00.200 --> 00:17:02.440
Yeah, the Python 2, Python 3 issues.

00:17:02.440 --> 00:17:04.460
We probably have to have a whole show on that.

00:17:04.460 --> 00:17:05.900
But, you know, it is interesting.

00:17:05.900 --> 00:17:08.420
I actually have some opinions on that.

00:17:08.420 --> 00:17:17.500
But, you know, I think it's interesting how much the language is still sort of evolving in a positive way.

00:17:17.880 --> 00:17:25.820
So, for example, in, what was it, 3.3, they had added yield from to simplify generator methods, which was really cool.

00:17:25.820 --> 00:17:27.840
In 3.4, they added async I.O.

00:17:27.840 --> 00:17:30.840
In 3.5, there's talk of, like, type hinting.

00:17:30.840 --> 00:17:37.360
I mean, these are major sort of additions that are coming on still with 2025-plus years out.

00:17:37.360 --> 00:17:42.600
And many of them have a really nice realistic timeline to them.

00:17:42.600 --> 00:17:47.040
Because, I mean, yeah, Python 3 option, it'll take some time.

00:17:47.300 --> 00:17:51.380
You'll probably do a whole show on that, and you'll have plenty of time to get it out before Python 3 is the majority.

00:17:51.380 --> 00:17:52.180
But, yeah.

00:17:52.180 --> 00:17:55.920
The debate will still be raging if we have that show in six months, I'm sure.

00:17:55.920 --> 00:17:56.900
Absolutely.

00:17:56.900 --> 00:17:58.060
So, yeah.

00:17:58.060 --> 00:18:00.680
But, I mean, Python is not a new language.

00:18:00.680 --> 00:18:06.960
And probably most of the people on this show, like, or who will be listening to this show are going to know that, I think.

00:18:06.960 --> 00:18:07.420
Absolutely.

00:18:07.420 --> 00:18:18.220
But one of the goals I kind of have for this show is, obviously, the people that take the time to, like, sign up and listen to a Python podcast generally are knowledgeable about it pretty well already.

00:18:18.440 --> 00:18:21.260
But, you know, maybe they work in teams where people aren't.

00:18:21.260 --> 00:18:27.240
Like, I have a lot of conversations with folks who are in sort of the more compiled language space.

00:18:27.240 --> 00:18:30.240
And they always think of, oh, Python is like this scripting.

00:18:30.240 --> 00:18:33.160
It's almost like it's a Bash shell script type of thing.

00:18:33.160 --> 00:18:39.080
And I don't think they appreciate sort of the, basically what you laid out in your 10 myths here, which is really cool.

00:18:39.580 --> 00:18:42.560
So, speaking of a compiled language, that's myth number two, right?

00:18:42.560 --> 00:18:43.980
Well, sure.

00:18:43.980 --> 00:18:46.780
And so, myth number two is that Python is not compiled.

00:18:46.780 --> 00:18:54.920
This one is a little bit of a, you know, sort of a, it's a little bit of like sort of a leading myth in a way.

00:18:54.920 --> 00:18:56.860
People do sort of bring this up.

00:18:56.860 --> 00:19:04.620
But the point is that, like, what they're trying to say is that Python is not like C++ and Java.

00:19:04.620 --> 00:19:09.800
I mean, it just ends up coming up always.

00:19:09.800 --> 00:19:24.720
As a company that uses primarily C++ and Java, like, we're going to have a lot of people who sort of protest at, like, the first time they're seeing a REPL used effectively, you know, when you're doing, like, a live demo or something like that.

00:19:24.720 --> 00:19:28.340
So, they say, like, what do you mean there's no compilation?

00:19:28.340 --> 00:19:31.200
What happens if I, like, you know, get something wrong?

00:19:31.200 --> 00:19:33.300
And it's like, well, you got tests and you'll be okay.

00:19:33.480 --> 00:19:39.360
So, like, yeah, Python's not, and the other thing, too, is that Python is technically compiled.

00:19:39.360 --> 00:19:41.120
Like, it does get compiled down to bytecode.

00:19:41.120 --> 00:19:48.960
It happens fast enough that it can happen sort of, like, you know, right before runtime without incurring too much of, like, you know, overhead for most sizes of projects.

00:19:48.960 --> 00:19:53.920
Right, and it does cache that output as the PCH is, right, in the PyCache or whatever it's called in that folder.

00:19:54.080 --> 00:19:58.280
The PYCs and the PyCache and Python 3, yes.

00:19:58.280 --> 00:19:59.500
And so, yeah.

00:20:00.060 --> 00:20:06.000
So, basically, it is a compiled language, and it does execute from bytecode, which is exactly what Java does.

00:20:06.440 --> 00:20:12.600
I mean, the JVM, like, also, like, suffers from a thing called typeer, which, I'm not sure if I mentioned this in the post.

00:20:12.600 --> 00:20:13.200
It probably did.

00:20:13.200 --> 00:20:24.600
But, yeah, it has typeer ratio because it's originally based on a Smalltalk VM, which, and, you know, Smalltalk itself, like, you know, isn't really a, like, statically typed language.

00:20:24.600 --> 00:20:37.140
So, basically, effectively, the bytecode that's emitted by Python is kind of on the same level as the bytecode emitted on the Java side, and the main difference between those two runtimes is the JIT, the just-and-time.

00:20:37.140 --> 00:20:38.160
Yeah, the JIT and the GC.

00:20:38.160 --> 00:20:39.040
That's interesting.

00:20:39.040 --> 00:20:54.260
Yeah, the most notable thing that comes to mind when you say that is sort of the Java implementation of generics or templates, where, in the language, it looks like it's, you know, integers and other types of objects, but it's really just, you know, down to objects at the base, right?

00:20:54.260 --> 00:20:55.100
When it runs.

00:20:55.100 --> 00:21:05.300
The other thing I think is interesting about this is, I'm sure one of the hesitations is, what do you mean you're going to give just the source code away as, you know, bare files, right?

00:21:05.300 --> 00:21:11.020
And, you know, Java and .NET and those things, they don't protect you much, right?

00:21:11.020 --> 00:21:14.800
Because all you've got to do is throw it into a tool, and you see basically the same thing.

00:21:14.800 --> 00:21:15.740
Absolutely.

00:21:15.740 --> 00:21:18.880
I don't rely on that for security, like, whatsoever.

00:21:18.880 --> 00:21:23.160
So, yeah, it's interesting that these other languages can be decompiled.

00:21:23.300 --> 00:21:26.260
And so, in some sense, you're more or less giving away your source code as well.

00:21:26.260 --> 00:21:30.160
And although there are obfuscators, if you really want to get to it, it doesn't matter so much.

00:21:30.160 --> 00:21:35.700
I think that brings us to the real actually important matter is, is Python secure or not?

00:21:36.360 --> 00:21:41.460
Yeah, that's the real question that people should be asking rather than wondering if they should distribute source code.

00:21:41.460 --> 00:21:42.280
Is Python secure?

00:21:42.280 --> 00:21:44.600
To which the answer is yes, definitely.

00:21:44.600 --> 00:21:50.780
To the point that we're willing to, like, actually, like, put a lot of our security onto that platform.

00:21:51.540 --> 00:21:53.660
I mean, and it's not just our own assessment.

00:21:53.660 --> 00:22:03.920
Like, there have been, like, studies done, surveys done of, like, you know, the actual Python source code that determined that it was, like, actually very safe.

00:22:03.920 --> 00:22:15.720
Not really prone to many of the traditional, like, you know, sort of C, the C runtime issues that can occur that we've seen perhaps in, like, openness to sell and so forth.

00:22:15.720 --> 00:22:22.180
Right. A lot of the safety of the language, the fact that you can't work with raw bytes and pointers and offsets is part of it.

00:22:22.180 --> 00:22:31.140
Then also, you also pointed out that the small surface area you can accomplish so much with so little that you don't have to kind of put so much out there in your code.

00:22:31.140 --> 00:22:33.620
So it's easier to guard that smaller code base.

00:22:33.620 --> 00:22:37.420
Right. And that's just, like, a good security policy, a general good security policy.

00:22:37.420 --> 00:22:48.320
So, but, I mean, no, specifically, like, you know, when we were having our discussions about security, using Python with security here at PayPal, like, we did talk about the implications of using CPython.

00:22:48.320 --> 00:22:56.220
And CPython's, like, maturity, as well as, like, the code analysis that has occurred on it, like, you know, was one of the deciding factors.

00:22:56.220 --> 00:23:11.780
Like, basically, if you look at Java or something like that, every couple weeks there's a new Java update because it has tried to, like, you know, introduce a new security model into its runtime involving, like, protected memory and that sort of stuff.

00:23:11.780 --> 00:23:14.080
So, I mean, maybe I should rephrase that.

00:23:14.080 --> 00:23:17.260
Basically, it makes promises that are hard to keep.

00:23:17.580 --> 00:23:20.860
And so they end up having, like, a lot of security releases.

00:23:20.860 --> 00:23:27.040
You don't see those same sort of security releases nearly as often as CPython, even though it has a very wide usage.

00:23:27.040 --> 00:23:33.420
It's on, like, not only all the servers, but also most of, like, you know, consumer computers at this point.

00:23:33.420 --> 00:23:36.000
Right. Definitely all the Macs and Linux machines, anyway.

00:23:36.000 --> 00:23:36.580
Exactly.

00:23:36.840 --> 00:23:48.300
So, I mean, if it were, like, a viable, like, sort of attack, like, if it was sort of, like, a viable vulnerability, if you would, it would probably be exploited by now.

00:23:48.300 --> 00:23:52.820
And so, like, it's, it's, and you can never, like, really prove security.

00:23:52.820 --> 00:23:57.220
You can just sort of go with what seems to be secure.

00:23:57.220 --> 00:24:02.620
And, like, the way that you get a good idea of that is something that has been as widely tested as Python.

00:24:02.620 --> 00:24:03.620
Absolutely.

00:24:04.100 --> 00:24:07.540
Yeah, you cannot prove security by one example where a person's not hacked, right?

00:24:07.540 --> 00:24:12.940
But more and more that it sustains up over time, the more faith we should put in a system.

00:24:12.940 --> 00:24:13.320
Absolutely.

00:24:13.320 --> 00:24:21.280
So I think number four may be my absolute favorite, or at least the most encountered one for me, the folks that I interact with.

00:24:21.280 --> 00:24:24.300
And that's, Python is really just a scripting language.

00:24:24.300 --> 00:24:28.680
And this is, this is the original myth, like, you know, in my experience.

00:24:28.680 --> 00:24:29.200
I agree.

00:24:29.200 --> 00:24:30.160
Yeah.

00:24:30.440 --> 00:24:35.340
So, I mean, when I was giving my first, my first Tech Talk, I remember it like it was yesterday.

00:24:35.340 --> 00:24:41.260
After I finished, we were demoing a new application that basically controls the prices of PayPal.

00:24:41.260 --> 00:24:42.800
It's still used now.

00:24:42.800 --> 00:24:54.040
It's, like, before this application was released, it would take on the order of weeks to get new pricing schedules out for, like, you know, certain vendors and that sort of stuff.

00:24:54.220 --> 00:24:57.760
And this made it so that it became just a matter of, like, hours or minutes.

00:24:57.760 --> 00:24:59.460
And so we were demoing all of this.

00:24:59.460 --> 00:25:08.940
And by the time we got to the end, the first question out of the first person's mouth was, so wait a second, you did this in Python, right?

00:25:08.940 --> 00:25:10.180
And I'm like, oh, well, yes.

00:25:10.180 --> 00:25:11.900
Like, and how do you mean?

00:25:11.900 --> 00:25:16.280
And they're like, but Python is a scripting language, you know, so what is this?

00:25:16.280 --> 00:25:18.600
Is this, like, CGI or what is this?

00:25:18.600 --> 00:25:23.580
Like, how is it that you're, like, talking these complex network protocols with a scripting language?

00:25:23.580 --> 00:25:25.800
As though I had done something very irresponsible.

00:25:25.800 --> 00:25:27.380
That's really funny.

00:25:27.380 --> 00:25:31.100
But, you know, four or five years later, here we are, and it's still, like, doing a bang-up job.

00:25:31.100 --> 00:25:32.480
Yeah, that's fantastic.

00:25:32.480 --> 00:25:33.340
Yeah.

00:25:33.680 --> 00:25:43.640
And so in this myth, I, like, basically go through, as mentioned, like, earlier in the program here, like, you know, I go through all of the different, like, companies that have used Python in so many different ways.

00:25:43.640 --> 00:25:46.300
It is a general purpose language as it describes itself.

00:25:46.300 --> 00:25:49.060
So it has many, many purposes.

00:25:49.060 --> 00:25:52.000
Yeah, I really like your list, and maybe I'll just read a couple of them.

00:25:52.000 --> 00:26:01.580
So we've got, like, Twilio doing telephony infrastructure, obviously payments with you guys, neuroscience and psychology with tons of examples.

00:26:01.760 --> 00:26:05.260
There's all the numerical analysis stuff with NumPy and SciPy.

00:26:05.260 --> 00:26:10.260
Disney, DreamWorks, and LucasArts are all doing animation rendering type stuff.

00:26:10.260 --> 00:26:12.680
Games, backends, email.

00:26:12.680 --> 00:26:15.000
Let's see what else is here.

00:26:15.000 --> 00:26:18.480
I think the security and penetration testing stuff is interesting.

00:26:18.480 --> 00:26:20.900
Big data, you know, Hadoop.

00:26:20.900 --> 00:26:22.700
And then, obviously, we just talked to the Mongo guys.

00:26:22.700 --> 00:26:25.040
There's great support on those types of systems.

00:26:25.040 --> 00:26:28.620
Yeah, and we're spinning up a Disco cluster here, too.

00:26:29.220 --> 00:26:37.280
I mean, Disco's been around for, like, a little while, but it's sort of like an Erlang and Python-based big data thing.

00:26:37.280 --> 00:26:38.340
We're spinning up a cluster here.

00:26:38.340 --> 00:26:40.740
It's actually been a pretty interesting experience so far.

00:26:40.740 --> 00:26:43.260
Oh, I bet that's an interesting thing to work with.

00:26:43.260 --> 00:26:44.140
Definitely.

00:26:44.400 --> 00:26:53.000
My favorite example of all this, right, was sort of during sort of a contentious time in the Python infrastructure team's history here.

00:26:53.000 --> 00:27:07.040
I think Binds10 came out and announced that they were going to, like, use Python for a good part of DNS, right, which is basically as close to infrastructure as, like, common infrastructure as the Internet has.

00:27:07.220 --> 00:27:10.240
So, I mean, I'm not sure where that's at right now.

00:27:10.240 --> 00:27:12.000
Yeah, that's pretty cool, though.

00:27:12.000 --> 00:27:20.360
Yeah, but it was, like, a really, like, sort of – it drove a stake through the heart of this myth that Python's just a scripting language.

00:27:20.360 --> 00:27:27.560
Well, I think one of the other concepts that leads to people thinking that is, well, you can't have a real language without strong typing.

00:27:28.120 --> 00:27:30.220
And so people think Python is weakly typed, right?

00:27:30.220 --> 00:27:39.060
No, that's – so this is another one that I guess people, like, you know, in a practical meeting start getting into theoretical aspects, right?

00:27:39.060 --> 00:27:47.800
And they start getting into type systems, which, I mean, you know, Python is definitely the language of, like, sort of pragmatic doing of things.

00:27:47.800 --> 00:27:51.840
And so, you know, that's my way of saying get shit done.

00:27:51.840 --> 00:27:54.880
I'm not sure what rating you have on this podcast.

00:27:54.880 --> 00:27:58.740
But, you know, I mean, and people will bring up that it's weakly typed.

00:27:58.740 --> 00:28:04.340
And the response to this, the real response to this should just be, like, one, it's not.

00:28:04.340 --> 00:28:06.340
And even if it was, like, so what?

00:28:06.340 --> 00:28:09.620
Like, the thing has already been done by the end of the meeting.

00:28:09.620 --> 00:28:14.300
So it's really about getting, like, results.

00:28:14.940 --> 00:28:26.120
And Python's type system, while wonderful, I'm a very big fan, like, has very little to do with, you know, it's – I don't want to rule it out.

00:28:26.120 --> 00:28:26.880
I don't want to rule it out.

00:28:26.880 --> 00:28:28.820
But I, like, in a moment there –

00:28:28.820 --> 00:28:35.420
JavaScript is an example that you could actually do without real typing and still get stuff done, you know, the node guys and so on.

00:28:36.060 --> 00:28:37.640
I don't know if I'd include that one.

00:28:37.640 --> 00:28:38.020
But, yeah.

00:28:38.020 --> 00:28:40.260
So, no, it's true, though.

00:28:40.260 --> 00:28:45.960
It's – yeah, Python is, like, a strongly dynamically typed language.

00:28:45.960 --> 00:28:48.800
And it works for strong, dynamic people.

00:28:48.800 --> 00:28:50.100
Yeah, that's fantastic.

00:28:50.100 --> 00:28:55.500
So another myth, you know, people think of the scripting language and they think it's just this interpreted thing.

00:28:55.580 --> 00:28:58.040
And so, well, obviously interpreted code is slow.

00:28:58.040 --> 00:29:06.300
And even if you just focus on CPython, I think the performance story is super nuanced and interesting and non-obvious.

00:29:06.300 --> 00:29:08.860
So, you know, take, like, NumPy, for example.

00:29:08.860 --> 00:29:15.580
So if you did all of your sort of mathematics in pure Python and then interpreted that, that would probably be slow.

00:29:15.580 --> 00:29:18.380
But, of course, they've taken the slow parts and rewritten that in C.

00:29:18.380 --> 00:29:21.440
So that's sort of native and that's super fast.

00:29:21.440 --> 00:29:28.360
And if you can just kind of orchestrate calling into these low-level C functions, then you're talking about really fast even CPython.

00:29:28.360 --> 00:29:29.720
But there's more to it than that, right?

00:29:29.720 --> 00:29:32.200
There's a ton of runtimes or implementations.

00:29:32.200 --> 00:29:33.160
Definitely.

00:29:33.160 --> 00:29:39.320
I mean, Python's demand has led to quite a bit of supply in all sorts of different, like, aspects.

00:29:39.320 --> 00:29:41.200
Runtimes definitely being one of them.

00:29:41.200 --> 00:29:44.420
So, I mean, you've got CPython, which is the standard.

00:29:44.420 --> 00:29:47.060
You've got Jython and IronPython and PyPy.

00:29:47.060 --> 00:29:54.100
And then there are, like, you know, more sort of, like, academic ones, you know, for teaching how a runtime works and so forth.

00:29:54.240 --> 00:30:10.760
So, but the real key here is that, like, calling it interpreted language is sort of a form of micro-labeling that doesn't actually, like, contribute to the overall, like, engineering discussion that should be happening, which is that Python can have such a huge impact on your workflow.

00:30:10.760 --> 00:30:25.980
So, yeah, you can iterate on your projects at such great speed that you end up, like, finding yourself using more advanced techniques or finding out that this area that you would have spent so much time optimizing otherwise is actually not really where the majority of the work of your application is being done.

00:30:25.980 --> 00:30:29.460
So, basically, it allows you to focus on what matters.

00:30:29.600 --> 00:30:40.460
When you take that to a macro level, looking at the whole ecosystem, there are people out there who have gone through that same workflow and have generalized out libraries that you can then take advantage of all of their optimizations.

00:30:40.460 --> 00:30:56.760
So, like, you know, instances where Python has ended up using, like, SIMs, you know, which is, like, sort of vectorized, like, you know, computation that, like, would otherwise be, like, rather difficult to, like, code by hand in C and C++, not to mention distribute.

00:30:56.760 --> 00:31:09.920
Yeah, I mean, it's really important to look at the whole, like, process instead of just, like, individual adjectives about how, like, a given, like, single runtime works.

00:31:09.920 --> 00:31:25.460
Like, the Python way will lead to faster and more efficient code, you know, that makes a big difference on the overall, like, complexity of your application, which can lead to, like, you know, better maintenance aspects as well.

00:31:26.040 --> 00:31:27.280
Yeah, that's really interesting.

00:31:27.280 --> 00:31:35.300
I've talked with some companies that are doing amazing stuff and sort of building their almost entire enterprise foundation on top of Python.

00:31:35.300 --> 00:31:39.580
And they've got, like, the group I was speaking with, I can't, you know, NDA stuff, I can't really talk about it.

00:31:39.580 --> 00:31:49.560
But they had 160 internal enterprise business applications, and they were creating a Python layer to be the foundation of, like, sort of unifying all that data and underlying infrastructure.

00:31:49.560 --> 00:31:54.120
And, you know, if you could do that, then you can do some pretty amazing, amazing stuff.

00:31:54.120 --> 00:31:56.480
That's not a slow system you decide to do that with.

00:31:56.480 --> 00:31:56.860
Yeah.

00:31:56.860 --> 00:32:05.600
And, I mean, with, like, honestly, enterprise is not, like, you know, sort of the domain of, like, performance being king.

00:32:05.600 --> 00:32:12.760
We end up spending, like, more time than we should talking about it because, I guess, people want to go back to their, like, you know, college roots.

00:32:12.980 --> 00:32:15.300
But, honestly, we can afford more machines.

00:32:15.300 --> 00:32:19.700
We put more machines on it because, you know, we need the redundancy anyway, right?

00:32:19.700 --> 00:32:30.500
And we end up having to, like, spend, we should spend more time talking about, like, you know, just how our developers interact with our development tools.

00:32:30.720 --> 00:32:37.500
Because that's really usually where, like, we have a bigger bottleneck, actually, like, getting projects done on time.

00:32:37.500 --> 00:32:40.320
If you do it in Python, you end up having extra time.

00:32:40.320 --> 00:32:44.120
You can engineer your products for correct behavior, and you profile it.

00:32:44.120 --> 00:32:45.840
You know, Python has a decent profile.

00:32:45.840 --> 00:32:46.480
It's built right in.

00:32:46.480 --> 00:32:48.920
And then you can optimize it as need be.

00:32:48.920 --> 00:32:53.740
And, you know, we've even found spare cycles to write some of our hot loops and see.

00:32:54.040 --> 00:32:58.100
Yeah, maybe even have some time to write some unit tests to make sure it works right when you have help.

00:32:58.100 --> 00:32:58.460
Yeah.

00:32:58.460 --> 00:33:03.580
No, quality is what lets us sort of, like, sleep soundly at night.

00:33:03.580 --> 00:33:09.720
That's what's going to, like, you know, actually make for, like, you know, successful business in the long term, generally speaking.

00:33:09.720 --> 00:33:10.680
Right.

00:33:10.680 --> 00:33:14.860
So, that was myth number six, which was that Python is slow.

00:33:14.860 --> 00:33:17.860
And I think you have kind of a pair of myths that talk about scaling.

00:33:17.860 --> 00:33:21.740
And one of them is kind of, well, number seven is Python does not scale.

00:33:21.900 --> 00:33:25.460
You have some really interesting examples on sort of performance scale there.

00:33:25.460 --> 00:33:31.880
Well, yeah, because this one is really just so easily quashed by a counter example, right?

00:33:31.880 --> 00:33:35.920
YouTube, I think, is, what, the second largest website on the Internet right now, right?

00:33:35.920 --> 00:33:39.680
We talk about Dropbox, Disqus, Eventbrite, Reddit, right?

00:33:39.680 --> 00:33:42.740
They may have, like, Twilio with its telephony, right?

00:33:42.740 --> 00:33:44.260
And Instagram and Yelp.

00:33:44.260 --> 00:33:46.540
And, I mean, even games, right?

00:33:46.540 --> 00:33:48.260
Like, even online and Second Life, right?

00:33:48.500 --> 00:33:54.440
They're actually the areas where you find the most radical, like, scaling stories.

00:33:54.440 --> 00:34:01.160
Because unlike enterprise companies like PayPal and Bank of America, they don't just, they're not made of money, right?

00:34:01.160 --> 00:34:04.260
Like, the game has to be fun and they run a tight margin.

00:34:04.260 --> 00:34:11.000
And they do it for, like, the love of crafting, like, a unique sort of, like, self-contained system.

00:34:11.360 --> 00:34:18.260
And they end up, like, you know, creating such technology marvels as stackless and eventlet and all that sort of stuff.

00:34:18.260 --> 00:34:28.300
So, well, stackless and eventlet and, you know, Tornado, AsyncIO, all these sorts of things are in the general realm of concurrency and async processing.

00:34:28.300 --> 00:34:29.820
And that's your myth number eight, right?

00:34:29.860 --> 00:34:34.460
Is that Python, that it does lack good support for sort of concurrency and multithreading?

00:34:34.460 --> 00:34:35.140
Yeah.

00:34:35.140 --> 00:34:42.000
So, this one, I think, is one area where, like, Python probably gets the most legitimate, like, technology flack.

00:34:42.000 --> 00:34:48.220
And that's because, I would say that's because Python sort of has a stated mission of there's only one obvious way to do something.

00:34:48.220 --> 00:34:51.120
And in the realm of concurrency, unfortunately, that's not true.

00:34:51.600 --> 00:34:57.060
So, CPython, like, you know, by itself is sort of a runtime environment.

00:34:57.060 --> 00:35:06.320
When you introduce a concurrency, like, sort of library to that, you change your, like, fundamental, like, runtime behaviors.

00:35:06.320 --> 00:35:13.320
You basically have added a layer on top of CPython's sort of native, like, main thread or whatever you want to call it.

00:35:13.620 --> 00:35:19.340
Now, either you're working with threads or greenlets or promises or deferreds.

00:35:19.340 --> 00:35:34.040
And that really, like, there are so many different opinions that you can have about that, like, area of computing that Python has itself, like, you know, spawned, I think, probably at this point a dozen different ways to do concurrency.

00:35:34.040 --> 00:35:34.240
Right.

00:35:34.600 --> 00:35:42.300
I think one of the things that people immediately jump to, some people anyway, when they hear, I need more concurrency, is let me kick off a bunch of threads.

00:35:42.300 --> 00:35:53.000
And I think, better or worse, the whole Node.js thing that's taken, you know, was really popular sort of coming up a few years ago is showing that you can get really great concurrency with very, very few threads.

00:35:53.000 --> 00:36:03.420
If you're willing to sort of put those threads, you know, reuse those threads when they're generally waiting on a web service call or a database call or disk I.O. or something like that, right?

00:36:03.960 --> 00:36:04.660
Yeah, absolutely.

00:36:04.660 --> 00:36:09.460
And, I mean, it's been really amazing how we've sort of rediscovered these techniques.

00:36:09.460 --> 00:36:16.180
One of the guys on the Python infrastructure team here actually worked on the AIM servers, if you remember, AOL Instant Messenger.

00:36:16.180 --> 00:36:21.400
And, yeah, I mean, you know, that was all, and they did it all with C and callbacks.

00:36:21.400 --> 00:36:27.900
And, you know, like, they actually, like, we ended up doing a lot of the stuff that he did back in the day.

00:36:27.900 --> 00:36:29.960
Like, we ended up redoing that sort of now.

00:36:30.520 --> 00:36:41.460
It's been really nice having sort of a gray beard, if you will, around, because basically he sort of, like, I think back in the day he was working with SSL BIO and, like, OpenSSL BIOs.

00:36:41.460 --> 00:36:44.140
And today we're doing sort of the same thing.

00:36:44.140 --> 00:36:47.040
And, you know, back in the day they also had trouble with threads.

00:36:47.040 --> 00:36:50.460
And these days we also, we still find trouble with threads.

00:36:50.460 --> 00:36:52.020
And these aren't Python-specific troubles.

00:36:52.020 --> 00:36:55.140
It's just that threaded programming bears a few risks.

00:36:55.700 --> 00:37:05.680
And so in our infrastructure, anyway, we've sort of, like, taken, we've made some decisions for our developers that will allow us to pre-mitigate those risks, you know.

00:37:05.680 --> 00:37:12.480
And one of those is to, like, basically sort of limit ourselves to a somewhat fixed number of threads.

00:37:12.480 --> 00:37:17.460
You don't want to have, like, one thread per request, for instance, in a server.

00:37:17.460 --> 00:37:25.120
Because that means that as your load goes up, your contention and overhead, like, sort of also start going up.

00:37:25.120 --> 00:37:25.300
Sure.

00:37:25.300 --> 00:37:34.160
Yeah, and even just the pure memory from just the stack space for each thread can start to become significant when you're talking tens of thousands or hundreds of thousands of threads.

00:37:34.160 --> 00:37:35.360
It's a problem, yeah.

00:37:35.360 --> 00:37:35.760
Right.

00:37:36.640 --> 00:37:47.180
And so what we end up with in a lot of cases for applications that have gone with a threaded model, and these aren't, like, Python applications, they end up topping out with sort of a hard stop.

00:37:47.180 --> 00:37:52.900
They start falling behind on their work without, like, you know, being able to respond and shed load nicely.

00:37:52.900 --> 00:38:07.660
We can sort of chalk up all of our good server behavior to just having the time to actually, like, analyze how our application works, add additional sort of behaviors, and instrument it appropriately.

00:38:07.660 --> 00:38:14.440
Because we're not spending all of our time wrangling with a thread per request model or, you know.

00:38:14.440 --> 00:38:18.620
But you really do have to, I mean, going back to the original issue of concurrency support,

00:38:19.680 --> 00:38:27.460
like, a concurrency library is more than just any other library because you end up having to adopt some aspect of its philosophy.

00:38:27.460 --> 00:38:30.100
And there aren't any real easy answers there.

00:38:30.100 --> 00:38:37.860
You need to look at what they are, find out what, you know, like, sort of is easily digested by you and your brain.

00:38:37.860 --> 00:38:44.500
And then look at examples of how other people have architected their applications if you don't have, like, strong opinions of your own.

00:38:44.940 --> 00:38:57.780
It's a learning process, and this is something I feel that maybe, like, they should spend more time on back in most schools where, unfortunately, they mostly just focus on processes and threads, which, while important, aren't the whole story.

00:38:57.780 --> 00:38:58.060
Yeah, absolutely.

00:38:58.060 --> 00:39:00.000
Well, maybe that's changing in the future.

00:39:00.000 --> 00:39:04.860
A friend of mine has a really interesting saying or way of looking at the world.

00:39:04.860 --> 00:39:14.980
He says, you know, look, when you're writing this multi-threaded concurrent code, if you try to get too tricky, you're writing code, like, right at the limit of your ability to understand what you're doing.

00:39:14.980 --> 00:39:17.760
And debugging code is harder than writing code.

00:39:17.760 --> 00:39:19.940
So you're writing code that you literally can't debug.

00:39:19.940 --> 00:39:20.820
You know what I mean?

00:39:20.820 --> 00:39:22.420
Like, you've just gone right over that barrier.

00:39:22.420 --> 00:39:24.760
Now it's like, I've created this monster I've got to live with.

00:39:24.760 --> 00:39:25.880
So that's pretty interesting.

00:39:25.880 --> 00:39:30.460
And, I mean, the code certainly takes on its own, a soul of its own.

00:39:30.460 --> 00:39:46.780
But, like, basically, when you start running it at scale and it's spread across many pools of many machines, like, it has, it ends up, like, having an almost organic nature when you take into account, like, load balancers and, like, you know, variations in the network and so forth.

00:39:46.780 --> 00:39:53.360
You need to make time for all of those sort of emergent behaviors that are going to come up when you deploy.

00:39:53.360 --> 00:39:53.780
Yeah, absolutely.

00:39:53.780 --> 00:39:57.980
So myth number nine is that Python programmers are scarce.

00:39:57.980 --> 00:40:02.340
Like, I think I mentioned in the myth, like, this is somewhat true, right?

00:40:02.340 --> 00:40:04.120
It depends what you're comparing it to, though.

00:40:04.120 --> 00:40:11.660
Because, but like I said before, you know, we have one developer that goes and creates three production services in one year.

00:40:11.660 --> 00:40:15.000
Do you need a huge team of Python developers to accomplish some project?

00:40:15.000 --> 00:40:15.920
Maybe, maybe not.

00:40:16.600 --> 00:40:17.600
Yeah, maybe not.

00:40:17.600 --> 00:40:19.660
Actually, almost certainly not.

00:40:19.660 --> 00:40:23.280
Almost certainly not as many as you would need for other stacks.

00:40:23.280 --> 00:40:37.600
And that's sort of reflected in, like, every Python team that I've seen, not just here at PayPal, but also, like, across the industries that, like, they end up generally being smaller and more effective.

00:40:37.600 --> 00:40:43.940
And if you, like, the literature sort of backs up that these are actually not bad things to have.

00:40:44.080 --> 00:40:49.620
People worry about people getting hit by buses, and it's nice for, you know, nice of them to be so concerned.

00:40:50.140 --> 00:40:56.640
But, but, but, but really, like, one of the keys with Python is that you can, you can learn it very quickly.

00:40:56.640 --> 00:40:59.820
And it has a really nice learning curve.

00:40:59.820 --> 00:41:17.900
I mean, maybe it's, maybe it's just me, but I had a really nice time transitioning from PHP to Django, digging deeper into the standard library, reading the source code of, like, you know, just sort of, like, modules like Ether tools and collections and these sorts of things.

00:41:17.900 --> 00:41:26.580
And learning about Python from examples that are not opaque, like they were in, like, you know, C++ and Java.

00:41:26.580 --> 00:41:32.960
I felt that those, like, you know, applications, like, those sort of stacks were more opaque and Python was more open.

00:41:32.960 --> 00:41:43.200
And then, like, you know, with the rise of GitHub and so forth, going and learning, like, you know, the fundamentals of web frameworks from Bottle and Django source code.

00:41:43.200 --> 00:41:58.240
And basically, like, you sort of, it sort of has a natural learning curve to it that basically without any of, like, you know, official training or standard training, like, you know, we were able to rise to the level of, like, effective infrastructure engineers.

00:41:58.480 --> 00:42:02.420
And I had a similar experience, you know, when I first learned C++ way back in the day.

00:42:02.420 --> 00:42:13.540
I remember it was this mountain I climbed, you know, and learning Python, I mean, obviously, learning as a second language makes it, a next language, not the first language, makes it easier to do.

00:42:13.620 --> 00:42:18.040
But I think even if I had learned it originally, it would have been a much more enjoyable experience.

00:42:18.040 --> 00:42:26.480
So, and then, you know, you make some interesting points about, well, there may be not so many Python developers or however many there are, there's going to be more.

00:42:26.480 --> 00:42:27.500
Yeah, yeah.

00:42:27.500 --> 00:42:35.660
And, I mean, especially when, like, there are changes happening in education right now where Python is becoming, like, I think, the top teaching language.

00:42:35.660 --> 00:42:35.940
Exactly.

00:42:35.940 --> 00:42:45.440
That's what I was thinking of is that, you know, just the last couple years ago, it flipped, I think, from Java maybe into Python being the most taught programming language in college.

00:42:45.440 --> 00:42:48.420
So, a little while, that will have some big effects, you know.

00:42:48.420 --> 00:42:49.020
Yeah.

00:42:49.020 --> 00:42:51.000
And, well, already we're seeing it.

00:42:51.000 --> 00:43:00.400
I mean, if your company has a policy that they'll, like, for a while, PayPal had a policy where they would only hire experienced engineers, not straight out of college.

00:43:00.400 --> 00:43:05.160
But, already we're seeing people coming out of college being hired at PayPal whose primary experience is in Python.

00:43:05.160 --> 00:43:08.380
So, like, the effect is already there.

00:43:08.380 --> 00:43:12.160
And, I mean, frankly, of course, I think it's a good thing.

00:43:12.160 --> 00:43:23.800
But, especially because Python has so many language features that are so, like, you know, well-documented and well-thought-through and designed through PEPs and, like, you know, the Python enhancement processes.

00:43:24.040 --> 00:43:42.960
So, I mean, it's actually – it's just a more open, approachable language that has so much to teach that even if you're going to end up working in other languages, I recommend studying Python unless it's going to spoil you for other languages, which has been known to occur.

00:43:42.960 --> 00:43:48.760
If you don't want to go to work anymore because you have to go back to writing embedded C, you may want to stay away from Python.

00:43:48.760 --> 00:43:49.200
That's right.

00:43:49.520 --> 00:43:50.480
We like C.

00:43:50.480 --> 00:43:51.240
We like C, too.

00:43:51.240 --> 00:43:51.720
Anyways.

00:43:51.720 --> 00:43:52.080
Okay.

00:43:52.080 --> 00:43:58.120
So, I think your final myth actually had some of the most interesting actual statistics in it.

00:43:58.120 --> 00:44:03.220
That's that Python is not for large projects, as in large number of lines of code.

00:44:03.220 --> 00:44:03.860
Right.

00:44:03.860 --> 00:44:17.960
So, I mean, before we talked about, like, scaling traffic, which YouTube and others, like, you know, clearly disprove that you can just, like – Python has a consistent intuitive runtime and it can scale simply.

00:44:18.420 --> 00:44:23.840
But scaling the developer side of things is not as simple, right?

00:44:23.840 --> 00:44:25.140
People are complex.

00:44:25.140 --> 00:44:34.340
And so – but that said, I mean, there have been many, many, like, you know, examples of Python scaling to the enterprise level.

00:44:35.120 --> 00:44:46.600
And, you know, here at, like, PayPal and eBay is, you know, we have a lot of small teams, but we have some larger ones, too, with, like, multiple experienced developers and a couple of junior developers and so forth.

00:44:46.600 --> 00:44:49.840
So, on the OpenStack side especially.

00:44:49.840 --> 00:44:55.540
So, yeah, Bank of America, like I mentioned before, has, like, you know, 5,000 Python developers.

00:44:55.540 --> 00:44:57.020
And they just spun that out of nowhere.

00:44:57.020 --> 00:44:58.820
Maybe that's why Python developers are scarce.

00:44:58.820 --> 00:44:59.940
Yeah, maybe they grabbed them all up.

00:44:59.940 --> 00:45:04.360
Yeah, you said they have over 10 million lines of Python code, which is kind of crazy.

00:45:04.360 --> 00:45:05.240
I mean, yeah.

00:45:05.240 --> 00:45:12.880
And, I mean, they did that, I think the – I mean, either they did that because JP Morgan was doing it or JP Morgan did it because Bank of America was doing it.

00:45:12.940 --> 00:45:14.860
Or maybe, like, you know, it was just a coincidence.

00:45:14.860 --> 00:45:20.360
But the financial industry has certainly seen, like, you know, a large amount of Python adoption.

00:45:20.360 --> 00:45:31.380
And the important thing, too, is that, like, when your company starts getting big enough, heterogeneity becomes a really important aspect of your recruiting strategy.

00:45:31.880 --> 00:45:46.220
So, like, if you really do actually need 2,000, 3,000 developers, then maybe you shouldn't be banking on all of them, you know, being from one programming discipline, right?

00:45:47.220 --> 00:46:06.680
So, basically, with trends in education and open source dictating a lot of what talents is available, you should focus on having language agnostic protocols and, like, well-designed larger architectures that you can plug many languages' stacks into.

00:46:06.780 --> 00:46:17.580
And that's what we have here at PayPal, where we have C++, Java, Python, Node, and there's even been some fledgling work done with, like, Scala and Go.

00:46:17.580 --> 00:46:23.200
And, certainly, as we – like, adding – so, doing C++ was, like, hard.

00:46:23.200 --> 00:46:24.440
That, like, built PayPal.

00:46:24.440 --> 00:46:28.680
Then adding Java was, like, you know, still pretty hard.

00:46:28.680 --> 00:46:35.640
When we added Python, like, you know, we actually created reference implementations and standards for a lot of these emergent protocols.

00:46:35.880 --> 00:46:38.720
And then other stacks, like, can come and sort of, like, follow suit.

00:46:38.720 --> 00:46:54.540
If you're looking – if you're actually someone – if there's actually someone in charge of a big project listening to this podcast right now, you know, as long as you have good talent, good architecture, you can definitely use Python as part of a large project.

00:46:54.540 --> 00:47:02.840
We have many processes detailed in the blog post that can, like, you know, lead to good practices, best practices for a variety of environments.

00:47:02.840 --> 00:47:03.500
Yeah, that's great.

00:47:03.540 --> 00:47:07.680
Can you talk about, like, static code analysis with PyFlakes and other things like that?

00:47:07.680 --> 00:47:09.440
It's a big world out there.

00:47:09.440 --> 00:47:10.140
It's a big industry.

00:47:10.140 --> 00:47:19.860
And Python has a long history and, like, a lot of experience it can bring to enhance basically any – like, a company of any size, if you ask me.

00:47:20.600 --> 00:47:29.580
I mean, it's not all about, like, you know, just evangelizing and, as they say, being religious about, like, you know, a given technology.

00:47:29.580 --> 00:47:35.100
Python is just a really handy piece that fits into a lot of applications.

00:47:35.100 --> 00:47:36.060
Yeah, that's really fantastic.

00:47:36.060 --> 00:47:45.840
And so people out there listening, if they're sort of having these debates at work or on their projects and, like, I'd really like to use Python, but people keep laughing at me and say it's not – you know, whatever, right?

00:47:45.840 --> 00:47:52.200
Yeah, I really recommend checking out Mahmoud's article, 10 Minutes of Enterprise Python, which I'll link to from the show notes.

00:47:52.560 --> 00:47:58.080
And you can share that or you can share this longer form conversation that we had.

00:47:58.080 --> 00:48:04.380
I just wish I had a time machine so I could send it back to me a few years ago.

00:48:04.380 --> 00:48:05.740
Yeah, I can see that.

00:48:05.740 --> 00:48:08.000
What would you say to your former self at work?

00:48:08.000 --> 00:48:10.080
I would give him this article.

00:48:10.080 --> 00:48:11.780
That's great.

00:48:11.780 --> 00:48:14.060
It really would simplify things.

00:48:14.060 --> 00:48:14.600
But, yeah.

00:48:14.600 --> 00:48:18.900
And also maybe I'd send some stock.

00:48:18.900 --> 00:48:19.960
Yeah, exactly.

00:48:19.960 --> 00:48:20.340
Of course.

00:48:20.340 --> 00:48:20.860
Anyways.

00:48:21.500 --> 00:48:24.540
All right, well, I think that's – you know, this has been a super interesting conversation.

00:48:24.540 --> 00:48:31.500
And a question I'd like to ask my guests on sort of on the way out the door is so much of Python is driven by open source stuff.

00:48:31.500 --> 00:48:35.500
And there's so much great stuff on PyPy and GitHub and so on.

00:48:35.500 --> 00:48:39.680
Do you have, like, a favorite thing that, you know, you maybe want to call some attention to?

00:48:39.680 --> 00:48:40.320
Favorite project?

00:48:40.320 --> 00:48:42.280
I have many favorites.

00:48:42.280 --> 00:48:49.000
Like, one of the ones that I remember looking at recently and being really impressed with the implementation was – it was a very small thing.

00:48:49.000 --> 00:48:51.380
It's called, I think, NetAdder or something like that.

00:48:51.440 --> 00:48:54.980
And it was just a library for working with IPs and IP ranges.

00:48:54.980 --> 00:48:59.940
But, you know, as I'm wont to do, I went and I looked at the code and it was just really exquisitely implemented.

00:49:00.860 --> 00:49:09.000
So, I mean, it's – for some reason, like, my mind always jumps to that, like, because I was like, you know, as I looked at the code, I was just like, I couldn't do a better job.

00:49:09.200 --> 00:49:23.440
I recently saw some guy, I can't remember who, probably in your neighborhood in San Francisco, being interviewed on Bloomberg News about – they had some sort of museum art set up about how code is art and, like, the beauty of algorithms.

00:49:23.440 --> 00:49:25.180
And, you know, maybe that sort of part of it.

00:49:25.540 --> 00:49:27.220
That's a Glitzman.

00:49:27.220 --> 00:49:28.580
He works with you.

00:49:28.580 --> 00:49:29.160
Oh, he works with you?

00:49:29.160 --> 00:49:29.800
Oh, my gosh.

00:49:29.800 --> 00:49:30.600
That's awesome.

00:49:30.600 --> 00:49:31.220
Yeah.

00:49:31.220 --> 00:49:32.220
Yeah.

00:49:32.300 --> 00:49:36.980
So, he was part of one of the acquisitions that we had that used a lot of Python, actually.

00:49:36.980 --> 00:49:40.480
And so, he uses our code internally as well.

00:49:40.480 --> 00:49:44.780
And, no, I mean, he's a super active guy, lots of great ideas.

00:49:44.780 --> 00:49:46.720
I think he's named Benjamin.

00:49:46.720 --> 00:49:47.580
Yeah, that sounds correct.

00:49:47.760 --> 00:49:51.740
I just – I didn't – I was – it was literally on TV, so I didn't, you know, like, save it.

00:49:51.740 --> 00:49:55.020
It was a weird crossover, for sure.

00:49:55.020 --> 00:49:56.480
Let's see.

00:49:56.480 --> 00:50:00.380
But, I mean, in terms of open source projects, I've been spending a lot of time on.

00:50:00.380 --> 00:50:03.320
I mean, I've worked a lot on this one recently called Boltons.

00:50:03.320 --> 00:50:07.840
Basically, like, these are sort of things that I wish were built into Python.

00:50:07.840 --> 00:50:17.740
Like, you know, over the years, I've just sort of accumulated all of these utils, right, that I've seen, like, you know, implementations of in various, like, you know,

00:50:17.740 --> 00:50:19.820
libraries internally, right?

00:50:19.820 --> 00:50:21.540
They're just like, oh, like, why doesn't this exist?

00:50:21.540 --> 00:50:23.680
They'll throw something together that sort of works for them.

00:50:23.680 --> 00:50:26.500
But it's not as well tested and generalized.

00:50:26.500 --> 00:50:31.220
So, this sort of, like, you know, it's just a meta toolbox.

00:50:31.220 --> 00:50:39.560
It's like a toolbox of all these tools for, like, you know, toolboxes for working with, like, a variety of different things, caches and strings.

00:50:39.560 --> 00:50:46.280
And some of them are designed as extensions to, like, Itertools and other built-in, like, modules.

00:50:46.740 --> 00:50:54.400
Itertools was certainly one of, like, I mean, if you ask me what my favorite, like, Python modules were, like, the standard library ones, I have a list for sure.

00:50:54.400 --> 00:50:55.280
Itertools is up there.

00:50:55.280 --> 00:50:57.520
Itertools, collections.

00:50:57.520 --> 00:51:01.280
I mean, I'm a big fan of the select module.

00:51:01.280 --> 00:51:07.340
Like, there are just so many, like, good standard library things built right in.

00:51:07.340 --> 00:51:12.380
That batteries included aspect of Python wasn't just responsible for drawing me to Python in the first place,

00:51:12.380 --> 00:51:19.780
but it was, like, responsible for what I feel was almost like a postgraduate education in, like, you know, programming.

00:51:19.780 --> 00:51:21.580
Like, it's great.

00:51:21.580 --> 00:51:22.620
I'm getting nostalgic now.

00:51:22.620 --> 00:51:23.020
Anyways.

00:51:23.020 --> 00:51:23.580
So.

00:51:23.580 --> 00:51:25.140
Getting emotional about the packages.

00:51:25.140 --> 00:51:25.440
Okay.

00:51:25.720 --> 00:51:32.460
So, is there any final thing you want to kind of call the attention to for the listeners or give a shout-out to or anything like that?

00:51:32.460 --> 00:51:32.800
Well, I mean.

00:51:32.800 --> 00:51:37.880
Like you mentioned in the beginning, we've got, like, one of the things, one of my passion projects on the side is I have a little, like, gig.

00:51:37.880 --> 00:51:38.620
It's not a gig.

00:51:38.620 --> 00:51:39.480
I don't get paid or anything.

00:51:39.480 --> 00:51:40.460
It's called Hat Note.

00:51:40.740 --> 00:51:42.620
You know, we're working on Wikipedia-based projects.

00:51:42.620 --> 00:51:45.600
Maybe you've seen or heard, like, listen to Wikipedia.

00:51:45.600 --> 00:51:52.180
Our new thing is, like, a newsletter that just summarizes all the work that Wikipedians, you know, working on.

00:51:52.180 --> 00:51:54.900
And so, it's called the Weeklypedia.

00:51:54.900 --> 00:51:58.120
You can visit it weekly, like, you know, once per week.

00:51:58.120 --> 00:51:59.580
Weekly.hatnote.

00:51:59.580 --> 00:52:03.800
That's, like, the thing you wear on your head and the thing you write to a loved one.

00:52:03.800 --> 00:52:05.020
Dot com.

00:52:05.020 --> 00:52:05.840
That's fantastic.

00:52:05.840 --> 00:52:08.260
The other one's at listen.hatnote.com.

00:52:08.260 --> 00:52:08.600
Is that right?

00:52:08.600 --> 00:52:09.520
Yeah, yeah, yeah.

00:52:09.740 --> 00:52:14.160
And so, and these are all Python-based as well, open source.

00:52:14.160 --> 00:52:17.580
You can find the code at GitHub.com forward slash hat note.

00:52:17.580 --> 00:52:22.620
You know, those are fun weekend projects that I don't have to hold to.

00:52:22.620 --> 00:52:25.800
They don't have to process money, for example.

00:52:25.800 --> 00:52:27.040
Right, right.

00:52:27.040 --> 00:52:28.020
Yeah, yeah.

00:52:28.020 --> 00:52:33.540
I was, I mean, they are high-quality projects, I like to think, but they don't have to be held to the same scene as Python.

00:52:33.540 --> 00:52:37.280
Right, the consequence of failure is lower, which makes them maybe more relaxing to work on, yeah.

00:52:37.280 --> 00:52:38.540
You nailed it.

00:52:38.540 --> 00:52:39.080
You got me.

00:52:39.480 --> 00:52:41.060
I think that's a wrap.

00:52:41.060 --> 00:52:42.680
Thank you so much, Mahmoud, for being on the show.

00:52:42.680 --> 00:52:44.360
This has been a super interesting conversation.

00:52:44.360 --> 00:52:44.620
My pleasure.

00:52:44.620 --> 00:52:51.340
Yeah, and I think the view inside to some of these big companies, like, it really might give people a different perspective on Python.

00:52:51.340 --> 00:52:52.300
So, I hope so anyway.

00:52:52.300 --> 00:52:54.400
Thank you.

00:52:54.400 --> 00:52:55.860
Yeah, it was great being here.

00:52:55.860 --> 00:52:56.680
Thanks for having me, Michael.

00:52:56.680 --> 00:52:57.480
Yeah, thanks.

00:52:57.480 --> 00:52:57.880
Talk to you later.

00:52:57.880 --> 00:52:58.360
All right.

00:52:58.360 --> 00:52:58.700
Bye-bye.

00:52:59.380 --> 00:53:02.360
This has been another episode of Talk Python To Me.

00:53:02.360 --> 00:53:04.420
This is your host, Michael Kennedy.

00:53:04.420 --> 00:53:09.960
I want to say thank you for listening, and let's let Wikipedia take us on out of here.

00:53:09.960 --> 00:53:29.760
know they heard was interesting.

00:53:29.760 --> 00:53:59.740
The End of the World

00:53:59.740 --> 00:54:04.940
The End of the World