WEBVTT

00:00:00.001 --> 00:00:05.340
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your butts.

00:00:05.340 --> 00:00:11.300
This is episode 122, recorded March 20th, 2019. I'm Michael Kennedy.

00:00:11.300 --> 00:00:12.080
And I'm Brian Okken.

00:00:12.080 --> 00:00:16.340
And this episode is brought to you by DigitalOcean. They have some big news to share with you. I'll

00:00:16.340 --> 00:00:21.080
tell you all about that shortly. Check them out at pythonbytes.fm/digitalocean and get a

00:00:21.080 --> 00:00:26.560
$100 credit for new users. So tell you more about that later. Brian, how are you doing?

00:00:26.560 --> 00:00:31.440
I'm doing good. And if I chuckle, it's because you got your mic up and you kind of look like a

00:00:31.440 --> 00:00:34.700
rapper doing the thing. Yeah, I'm going to drop it at the end of this episode.

00:00:34.700 --> 00:00:40.560
Yeah. Anyway, no, people can't see. Yeah. Like, so I've got my microphone on a different stand. So

00:00:40.560 --> 00:00:44.880
we'll see how it sounds. But yeah, I think it's working. All right. Yeah. Nice. All right. So

00:00:44.880 --> 00:00:52.080
I find dictionaries sometimes get used in Python, like every now and then people will like make you

00:00:52.080 --> 00:00:56.060
so that's fancy data structure. Yeah, definitely. One of the hard things,

00:00:56.060 --> 00:01:01.140
and I don't have a link to this. Maybe we could drop it. But one of the things you need to do with

00:01:01.140 --> 00:01:07.120
dictionaries is pull them apart and put them together and stuff. There's a PEP 584. It's

00:01:07.120 --> 00:01:11.860
had the plus and minus operators to the built in dict class. Yeah, that makes a lot of sense to me. I

00:01:11.860 --> 00:01:17.280
mean, we already have it for list. Well, not the minus, but we have the plus list makes sense because

00:01:17.280 --> 00:01:24.800
it operators are neat. And the thing that throws me off is the massive difference between if you do

00:01:24.840 --> 00:01:29.580
dictionary one plus dictionary two, it's different than dictionary two plus dictionary one,

00:01:29.580 --> 00:01:37.460
because the second thing always wins. Right. If there's duplicate keys, the second one,

00:01:37.460 --> 00:01:40.720
it's going to overwrite the first one. So you're saying that addition might not be

00:01:40.720 --> 00:01:42.600
commutative. That might be a problem.

00:01:42.920 --> 00:01:48.160
Well, maybe, but I mean, like strings are like that. Like if you've got, I don't know, do we do?

00:01:48.160 --> 00:01:52.640
That's true. You don't get the same result of like hello plus world or world plus hello.

00:01:52.860 --> 00:01:58.620
Yeah, exactly. So maybe it's okay. We'll link into the PEP. Actually, I think it's nice because

00:01:58.620 --> 00:02:04.380
if you look at the alternates, the alternates are gross. Like you can unpack both dictionaries and

00:02:04.380 --> 00:02:09.980
then create a new dictionary or you can copy one and then update it with the other that all of those

00:02:09.980 --> 00:02:15.020
are not obvious. And, and so I think plus would be good. So we're going to link to that article,

00:02:15.020 --> 00:02:22.520
but also Guido Van Rossum wrote an article called why operators are useful that partly talks about

00:02:22.520 --> 00:02:29.300
this. And then also there's an email link of why apparently one of the options for combining

00:02:29.300 --> 00:02:34.800
dictionaries was to use the pipe operator instead of plus. And so I've got a link to that too, but

00:02:34.800 --> 00:02:39.820
actually, so this is just a, we don't know if it'll go in, it's in draft status and it just got

00:02:39.820 --> 00:02:43.540
proposed, but I think this is a, would be a neat thing to add to Python.

00:02:43.540 --> 00:02:47.500
Yeah. I'm honestly a little bit surprised. It's not already there. it would be nice.

00:02:47.500 --> 00:02:54.260
I certainly prefer plus over pipe. Like pipe is not something that's commonly used in Python for

00:02:54.260 --> 00:02:58.700
combined stuff. Maybe if this was C or something, I don't know, but, it's certainly in the Python

00:02:58.700 --> 00:03:04.360
world plus seems like a more natural choice here. So this next one comes from Matthew Rockland,

00:03:04.360 --> 00:03:09.900
a guy behind ask and other data sciencey things. I recently interviewed him on talk Python, but you

00:03:09.900 --> 00:03:13.520
know, time shifting, it will be in the future when that comes out. But I was,

00:03:13.520 --> 00:03:16.680
reading through some of his articles and found something I thought, you know, well,

00:03:16.680 --> 00:03:21.980
at least it's super resonated with me. I don't know how your world is Brian, but mine is like a

00:03:21.980 --> 00:03:30.980
constant stream of like inbound inquiries, requests, comments, like watch the talk Python

00:03:30.980 --> 00:03:36.100
Twitter account at my personal Twitter account. We share watching the Python bytes Twitter account.

00:03:36.280 --> 00:03:42.160
I have a getter channel. I'm on a couple of slacks. I'm on like Cisco teams or something like this.

00:03:42.160 --> 00:03:49.400
Email is insane. And there's just too many places that stuff comes at me. And I spend like,

00:03:49.400 --> 00:03:54.500
there's times where I'll take a week and I'll take a full two days off to just write email and respond

00:03:54.500 --> 00:03:58.100
to messages. And I'm still not all the way caught up. It's like, it's really a problem.

00:03:58.660 --> 00:04:04.400
So when I read this article called why I avoid Slack by Matthew Rocklin, I'm like, Oh, yes,

00:04:04.400 --> 00:04:09.520
this definitely resonates with me. Because when you get that much inbound stuff, like anything that's

00:04:09.520 --> 00:04:14.600
transient is super hard to keep track of, right? Like at mentions on Twitter, like maybe I'll catch

00:04:14.600 --> 00:04:19.220
them. But if I don't, like, I'm sorry, but I just, you know, it's I'd lost it. It went by in the stream

00:04:19.220 --> 00:04:26.880
somehow on accident, or something on Slack, right? Like it's 100 messages back. And you know, I dropped

00:04:26.880 --> 00:04:31.120
in there, I didn't check it, marked messages red and left. And now it's just gone, right? It's never

00:04:31.120 --> 00:04:36.940
going to come back. So I feel like those kinds of things, while kind of fun and interesting and more

00:04:36.940 --> 00:04:43.560
lively are also, you know, just adding stress and not not really positive. So Matthew wrote this cool

00:04:43.560 --> 00:04:49.740
article said, saying why avoid Slack focused on for open source maintainers of projects,

00:04:49.740 --> 00:04:55.900
right? Like, should we have a Slack channel for open source project? He says, no. So he says,

00:04:55.900 --> 00:05:01.100
instead of doing something like that, I mean, I guess a Gitter channel would be basically equivalent.

00:05:01.100 --> 00:05:06.900
So as I encourage colleagues to have technical and design conversations on GitHub or some other system

00:05:06.900 --> 00:05:10.280
that is public, permanent, searchable and cross referenceable. What do you think?

00:05:10.280 --> 00:05:16.780
Actually, especially for that case of open source projects, and, and those types of conversations,

00:05:16.780 --> 00:05:18.220
I think I totally agree.

00:05:18.220 --> 00:05:22.740
Yeah. So he says, you know, a couple reasons why, like, say, GitHub, public GitHub repos and their

00:05:22.740 --> 00:05:27.660
issues and their conversations and PRs and whatnot around it are better than Slack would be because

00:05:27.660 --> 00:05:34.100
you can engage collaborators who aren't on Slack, right? Not everyone is on Slack. But if you're working

00:05:34.100 --> 00:05:37.800
with a person who doesn't have a web browser, that's probably okay, you can ignore that person.

00:05:38.420 --> 00:05:44.100
But most people can get to the web and they can read, or even Google search and then find some kind

00:05:44.100 --> 00:05:49.360
of thing. Also, you can record the conversation, because it sounds like his life's a little bit

00:05:49.360 --> 00:05:55.080
like mine, like, hey, everybody just needs a couple of minutes of your time, every couple minutes,

00:05:55.080 --> 00:05:59.020
you know, and it completely derails any form of productivity.

00:05:59.420 --> 00:06:04.500
Yeah, so it's super hard. And the reason is, they'll drop in a Slack channel or some other

00:06:04.500 --> 00:06:08.960
conversation and go, hey, why is it like this? Or just quick question about that. And it's like,

00:06:08.960 --> 00:06:14.640
if you have it in an issue and discussed or something, you can say, that's issue 17725.

00:06:14.640 --> 00:06:19.660
We talked about it for a week. Here's a whole detail, right? Also, you can serve the silent

00:06:19.660 --> 00:06:24.520
majority. That is people who go to Google, and they type in a thing and say, I need help with this

00:06:24.520 --> 00:06:29.920
thing. Or why does this work that way? GitHub ranks super high on Google. And those issues

00:06:29.920 --> 00:06:32.380
often come up and you can see the whole conversation.

00:06:32.380 --> 00:06:33.520
Oh, that's a great idea.

00:06:33.520 --> 00:06:39.720
Yeah, the other one is encourage more thoughtful discourse. So if you're writing like one on one

00:06:39.720 --> 00:06:43.920
or a couple of people on a Slack channel, you're willing to just throw out kind of quick,

00:06:43.920 --> 00:06:48.800
off the cuff comments. If you're writing in a public permanent forum that's associated with

00:06:48.800 --> 00:06:53.520
your GitHub profile, it's much more likely that you're going to write something thoughtful. And

00:06:53.520 --> 00:06:58.440
finally, you get a cross reference issues. So you can say we talked about part of it here and part of

00:06:58.440 --> 00:07:01.960
it over there and this other issue. And then there was this PR and then we're bringing it back here.

00:07:01.960 --> 00:07:07.820
Slack is siloed. You can't cross reference people and conversations and things like that. So here's a

00:07:07.820 --> 00:07:15.420
call to say enjoy Slack, chat in Slack, but don't use Slack for design decisions and other stuff,

00:07:15.420 --> 00:07:20.420
right? Like maintainers come and go. Maybe you want to have a history of these things and not just a

00:07:20.420 --> 00:07:21.600
transient chat stream.

00:07:21.600 --> 00:07:26.220
Yeah. And the bigger a Slack channel gets, the more useful it is in some respects. You get answers

00:07:26.220 --> 00:07:33.320
really quickly. But also the more it reflects like kind of just a topical party at somebody's house

00:07:33.320 --> 00:07:34.920
with lots of conversations going on.

00:07:34.920 --> 00:07:38.500
Right. There was a cool chat about this thing on the couch, but that doesn't, that's not the same as

00:07:38.500 --> 00:07:40.840
like we wrote up our thoughts on that thing.

00:07:40.840 --> 00:07:42.860
Yeah, exactly. I'll have to read this.

00:07:42.860 --> 00:07:46.920
Yeah, it's pretty good. It's not much longer than actually what I talked about, but it's still

00:07:46.920 --> 00:07:47.720
really helpful, I think.

00:07:47.720 --> 00:07:47.960
Yeah.

00:07:47.960 --> 00:07:49.040
What's the next one you got for us?

00:07:49.040 --> 00:07:52.960
That reminds me, actually. No, I had a leak in my memory. No, that's bad.

00:07:52.960 --> 00:07:57.060
That's pretty good, actually. It's so bad it's good. I like it.

00:07:57.060 --> 00:08:04.560
There's an article from Zendesk from YQO that's called Hunting for Memory Leaks in Python

00:08:04.560 --> 00:08:11.100
and we've covered memory leak stuff before, but I really like this write-up. And it's specifically,

00:08:11.100 --> 00:08:18.420
they've got, Zendesk has a bunch of machine learning in Python written. And one of the problems they run

00:08:18.420 --> 00:08:24.240
into is some of them will have really big memory spikes or memory leaks, and they want to try to

00:08:24.240 --> 00:08:30.380
figure that out. So this was a specific use case. So he's not covering all of the options, just some of

00:08:30.380 --> 00:08:35.180
the tools that were used there. And I think it's cool. I didn't know some of these things were around.

00:08:35.180 --> 00:08:42.000
So there's a, for example, there's a combination of the memory profiler package with matplotlib

00:08:42.000 --> 00:08:48.660
where you can easily run, without doing anything to your code, you can run some Python code and then

00:08:48.660 --> 00:08:54.880
get a visual graph of the memory utilization, which was cool. If you're hunting into stuff and trying to

00:08:54.880 --> 00:09:00.320
break things around, there was a discussion of using, adding some code to your code to use,

00:09:00.320 --> 00:09:02.820
it looks like Muppi, M-U-P-P-I.

00:09:02.820 --> 00:09:03.480
Yeah, Muppi.

00:09:03.480 --> 00:09:09.760
That will dump, heap dump in certain places. So if you, if you think, sometimes time really doesn't

00:09:09.760 --> 00:09:13.580
help you too much, but you can add certain places where you think you're at a stable state,

00:09:13.580 --> 00:09:18.200
doing a heap dump, especially if it's somewhere, something that's looping, you might be able to

00:09:18.200 --> 00:09:25.800
catch something there. A reference to object graph or object graph to profile memory object lineage.

00:09:25.800 --> 00:09:27.980
So objects that create other objects.

00:09:27.980 --> 00:09:33.180
Yeah, that can be tricky because you've got, maybe you have some object, it's a class and it's got some

00:09:33.180 --> 00:09:37.800
field, that field, it's a list. In that list, it has a bunch of objects. One of those happens to hold on

00:09:37.800 --> 00:09:42.660
to a pointer to some other huge dictionary that you thought like should be gone, but right, there's still

00:09:42.660 --> 00:09:46.780
some reference keeping it alive, right? So this object graph will like tell you that basically.

00:09:46.780 --> 00:09:47.440
Yeah. Nice.

00:09:47.440 --> 00:09:52.500
Like for example, when he dumped some of the heap dumps, some of those examples,

00:09:52.500 --> 00:09:58.420
it's just that you've got like so many megabytes towards strings. Well, I don't know if that really

00:09:58.420 --> 00:10:02.720
helps you too much. Having a, finding out where it came from might be helpful.

00:10:02.720 --> 00:10:02.980
Yep.

00:10:02.980 --> 00:10:07.840
And then he ends the article with a, with a bunch of tips, do quick feedback. If you think something,

00:10:07.840 --> 00:10:12.700
one of the things I liked, which is probably really good is if you have a memory intensive tasks

00:10:12.700 --> 00:10:17.700
or something you think might be the problem, separate that into a separate process so you

00:10:17.700 --> 00:10:22.980
can debug it separately. The Python built-in PDB has a bunch of stuff that can help you as

00:10:22.980 --> 00:10:28.920
well. And then also watch out for leaky packages because the leak might not be in yours. It might

00:10:28.920 --> 00:10:30.280
be in your dependencies.

00:10:30.280 --> 00:10:33.060
Yeah. You might've pip installed a memory leak for sure.

00:10:33.200 --> 00:10:37.620
Which I was surprised that he said, for example, pandas. And I'm like, really? Pandas is like,

00:10:37.620 --> 00:10:43.220
must be tested the heck out of it. But apparently there's some known pandas problems in some corner

00:10:43.220 --> 00:10:44.340
cases, but oh well.

00:10:44.340 --> 00:10:50.040
Yeah. It probably is kind of tricky with like the C layer holding onto PI object references and all

00:10:50.040 --> 00:10:51.440
sorts of funkiness. Right.

00:10:51.440 --> 00:10:55.860
My first reaction to dealing with memory in Python is like, well, we're not supposed to have to,

00:10:55.860 --> 00:11:00.620
so it must be a real pain in the rear. But these tools don't look that bad to work with if you need

00:11:00.620 --> 00:11:00.840
to.

00:11:00.840 --> 00:11:07.420
This object graph looks really cool. And it will actually create a PNG visual graph of the

00:11:07.420 --> 00:11:12.720
relationships, which is cool. And you can even ask for back references. Like it seems like this is the

00:11:12.720 --> 00:11:17.500
thing that has all the memory. It should be gone, but why is it not garbage collected or cleaned up?

00:11:17.660 --> 00:11:24.180
And you can say, draw me a graph or not a, like a mathematical graph, not a parabola type graph,

00:11:24.180 --> 00:11:28.640
a graph theory graph of all the back references to this object, which is pretty cool.

00:11:28.640 --> 00:11:28.840
Oh, nice.

00:11:28.840 --> 00:11:30.660
Yeah. So you can ask it in both directions.

00:11:30.660 --> 00:11:34.080
Yeah. Right. If you think it should have been deleted and it's not, it's because somebody's

00:11:34.080 --> 00:11:34.880
still referencing it.

00:11:34.880 --> 00:11:37.860
Right. So who is that? Tell me about that. I need to know about that right now.

00:11:37.860 --> 00:11:38.140
Yeah.

00:11:38.140 --> 00:11:41.980
Yeah. That looks really cool. It's definitely something I'd like to explore. Actually,

00:11:41.980 --> 00:11:45.520
let me rephrase that. I don't want to explore it. I don't want to have memory leaks,

00:11:45.520 --> 00:11:47.320
but if I do, I will find it very useful.

00:11:47.640 --> 00:11:48.420
Yes, definitely.

00:11:48.420 --> 00:11:53.820
There you go. Also useful, DigitalOcean. Let me tell you a cool thing that they just released.

00:11:53.820 --> 00:11:57.180
And this came from one of the listeners. They sent me a message like, Hey, this looks really

00:11:57.180 --> 00:12:02.340
cool. Do you know about this? So they announced this thing called the DigitalOcean Marketplace.

00:12:02.340 --> 00:12:08.160
So the idea is that different companies and other people can create these pre-configured

00:12:08.160 --> 00:12:13.360
virtual machines. And then you can just do one click app, install them. Like if you want a ghost

00:12:13.360 --> 00:12:17.680
ghost blog server configured with Nginx and all that, you just click ghost blog server,

00:12:17.680 --> 00:12:20.200
pay your $5 and now you have one.

00:12:20.200 --> 00:12:20.560
Nice.

00:12:20.640 --> 00:12:28.200
Or maybe you want like GitLab Enterprise, a MongoDB server, or even you can say, I want a Django server. And it'll give you Django,

00:12:28.200 --> 00:12:34.000
Nginx, Gunicorn, Postgres, CertBot, a whole bunch of stuff pre-configured all to work together like in a few seconds.

00:12:34.000 --> 00:12:34.900
That's pretty cool, right?

00:12:34.900 --> 00:12:35.680
Yeah, definitely.

00:12:35.920 --> 00:12:40.220
Yeah, yeah. So I think this is a really nice feature. You know, it's already great to run

00:12:40.220 --> 00:12:45.120
infrastructure there. And now if you can like get it much closer to the end, it's a little bit,

00:12:45.120 --> 00:12:49.260
I'm sure it's a Docker inspired, right? It seems like that, but for their infrastructure.

00:12:49.260 --> 00:12:53.140
You still have to figure all that stuff out and to be able to throw a few dollars to the people

00:12:53.140 --> 00:12:55.240
who are willing to do the work to put it together. That's great.

00:12:55.240 --> 00:12:55.860
Yeah, it's beautiful.

00:12:55.860 --> 00:13:02.040
All right. So check them out over at pythonbytes.fm/DigitalOcean, create an account. And then once you

00:13:02.040 --> 00:13:07.260
get into your account, there's a little marketplace tab over there. So super cool. So speaking of Docker

00:13:07.260 --> 00:13:14.920
and all these other things, there's a cool article by Craig Kirstens, and it's called Give Me My Monolith

00:13:14.920 --> 00:13:20.920
Back, or Give Me Back My Monolith, as opposed to a whole bunch of microservices, right? So there's

00:13:20.920 --> 00:13:28.100
been a lot of hype, excitement, I don't know, take your, choose your side of the fence around microservices.

00:13:28.100 --> 00:13:34.220
And this is the idea of like, yeah, you have a web app, and it's got like 500 Python files,

00:13:34.220 --> 00:13:38.840
and maybe it's doing all these different things. And wouldn't it be better if we could take the credit

00:13:38.840 --> 00:13:45.240
card processing and make it its own service with its own database? If we could make the caching its own

00:13:45.240 --> 00:13:50.980
service, its user accounts, its own service, all that kind of stuff. And then that user account part is

00:13:50.980 --> 00:13:56.040
super simple, right? Because the whole purpose of this application is, who are you? What can you do?

00:13:56.040 --> 00:13:58.760
Can you log in? Can you reset your password? Or something like this, right?

00:13:58.760 --> 00:14:02.220
This seems good, yeah? Yeah. There's a lot of really good uses for this. Like,

00:14:02.220 --> 00:14:08.180
if you have a large team of people working on a large web app, it might make more sense to break

00:14:08.180 --> 00:14:13.020
into these small pieces and have some people in charge of each piece. I think that actually

00:14:13.020 --> 00:14:16.980
legitimately makes a lot of sense. It's easy to bring on a junior developer who can say,

00:14:16.980 --> 00:14:21.200
all right, I'm going to work on this caching bit or whatever. And I don't have to know the whole

00:14:21.200 --> 00:14:25.840
thing. I just got to work on my little API. It does court, async or whatever it does.

00:14:25.840 --> 00:14:30.880
That makes a lot of sense. But most people who are working on web apps aren't in that space of having

00:14:30.880 --> 00:14:35.380
like 30 people on their team, right? That's really rare, right? You've gone down this rant of you're

00:14:35.380 --> 00:14:39.280
not Google, you're not Facebook, you're not LinkedIn, right? You don't need all these patterns because you

00:14:39.280 --> 00:14:46.580
are not them. You're a little relatively smaller company or project. Anyway, this guy feels like,

00:14:46.580 --> 00:14:52.000
you know, that adds a lot of complexity and challenges. And he lays them out of like,

00:14:52.000 --> 00:14:56.880
why does the world have to be so hard? Wasn't it easy before? And now it's not,

00:14:56.880 --> 00:15:02.260
not from the article, but just a thought of mine. Like when I think of this microservice architecture,

00:15:02.260 --> 00:15:07.840
what you're doing is you're taking code complexity, and you're moving it to infrastructure complexity.

00:15:07.840 --> 00:15:08.800
Yeah, definitely.

00:15:08.800 --> 00:15:15.120
Instead of having one kind of complicated bit of code, I now have 12 super simple bits of code,

00:15:15.120 --> 00:15:20.300
but they all have to work together in like fairly complicated network environments, failover,

00:15:20.300 --> 00:15:26.200
you know, all this kind of stuff, this topography and whatnot. So my thought is at least, you know,

00:15:26.200 --> 00:15:30.160
like, well, which of those two things are you good at? Infrastructure or code? You know,

00:15:30.160 --> 00:15:34.540
that drives a lot of these decisions. But he runs down a couple of things that he said

00:15:34.540 --> 00:15:41.840
used to be simple, but now we get to revisit them, get to. So setup went from like chemistry to quantum

00:15:41.840 --> 00:15:48.480
mechanics. A lot of this has to do with bringing new people onto a team or junior developers and things

00:15:48.480 --> 00:15:53.220
like that. So it says, onboarding a new engineer, at least for the initial environment used to be like

00:15:53.220 --> 00:15:58.760
half a day. And now we've ventured into microservices, this onboarding time is skyrocketed,

00:15:58.760 --> 00:16:04.500
and it's super complicated for them to understand all the moving pieces. And then the next one,

00:16:04.500 --> 00:16:08.820
is so long for understanding our systems. You know, back when we had monolithic apps,

00:16:08.820 --> 00:16:13.540
you had an error, it had a stack trace, you click on the hyperlink generated by your little

00:16:13.540 --> 00:16:20.040
editor to take you to the line where the stack trace is. And now you have different services that

00:16:20.040 --> 00:16:24.060
talk to another service that cue something on a message bus that another service pulls it out,

00:16:24.060 --> 00:16:29.340
and then you get an error. What caused that? Right? How do you try? How do you follow that through?

00:16:29.340 --> 00:16:33.840
How do you debug that? So it says, well, if we can't debug them, maybe we can test them talks

00:16:33.840 --> 00:16:38.960
about the challenges of continuous integration, and whatnot, but also talks about some services

00:16:38.960 --> 00:16:43.280
that were made into some apps that were made into microservice that are now moving back,

00:16:43.280 --> 00:16:48.720
sort of in a reverse migration to these monoliths. And, you know, I got to say, I'm pretty sympathetic

00:16:48.720 --> 00:16:54.120
with this. Like I see the value of microservices, but I also know that I'm not Google.

00:16:54.120 --> 00:17:00.220
Right? And so, yeah, anyway, for me, I don't think this whole microservice world makes as much

00:17:00.220 --> 00:17:02.940
sense in my space, but I don't know. What do you think?

00:17:02.940 --> 00:17:05.340
We should go back to HTML and Perl.

00:17:05.340 --> 00:17:10.460
That's right. Can't we just have static files? All this like logic is bust in your brain.

00:17:10.460 --> 00:17:12.300
CGI used to be easy. No.

00:17:12.300 --> 00:17:14.500
No, it actually was never, ever easy.

00:17:14.500 --> 00:17:19.300
I think that there's different ways to solve problems. And I think that making sure that

00:17:19.300 --> 00:17:23.660
you're paying attention to it, I think is a good, good idea. And make sure that people understand

00:17:23.660 --> 00:17:31.740
that microservices are a, are sometimes it's a funny, funny, it's a shiny new thing to go learn. And,

00:17:31.740 --> 00:17:37.660
and sometimes that's not bad if you're willing to take on the risks, but, but it is a changing

00:17:37.660 --> 00:17:40.460
from what you know to what you don't know is a risk.

00:17:40.460 --> 00:17:45.140
So it's definitely exciting. I mean, you can bring in Docker and Kubernetes and do all sorts of fun stuff,

00:17:45.140 --> 00:17:48.520
but at the same time, just be aware of the trade-offs you're making.

00:17:48.520 --> 00:17:51.780
Some of the things that it's solved are now solved by Async.

00:17:51.900 --> 00:17:52.900
Yeah, that's true. Absolutely.

00:17:52.900 --> 00:17:57.380
One of the things also is if you're in a single language or not. So one of the things that

00:17:57.380 --> 00:18:02.260
microservices gives you is the different teams can do whatever language they want, as long as they

00:18:02.260 --> 00:18:05.220
provide an interface that's compatible with everybody.

00:18:05.220 --> 00:18:10.500
The authentication bits in Node.js, the caching tiers and something else. And you know,

00:18:10.500 --> 00:18:12.100
the front ends in Python or whatever.

00:18:12.100 --> 00:18:13.140
Yeah, definitely.

00:18:13.140 --> 00:18:18.640
Yeah. Makes sense. Again, it's not something you will do that often when you're just a couple of people,

00:18:18.640 --> 00:18:21.200
but if you're a big team or set of teams, then sure.

00:18:21.200 --> 00:18:22.040
Makes a lot of sense.

00:18:22.040 --> 00:18:22.280
Yeah.

00:18:22.280 --> 00:18:29.200
All right. So I know of some famous laws and rules in software development, like the solid principles,

00:18:29.200 --> 00:18:34.040
single responsibility principle, open, close principle. These are all good. You found some more

00:18:34.040 --> 00:18:35.860
amusing ones, didn't you?

00:18:35.860 --> 00:18:41.480
Yeah. Some of them are serious and some are amusing. All of them have kind of a little bit of truth.

00:18:41.740 --> 00:18:48.280
And this is an older article, so I'm not really sure how I got a hold of it, but it's the famous laws of software development.

00:18:48.280 --> 00:18:57.080
And there are 13 listed. I think I counted that many. I'm not going to read all 13. I guess it was written in 2017. It's not that old.

00:18:57.740 --> 00:19:07.380
But okay, so Hofstetter's law, which is great. It always takes longer than you expect, even when you take into account Hofstetter's law. So it's self-referencing.

00:19:07.520 --> 00:19:11.060
I love it. Yeah, I love it. There's some many good ones here.

00:19:11.060 --> 00:19:22.840
So that's just funny. There's Conway's law, which it's not supposed to be funny, but it's sometimes depressing. Any piece of software reflects the organizational structure that produced it.

00:19:22.900 --> 00:19:24.040
Yeah, I think that's true.

00:19:24.040 --> 00:19:47.320
Like microservices are great for lots of teams. One team, one monolith or something. I don't know. But I've seen that before. Also, the hierarchy of different teams shows up in the software as well. And then, of course, a couple more I'd like to point out. The peer principle. In any hierarchy, every employee tends to rise to his level of incompetence.

00:19:48.000 --> 00:19:54.960
Sounds like a quote from the despair, Inc. calendars or posters. That's great.

00:19:54.960 --> 00:20:02.220
Yeah. And then the 90-90 rule, which I haven't actually heard before, but it's just hilarious. Have you heard this before?

00:20:02.220 --> 00:20:02.620
No.

00:20:02.620 --> 00:20:08.720
The first 90% of the code takes 10% of the time. The remaining 10% takes the other 90% of the time.

00:20:08.720 --> 00:20:15.860
That sounds about right to me. Yeah, it's definitely, it feels like things just drag on and on right at the end of these projects.

00:20:16.260 --> 00:20:30.780
So, the comments are good too. I noticed that some people, a guy named Corey threw in a thing and said, I'm shocked that Cunningham's Law isn't on the list. Cunningham's Law. The fastest way to get help over the internet is not to ask a question, but instead to answer it wrong.

00:20:30.780 --> 00:20:37.640
And then someone also responds, maybe its omission was a conscious choice to invoke it.

00:20:39.240 --> 00:20:39.920
That's awesome.

00:20:39.920 --> 00:20:42.080
Yeah, it's really good. There's a bunch of nice ones in there.

00:20:42.080 --> 00:20:48.520
Yeah, that's like real though. I mean, the best way to get people to help you on the internet is to start blogging the wrong stuff.

00:20:48.520 --> 00:20:53.300
Yeah, enable comments and start writing. That's cool.

00:20:54.060 --> 00:21:01.580
I got a quick one to round it out here. We talked about a plugin architecture before for building plugins that ran like within your app.

00:21:01.580 --> 00:21:09.440
So, basically, ways to let people interface like simple bits of code into your other systems and version plugins and all that.

00:21:09.740 --> 00:21:13.540
There's another one called beer garden plugins, which is pretty fun.

00:21:13.540 --> 00:21:15.060
One of the listeners suggested this.

00:21:15.060 --> 00:21:19.280
So, the idea is it's a framework that will convert your functions.

00:21:19.280 --> 00:21:21.500
These are like regular Python scripts.

00:21:21.500 --> 00:21:24.980
They don't know anything about the web or plugins or whatever.

00:21:24.980 --> 00:21:32.440
Convert those into composable, discoverable, production-ready services, as in RESTful HTTP services with minimal overhead.

00:21:33.180 --> 00:21:42.280
So, if you have a class, you can just go say this is a system and then the functions on the class, you go these are services and they take these parameters and you describe what they take, things like that.

00:21:42.280 --> 00:21:45.120
And it will just go serve that.

00:21:45.120 --> 00:21:51.080
And it even does cool stuff like it does swagger documentation of the services and whatnot.

00:21:51.080 --> 00:21:57.020
So, yeah, it's a pretty interesting little quick way to convert code that was not meant to be a service into services.

00:21:57.020 --> 00:21:57.960
Oh, very cool.

00:21:57.960 --> 00:21:58.240
Yeah.

00:21:58.240 --> 00:21:59.340
It's pretty cool.

00:21:59.340 --> 00:22:04.280
It's apparently based on MongoDB, RabbitMQ, and it supports modern Python.

00:22:04.280 --> 00:22:05.500
So, that's pretty cool.

00:22:05.500 --> 00:22:07.820
It talks about what you have to do to get it running.

00:22:07.820 --> 00:22:13.220
Or, something that's kind of nice, is it also comes in a Docker and Docker Compose form.

00:22:13.220 --> 00:22:21.280
So, you can just clone the Docker Compose bit from GitHub and then you say Docker Compose up and now it's up and running.

00:22:21.280 --> 00:22:24.440
And then you can give it these little apps and whatnot.

00:22:24.440 --> 00:22:24.920
It's pretty cool.

00:22:24.920 --> 00:22:25.320
Nice.

00:22:25.320 --> 00:22:25.600
Yeah.

00:22:25.600 --> 00:22:29.820
So, I think the idea is you run your code and it plugs into the server there.

00:22:29.820 --> 00:22:30.260
So, yeah.

00:22:30.260 --> 00:22:31.660
Anyway, it's pretty neat.

00:22:31.660 --> 00:22:34.440
People can check that out if that sounds like something they're looking for.

00:22:34.440 --> 00:22:35.200
All right.

00:22:35.200 --> 00:22:37.380
Well, that's it for official items.

00:22:37.380 --> 00:22:40.640
Anything else you want to cover here at the end?

00:22:40.640 --> 00:22:43.680
Just had a really cool interview the other day.

00:22:44.220 --> 00:22:51.140
This will go out as Test Encode 69, which should be available for everybody before you listen to this.

00:22:51.140 --> 00:22:56.740
But it was with Andy Hunt, who is now at the head of Pragmatic Programmer.

00:22:56.740 --> 00:22:57.420
I mean...

00:22:57.420 --> 00:22:57.540
Yeah.

00:22:57.540 --> 00:22:59.680
He's one of the original founders of it, right?

00:22:59.680 --> 00:23:01.180
Him and one other guy, I think.

00:23:01.180 --> 00:23:01.440
Yeah.

00:23:01.440 --> 00:23:01.660
Is that right?

00:23:01.660 --> 00:23:04.520
Andy Hunt and Dave Thomas wrote the Pragmatic Programmer.

00:23:05.000 --> 00:23:06.520
And that was released in 99.

00:23:06.520 --> 00:23:09.620
And then in 2003, they formed their own publishing company.

00:23:09.620 --> 00:23:11.040
And they've been going strong.

00:23:11.040 --> 00:23:13.380
And the pytest book was under their publishing company.

00:23:13.380 --> 00:23:19.640
And so now Dave doesn't play an active role in the publishing anymore, but Andy does.

00:23:19.640 --> 00:23:21.700
And so it's a really cool conversation.

00:23:21.700 --> 00:23:25.860
Andy was also one of the original signers of the Agile Manifesto.

00:23:25.860 --> 00:23:27.780
And so we talk a lot about...

00:23:27.780 --> 00:23:28.100
Oh, right.

00:23:28.100 --> 00:23:28.740
That's cool.

00:23:28.740 --> 00:23:29.080
Yeah.

00:23:29.080 --> 00:23:31.780
We talk a lot about that and quite a few other things.

00:23:31.780 --> 00:23:33.880
So that's a fun thing to listen to.

00:23:33.980 --> 00:23:34.160
Excellent.

00:23:34.160 --> 00:23:35.960
I'm definitely going to check it out when you release it.

00:23:35.960 --> 00:23:36.500
That's a good one.

00:23:36.500 --> 00:23:36.880
How about you?

00:23:36.880 --> 00:23:39.080
So I have two quick things to share with you.

00:23:39.080 --> 00:23:42.200
First, there's this thing called Firefox Send.

00:23:42.200 --> 00:23:43.460
Have you heard of this?

00:23:43.460 --> 00:23:44.200
I have not.

00:23:44.200 --> 00:23:44.520
Yeah.

00:23:44.520 --> 00:23:49.060
So Firefox Send is actually not something built into Firefox, but it's more like a Mozilla

00:23:49.060 --> 00:23:50.900
project to make the web better, right?

00:23:50.900 --> 00:23:58.680
So here's what it does is it lets you share files securely, large files, like up to two and

00:23:58.680 --> 00:24:00.040
a half gigs per file.

00:24:00.780 --> 00:24:09.160
And it does end to end encryption, where the decryption key is actually stored in the

00:24:09.160 --> 00:24:09.480
URL.

00:24:09.480 --> 00:24:14.380
So if you don't share the URL, like even the Firefox Send people can't decrypt it or whatever.

00:24:14.380 --> 00:24:14.940
Okay.

00:24:14.940 --> 00:24:15.820
Interesting.

00:24:15.820 --> 00:24:21.320
So basically, it's a way to serve these files around like without putting it into Dropbox

00:24:21.320 --> 00:24:26.740
or OneDrive or Google Drive or whatever, where it's like permanently there, it's going to be

00:24:26.740 --> 00:24:27.340
backed up.

00:24:27.340 --> 00:24:30.740
It's, you know, who knows like if you would ever truly delete that thing, right?

00:24:30.740 --> 00:24:35.700
Whereas here, the maximum life of one of these files is seven days.

00:24:35.700 --> 00:24:39.920
And you can even say it can only be downloaded one time and delete it in an hour or something

00:24:39.920 --> 00:24:40.380
like that.

00:24:40.380 --> 00:24:44.420
And of course, the encryption key is not stored with the Firefox folks.

00:24:44.420 --> 00:24:47.500
So like if it gets lost, you know, it's not that big of a deal.

00:24:47.500 --> 00:24:47.940
Interesting.

00:24:47.940 --> 00:24:49.340
I'll have to check that out.

00:24:49.340 --> 00:24:49.480
Yeah.

00:24:49.480 --> 00:24:50.700
It's a free, quick little thing.

00:24:50.700 --> 00:24:55.440
You can either sign in and have a larger, larger file options or smaller ones if you want to

00:24:55.440 --> 00:24:56.640
say and stay anonymous.

00:24:56.840 --> 00:24:59.140
But yeah, definitely, I think it fills a cool need.

00:24:59.140 --> 00:25:03.220
And it's kind of nice to see Mozilla just, you know, making the web better in that way.

00:25:03.220 --> 00:25:05.340
And it's, it doesn't depend on Firefox.

00:25:05.340 --> 00:25:07.300
It just happens to be made by them.

00:25:07.300 --> 00:25:07.580
Okay.

00:25:07.580 --> 00:25:07.920
Nice.

00:25:07.920 --> 00:25:10.900
Speaking of making stuff better, do you know what I really hate?

00:25:10.900 --> 00:25:17.300
I hate going to weather.com and I'm saying, oh, it looks like you're running an ad blocker.

00:25:17.300 --> 00:25:22.900
We want to serve you crap ads from an ad network and that may have malicious content and

00:25:22.900 --> 00:25:23.740
JavaScript in it.

00:25:23.740 --> 00:25:25.160
So please whitelist us.

00:25:25.940 --> 00:25:31.640
And every time I see that, I think if you, and these are not small little blogs or like

00:25:31.640 --> 00:25:33.240
little article sites.

00:25:33.240 --> 00:25:38.220
These are CNN, the weather channel, like major, major places.

00:25:38.220 --> 00:25:38.460
Right.

00:25:38.460 --> 00:25:43.180
And I always think, you know, look, if you want to serve ads to me, why don't you do it on

00:25:43.180 --> 00:25:51.200
a system that is not broken on a way that will not put my computer and my information and everything

00:25:51.200 --> 00:25:52.280
else at risk?

00:25:52.780 --> 00:25:59.000
You could easily talk to your sponsors, put an image on your site, let people click on

00:25:59.000 --> 00:26:00.420
it and it takes them to their offer.

00:26:00.420 --> 00:26:03.820
But no, they want to run, you know, all sorts of retargeting and tracking.

00:26:04.160 --> 00:26:09.880
And they want to figure out like, oh, are you, you are, are you a woman who is 36, who is

00:26:09.880 --> 00:26:11.540
also search for this, right?

00:26:11.540 --> 00:26:12.300
Like it's really shady.

00:26:12.500 --> 00:26:20.840
So this is not a change for us, but this is more of a make it explicit for us on pythonbytes.fm

00:26:20.840 --> 00:26:22.340
and also talk python.fm.

00:26:22.340 --> 00:26:24.040
We don't pop up these.

00:26:24.040 --> 00:26:25.460
Hey, it looks like you're running an ad blocker.

00:26:25.460 --> 00:26:26.280
Please stop it.

00:26:26.940 --> 00:26:31.740
Because our ads still show when there's an ad blocker, because all they are is images.

00:26:31.740 --> 00:26:33.200
We're not trying to retarget anyone.

00:26:33.200 --> 00:26:33.680
Isn't that cool?

00:26:33.680 --> 00:26:34.480
That is very cool.

00:26:34.480 --> 00:26:34.900
Yeah.

00:26:34.900 --> 00:26:35.140
Yeah.

00:26:35.300 --> 00:26:40.520
So there's this move I've seen on the internet to talk, just sort of a pushback on that to

00:26:40.520 --> 00:26:42.040
say, no, these are ethical ads.

00:26:42.040 --> 00:26:44.600
You know, you see this on read the docs and other places.

00:26:44.600 --> 00:26:48.320
So I put a little note under our ad saying, these ads are served ethically.

00:26:48.320 --> 00:26:49.180
We don't track you.

00:26:49.180 --> 00:26:50.860
We don't retarget you.

00:26:50.860 --> 00:26:51.640
We don't do anything.

00:26:51.640 --> 00:26:53.520
But here's our sponsor.

00:26:53.520 --> 00:26:56.840
If you like it, if you like the product, you want to support us, click on it.

00:26:56.840 --> 00:27:01.320
And that will, that will, they'll know that you came from us because of the URL.

00:27:01.320 --> 00:27:02.640
And that's all you need, right?

00:27:02.640 --> 00:27:07.440
So I really wish all these places that say, please whitelist us instead said, could we

00:27:07.440 --> 00:27:12.340
have a better business model where we don't have to track people and do all sorts of nefarious

00:27:12.340 --> 00:27:12.640
stuff?

00:27:12.640 --> 00:27:14.240
So we're opting out.

00:27:14.240 --> 00:27:14.740
Good job.

00:27:14.740 --> 00:27:14.940
Yeah.

00:27:14.940 --> 00:27:15.320
Thanks.

00:27:15.320 --> 00:27:15.760
All right.

00:27:15.760 --> 00:27:19.000
Well, I believe it's time to laugh a little bit.

00:27:19.000 --> 00:27:20.400
Yeah.

00:27:20.400 --> 00:27:21.280
All right.

00:27:21.280 --> 00:27:21.660
Go first.

00:27:21.660 --> 00:27:24.760
I really like this joke that Derek Chambers submitted.

00:27:24.760 --> 00:27:31.180
It is, what do you call it when a Python programmer refuses to implement custom objects?

00:27:31.180 --> 00:27:31.680
What's that?

00:27:31.680 --> 00:27:32.120
I don't know.

00:27:32.120 --> 00:27:33.300
Self-deprivation.

00:27:33.300 --> 00:27:37.080
And then he adds, sorry, that joke was really classless.

00:27:37.080 --> 00:27:39.000
Yeah, that's pretty good.

00:27:39.000 --> 00:27:39.400
I love it.

00:27:39.400 --> 00:27:41.140
The classless, classless Python.

00:27:41.140 --> 00:27:41.940
Cool.

00:27:41.940 --> 00:27:43.420
So I have another one for you.

00:27:43.420 --> 00:27:48.520
And I'm, I pretty much have an infinite supply of these now that I've pip X installed PyJokes.

00:27:48.520 --> 00:27:49.100
Okay.

00:27:49.100 --> 00:27:53.860
So I ran this before our episode and this one came up, said, I had a problem.

00:27:53.860 --> 00:27:54.920
So I thought I'd use Java.

00:27:54.920 --> 00:27:56.700
Now I have a problem factory.

00:27:59.760 --> 00:28:00.540
I love it.

00:28:00.540 --> 00:28:03.340
Anyway, that's, that's the jokes.

00:28:03.340 --> 00:28:08.380
And if you, if you find yourself wanting more jokes between now and the next episode release,

00:28:08.380 --> 00:28:12.580
you can always pip X install PyJokes and, you know, get your fix on the command line.

00:28:12.580 --> 00:28:12.940
Yeah.

00:28:13.240 --> 00:28:14.020
Oh, here's one more.

00:28:14.020 --> 00:28:14.400
Okay.

00:28:14.400 --> 00:28:15.520
I just ran it.

00:28:15.520 --> 00:28:16.660
I got to do this one also.

00:28:16.660 --> 00:28:19.320
There's only two hard problems in computer science.

00:28:19.320 --> 00:28:22.560
Cash invalidation, naming things and off by one errors.

00:28:22.560 --> 00:28:24.060
Nice.

00:28:24.060 --> 00:28:25.120
Yeah.

00:28:25.120 --> 00:28:26.940
There's good jokes in that PyJokes set.

00:28:26.940 --> 00:28:27.700
I love it.

00:28:27.700 --> 00:28:27.940
Yeah.

00:28:27.940 --> 00:28:29.160
There's not an infinite number.

00:28:29.160 --> 00:28:31.080
So people still keep sending us jokes.

00:28:31.080 --> 00:28:31.600
We love them.

00:28:31.600 --> 00:28:31.900
Yeah.

00:28:31.900 --> 00:28:33.220
We're going to hit the limit eventually.

00:28:33.220 --> 00:28:35.880
It's got to happen, but definitely fun.

00:28:35.880 --> 00:28:38.340
So thank you for sending that in Derek and Brian.

00:28:38.340 --> 00:28:39.900
Thanks for doing this with me as every week.

00:28:39.900 --> 00:28:40.120
Yep.

00:28:40.120 --> 00:28:40.600
Thank you.

00:28:40.600 --> 00:28:40.900
You bet.

00:28:40.900 --> 00:28:41.400
Talk to you later.

00:28:41.780 --> 00:28:43.320
Thank you for listening to Python Bytes.

00:28:43.320 --> 00:28:45.860
Follow the show on Twitter via at Python Bytes.

00:28:45.860 --> 00:28:48.700
That's Python Bytes as in B-Y-T-E-S.

00:28:48.700 --> 00:28:51.940
And get the full show notes at pythonbytes.fm.

00:28:51.940 --> 00:28:56.160
If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

00:28:56.160 --> 00:28:58.860
We're always on the lookout for sharing something cool.

00:28:58.860 --> 00:29:01.980
On behalf of myself and Brian Okken, this is Michael Kennedy.

00:29:01.980 --> 00:29:05.400
Thank you for listening and sharing this podcast with your friends and colleagues.