WEBVTT

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

00:00:05.520 --> 00:00:11.320
This is episode 390, recorded July 2nd, 2024.

00:00:11.320 --> 00:00:12.600
I'm Michael Kennedy.

00:00:12.600 --> 00:00:13.660
And I'm Brian Okken.

00:00:13.660 --> 00:00:17.020
And this episode is brought to you by Scout APM.

00:00:17.020 --> 00:00:19.180
Thank you so much to them for supporting the show.

00:00:19.180 --> 00:00:20.100
We really appreciate them.

00:00:20.100 --> 00:00:28.940
And if you want to attend live, get your comments in the episode, then check out pythonbytes.fm/live.

00:00:28.940 --> 00:00:33.480
Usually Tuesday at 10 a.m. Pacific time, like we're recording right now, Brian.

00:00:33.480 --> 00:00:33.920
Yeah.

00:00:33.920 --> 00:00:40.380
And please visit Python Bytes, Ed FM, right on the homepage, click on newsletter, subscribe to our newsletter.

00:00:40.380 --> 00:00:43.080
We've got lots of interesting information that we share with you.

00:00:43.080 --> 00:00:47.100
And we're going to be doing some kind of giveaway that we have yet to determine.

00:00:47.100 --> 00:00:51.220
And soon when we reach maybe a major milestone there.

00:00:51.220 --> 00:00:52.360
So that'll be awesome.

00:00:52.360 --> 00:00:52.840
Yeah.

00:00:52.840 --> 00:00:56.420
And yeah, with that, Brian, you want to kick us off?

00:00:56.420 --> 00:00:57.000
Sure.

00:00:57.000 --> 00:00:57.460
What do you got for us?

00:00:57.460 --> 00:00:59.340
Let's talk about strings for a minute.

00:00:59.340 --> 00:01:04.980
So this one is from an article written by Veronica Olson.

00:01:04.980 --> 00:01:10.100
And it's an article called Joining Strings in Python Aha Moment.

00:01:10.520 --> 00:01:15.800
And I actually just really enjoyed this story because it's a it tricked me up.

00:01:15.800 --> 00:01:20.240
And she says, I've been writing Python code for 17 years.

00:01:20.240 --> 00:01:25.660
And then I learned something new recently from a master on conversation.

00:01:25.660 --> 00:01:27.480
So what is the new thing?

00:01:27.480 --> 00:01:30.800
So the idea is around joining strings.

00:01:31.040 --> 00:01:36.100
So let's say you're like, and we do this, I do this all the time.

00:01:36.100 --> 00:01:38.140
So you've got some input from a file.

00:01:38.140 --> 00:01:41.720
And her example is, you've got some input from a file.

00:01:41.720 --> 00:01:46.460
And you're going through and just using it, using the regenerator thing.

00:01:46.460 --> 00:01:47.440
So f equals open.

00:01:47.440 --> 00:01:49.420
And you get like this thing that you can read with.

00:01:49.660 --> 00:01:54.180
So she's using x for x, or I usually put line.

00:01:54.180 --> 00:01:55.760
Line for line in f.

00:01:55.760 --> 00:02:01.200
And then also doing like some logic on it within a generator, which is kind of cool.

00:02:01.980 --> 00:02:04.280
And once I learned this, I use it all the time.

00:02:04.280 --> 00:02:11.380
So go through using the file as a generator to pull out lines and then only collect the lines that you care about.

00:02:11.380 --> 00:02:13.760
And then joining it in at the end.

00:02:13.760 --> 00:02:21.060
And so like this discussion really is when you've got a whole bunch of strings that you want to concatenate together with like new lines or something.

00:02:21.060 --> 00:02:25.160
You just create a list of them and then join it.

00:02:25.160 --> 00:02:30.580
But if you're using a generator, you can use a generator and pass that to join also.

00:02:30.580 --> 00:02:36.420
So the little trick here is whether or not you should use a list comprehension.

00:02:36.420 --> 00:02:45.480
So these two methods is you're joining a generator out of the file or you use a list comprehension within it.

00:02:45.480 --> 00:02:53.100
And the only difference is these little brackets in there to create a generator or to create a list comprehension.

00:02:53.100 --> 00:02:59.380
So I would think my first reaction is that it really probably doesn't matter.

00:02:59.760 --> 00:03:05.000
But the list comprehension might be maybe I have no idea which one's slower or faster.

00:03:05.000 --> 00:03:11.940
But the odd thing is, if it's a huge text file, Brian, if it's a huge text file, it could be a memory.

00:03:11.940 --> 00:03:14.600
If you had a gig of text, right?

00:03:14.600 --> 00:03:14.920
Yeah.

00:03:14.920 --> 00:03:20.920
Then you potentially would be loading more than that in memory with the brackets, but not with the parentheses, right?

00:03:20.920 --> 00:03:22.320
That's what I thought.

00:03:22.320 --> 00:03:22.740
Right.

00:03:22.740 --> 00:03:29.520
So she used a sample file like the King James version of the Bible or something.

00:03:30.060 --> 00:03:30.740
Yeah.

00:03:30.740 --> 00:03:30.860
Yeah.

00:03:30.860 --> 00:03:30.940
Yeah.

00:03:30.940 --> 00:03:38.080
Which is 800,000 words long and a ballpark of 3,000 pages.

00:03:38.080 --> 00:03:41.440
Anyway, 200 million words.

00:03:41.440 --> 00:03:41.780
Okay.

00:03:42.800 --> 00:03:50.560
So did a little timing here as to whether or not you want to use a generator or a list comprehension for this.

00:03:50.560 --> 00:03:56.020
And looking at the memory output so that the memory itself is as expected.

00:03:56.020 --> 00:03:57.740
The generator uses less memory.

00:03:57.740 --> 00:04:01.240
The list comprehension gradually grows and you're using more memory.

00:04:01.780 --> 00:04:02.340
Okay.

00:04:02.340 --> 00:04:06.740
So far, it seems like it's doing what we think it might be doing.

00:04:06.740 --> 00:04:16.660
But the weird bit is when we go down and actually time this stuff is that the generator version without it.

00:04:16.660 --> 00:04:24.540
And if you compare the times for the generator and the list comprehension, the generator one is slower by like 16%.

00:04:24.540 --> 00:04:25.120
Weird.

00:04:25.120 --> 00:04:25.720
Why?

00:04:25.720 --> 00:04:27.340
That is weird.

00:04:27.340 --> 00:04:36.520
Especially since the list has to like, you allocate the list, you fill the list, you reallocate the list, you copied over, like growing the list over and over and over.

00:04:36.520 --> 00:04:39.400
Although as a list comprehension, maybe it doesn't.

00:04:39.400 --> 00:04:40.260
I don't know.

00:04:40.260 --> 00:04:41.840
Anyway, that's crazy.

00:04:41.840 --> 00:04:54.900
And then adding more mystery to the mystery is that instead of join, if you use all as the thing that you're using across the entire list or generator,

00:04:55.400 --> 00:05:00.420
it's behaving as expected, the generator is faster than the comprehension.

00:05:00.420 --> 00:05:01.700
So what's going on?

00:05:01.700 --> 00:05:08.360
So the discussion went online and Trey Hunter said, you should know something about join.

00:05:08.360 --> 00:05:20.060
Join is weird in that the CPython implementation of join is a two-pass because generators can, you can't, they get exhausted and you can't use them again.

00:05:20.380 --> 00:05:25.480
So it has some little tricks that it uses to do a two-pass over the generator.

00:05:25.480 --> 00:05:29.460
And so therefore it is, it is the same.

00:05:29.460 --> 00:05:33.740
The join is the same as take creating a list.

00:05:33.740 --> 00:05:38.180
And we know that comprehensions are a little bit better than actually just creating a list.

00:05:38.180 --> 00:05:44.600
So that little bit better is the reason why the comprehension version is faster.

00:05:44.600 --> 00:05:46.660
Well, wait, I have no idea why.

00:05:46.660 --> 00:05:48.700
I should have read more closely.

00:05:48.700 --> 00:05:55.920
But there's something about this that makes it faster in when you're using joins to go ahead and use a comprehension faster.

00:05:55.920 --> 00:05:57.240
Interesting.

00:05:57.700 --> 00:06:00.620
And it's only in CPython.

00:06:00.620 --> 00:06:09.440
Apparently that's not true for PyPy and, yeah, apparently you can, I don't know how they're doing it without it.

00:06:09.440 --> 00:06:14.740
But PyPy and some others implementations of Python do not use this.

00:06:14.740 --> 00:06:15.780
But anyway.

00:06:15.780 --> 00:06:16.040
Interesting.

00:06:16.040 --> 00:06:21.940
Yeah, I don't see it tested here, but the WebAssembly one would be quite interesting.

00:06:22.360 --> 00:06:22.600
Yeah.

00:06:22.600 --> 00:06:26.400
For PyDyde and PyScript and those kinds of things.

00:06:26.400 --> 00:06:26.860
Definitely.

00:06:26.860 --> 00:06:28.860
Okay.

00:06:28.860 --> 00:06:35.900
So interesting inside baseball around, I guess, around if you want to do memory, whether you care about speed or memory efficiency.

00:06:35.900 --> 00:06:37.720
And also.

00:06:37.720 --> 00:06:39.320
It's weird that you got to choose though.

00:06:39.320 --> 00:06:41.480
It is weird that you have to choose.

00:06:41.480 --> 00:06:50.800
But also just in case you haven't seen this, this is basically the standard format for if you want to iterate through strings and combine them all into one.

00:06:50.800 --> 00:06:58.180
Is to either throw them in a list or throw them in a comprehension or throw them in a generator and use join to combine them with a new line.

00:06:58.180 --> 00:07:01.120
If you haven't seen that before, that's a good thing to stick in your tool belt.

00:07:01.120 --> 00:07:01.600
Yeah.

00:07:01.600 --> 00:07:06.300
And our Windows friends can put backslash or backslash in join for their Windows line.

00:07:06.300 --> 00:07:06.620
Didn't he?

00:07:06.620 --> 00:07:07.740
I'm on Windows.

00:07:07.740 --> 00:07:08.560
I don't do that.

00:07:08.560 --> 00:07:09.240
But okay.

00:07:09.240 --> 00:07:09.740
I know.

00:07:09.740 --> 00:07:11.460
It should still work.

00:07:11.460 --> 00:07:13.340
All right.

00:07:13.340 --> 00:07:14.060
Awesome.

00:07:14.060 --> 00:07:15.340
Well, what do you have for us next?

00:07:15.340 --> 00:07:18.200
Well, I'm afraid I have some hard truths for you, Brian.

00:07:18.300 --> 00:07:23.380
Just like you've learned, it's a hard truth that generator doesn't always give you the advantages you thought.

00:07:23.380 --> 00:07:30.900
These are hard truth, 10 hard truths to swallow that people won't tell you about your brand new software engineering job.

00:07:30.900 --> 00:07:35.760
So this is focused at students who just recently graduated or who are getting into software development.

00:07:35.760 --> 00:07:48.160
And that might sound like a somewhat niche crowd, but if you look at the PSF JetBrains survey, it's like the biggest group of people are like, well, you've been coding for three years or less, which is crazy.

00:07:48.160 --> 00:07:48.680
All right.

00:07:48.680 --> 00:07:50.200
Anyway, let's go through the 10.

00:07:50.200 --> 00:07:52.160
This is by Mansour Durevich.

00:07:52.160 --> 00:07:53.960
Pretty good.

00:07:53.960 --> 00:07:55.200
A pretty good article here.

00:07:55.400 --> 00:08:01.120
And basically says, I was talking with a bunch of students and they were all psyched about like startup culture, pizza parties and stuff.

00:08:01.120 --> 00:08:05.700
Well, yes, but the thing you're going to do most of the time, write code.

00:08:05.700 --> 00:08:07.760
So here are the 10.

00:08:07.760 --> 00:08:10.080
First, college will not prepare you for the job.

00:08:10.080 --> 00:08:14.680
So imagine your instructor spends, you go to college to learn how to swim.

00:08:14.800 --> 00:08:21.940
Your instructor spends a lot of time teaching you about the moves, reciting the moves, asking you questions about the moves.

00:08:21.940 --> 00:08:25.140
After five years, you get a piece of paper that proves your swimming skills.

00:08:25.140 --> 00:08:27.900
And then you got to go in the pool and you just flail around, right?

00:08:27.900 --> 00:08:29.040
A little bit like that.

00:08:29.040 --> 00:08:33.120
Also, a lot of the curriculums are pretty far behind.

00:08:33.120 --> 00:08:37.160
I remember when I was in college, I said, can I please take C++?

00:08:37.160 --> 00:08:38.120
It's in the 90s.

00:08:38.120 --> 00:08:40.760
They're like, no, you have to take Fortran.

00:08:40.760 --> 00:08:42.460
It's the most important language you'll ever learn.

00:08:42.520 --> 00:08:45.500
I'm like, okay, and then I'm like, well, let me try some CS classes.

00:08:45.500 --> 00:08:46.740
Like, well, you got to do Lisp.

00:08:46.740 --> 00:08:47.420
Like, really?

00:08:47.420 --> 00:08:50.620
Can I please take something like more modern?

00:08:50.620 --> 00:08:51.140
Like, no.

00:08:51.140 --> 00:08:53.320
So you should have embraced the Lisp.

00:08:53.320 --> 00:08:55.880
Yeah, I'm still not embracing the Lisp.

00:08:55.880 --> 00:08:58.400
I like parentheses, but not that much.

00:08:58.400 --> 00:08:58.860
Okay.

00:08:58.860 --> 00:09:05.980
Anyway, so a lot of these folks who are professors have not been professional software developers in the engineering sense.

00:09:05.980 --> 00:09:11.460
And so the skills that they teach you are valuable, but it's not the same as like working day to day.

00:09:11.840 --> 00:09:18.300
This one, I think, is probably, people probably don't realize that much, is you rarely get to work on greenfield projects.

00:09:18.300 --> 00:09:18.820
Yeah.

00:09:18.820 --> 00:09:20.380
You get brownfield projects.

00:09:20.380 --> 00:09:26.880
That is, you get some project that is not a three-week project, but it's something that's been around since 2003.

00:09:27.400 --> 00:09:29.580
And you're dropped in to work on some features.

00:09:29.580 --> 00:09:33.440
And every time you poke it, it's like a rickety house of cards.

00:09:33.440 --> 00:09:34.540
You got to be super careful.

00:09:34.540 --> 00:09:35.180
Right?

00:09:35.180 --> 00:09:37.720
How does that fit with your understanding?

00:09:37.720 --> 00:09:38.600
Yeah, definitely true.

00:09:38.720 --> 00:09:49.720
That's one of the reasons why I encourage people to contribute to open source projects, even in large ones, because you have to get used to huge code bases.

00:09:49.720 --> 00:09:54.900
You have to get used to getting thrown in the deep end and fix a bug, and you don't even know what the code does.

00:09:54.900 --> 00:09:57.360
Yeah, this is essential.

00:09:57.720 --> 00:09:59.860
Speaking of which, there's a fantastic picture for this.

00:09:59.860 --> 00:10:03.240
So let me try to zoom that out for a second so we can see here, Brian.

00:10:03.240 --> 00:10:05.720
So check this link out, folks.

00:10:05.720 --> 00:10:08.820
So there's, it's like this crazy Rube Goldbergian thing.

00:10:08.820 --> 00:10:12.460
There's a button to start the app, and it's got all these weird wires.

00:10:12.460 --> 00:10:18.240
And there's like an elephant that's suspended, and the wire cuts the elephant loose, which drops off a rock.

00:10:18.240 --> 00:10:19.680
And there's a security layer.

00:10:19.680 --> 00:10:22.940
There's the core logic since 2003.

00:10:22.940 --> 00:10:28.200
There's all these, like, third-party bits that are largely controlled by aliens.

00:10:28.200 --> 00:10:29.740
And then there's a cloud.

00:10:29.740 --> 00:10:32.100
And below the cloud, you can see just the base of the building.

00:10:32.100 --> 00:10:37.120
There's two new engineers with a little button that's supposed to, like, kick this thing off or something.

00:10:37.120 --> 00:10:38.140
It says, how hard can it be?

00:10:38.140 --> 00:10:38.560
Come on.

00:10:38.560 --> 00:10:39.040
Yeah.

00:10:39.040 --> 00:10:41.220
Yeah, amazing.

00:10:41.220 --> 00:10:42.200
So check that out.

00:10:42.440 --> 00:10:42.700
All right.

00:10:42.700 --> 00:10:44.640
Coming back.

00:10:44.640 --> 00:10:47.900
Nobody gives a blankety-blank about your clean code.

00:10:47.900 --> 00:10:51.940
You may focus on it a lot, but really, your job is to deliver features.

00:10:51.940 --> 00:10:58.980
You're expected to write clean code, but you're not going to get, like, promotions and stuff from the business people because you write clean code.

00:10:58.980 --> 00:11:00.660
It's because you deliver value, right?

00:11:00.660 --> 00:11:02.640
Part of that value is clean code.

00:11:02.640 --> 00:11:04.680
That's true, but you've got to maintain it, too.

00:11:04.680 --> 00:11:05.600
So you should be happy with it.

00:11:05.600 --> 00:11:06.980
Yes, you've got to live with it.

00:11:06.980 --> 00:11:09.060
So here's my experience.

00:11:09.060 --> 00:11:12.360
Not how do you lie, but how do you phrase things?

00:11:12.420 --> 00:11:18.260
Like, estimates and stuff so that you're in a position so you don't have to write terrible code constantly.

00:11:18.260 --> 00:11:18.920
Right?

00:11:19.040 --> 00:11:25.020
So, for example, with testing or a little bit of refactoring, it's just like I would just work that into my estimates.

00:11:25.020 --> 00:11:25.840
How long is it going to take?

00:11:25.840 --> 00:11:26.520
It's going to take a week.

00:11:26.520 --> 00:11:30.440
Well, it probably takes three and a half days, but then if you were to bust it out, right?

00:11:30.440 --> 00:11:33.540
But if you're going to put in the test and do it right, it'll take a week.

00:11:33.620 --> 00:11:34.620
So how long does it take?

00:11:34.620 --> 00:11:35.160
It takes a week.

00:11:35.160 --> 00:11:36.420
You know, that kind of thing.

00:11:36.420 --> 00:11:38.440
Sometimes you'll work with incompetent people.

00:11:38.440 --> 00:11:39.980
Oh, boy, oh, boy, oh, boy.

00:11:40.780 --> 00:11:41.080
Yes.

00:11:41.080 --> 00:11:43.060
And sometimes that person will be your boss.

00:11:43.060 --> 00:11:44.020
And so.

00:11:44.020 --> 00:11:45.520
That's even tougher.

00:11:45.520 --> 00:11:47.060
I'll tell you a story, Brian.

00:11:47.060 --> 00:11:49.400
You know, I used to do in-person training classes.

00:11:49.400 --> 00:11:58.440
And there was a person who was in this class as part of a team, software development team from a medium-sized company.

00:11:58.440 --> 00:12:01.900
One of these, like, you know, 50 million yearly revenue type companies or something.

00:12:02.620 --> 00:12:05.740
And during that class, we were doing, like, exercises.

00:12:05.740 --> 00:12:07.480
I'd do a presentation for an hour.

00:12:07.480 --> 00:12:09.240
They'd spend maybe half an hour working on something.

00:12:09.240 --> 00:12:10.520
And round and round, it goes.

00:12:10.520 --> 00:12:15.300
So there's this part where you need a variable that has a string value.

00:12:15.300 --> 00:12:21.560
This person has been working for at least six months, I think a lot longer, as a professional software developer in this language.

00:12:21.560 --> 00:12:23.980
And I say, okay, you've got to create a variable there.

00:12:23.980 --> 00:12:28.360
And you need to assign a string to it that says, you know, XYZ.

00:12:28.360 --> 00:12:30.340
The value of the string is XYZ.

00:12:30.660 --> 00:12:34.980
So they just write variable name equals XYZ with spaces and all sorts of stuff.

00:12:34.980 --> 00:12:37.640
Like, no, you can't just type it into the editor.

00:12:37.640 --> 00:12:38.900
You have to put quotes around it.

00:12:38.900 --> 00:12:39.600
What do you mean?

00:12:39.600 --> 00:12:41.560
You have to put quotes around this.

00:12:41.560 --> 00:12:51.400
Like, how have you been a professional software developer at a proper company for over six months to a year and not know that sentences with spaces?

00:12:51.400 --> 00:12:55.000
They have quotes around them to put them into code as a piece of text.

00:12:55.000 --> 00:12:58.920
Like, could you imagine that person just like reviewing your code?

00:12:58.920 --> 00:13:00.340
Like, oh my goodness, dude.

00:13:00.340 --> 00:13:01.020
Yeah.

00:13:01.020 --> 00:13:01.760
No.

00:13:01.760 --> 00:13:04.300
That was a rough one.

00:13:04.300 --> 00:13:08.760
Anyway, sometimes, maybe not to that extreme, but you will probably end up working with ineffective people.

00:13:08.760 --> 00:13:10.360
Or people that don't care about your process.

00:13:10.360 --> 00:13:12.800
Or people that don't care about your clean code or whatever, right?

00:13:12.800 --> 00:13:13.960
All that stuff's there.

00:13:13.960 --> 00:13:17.300
Get used to being, number five, get used to being in meetings for hours.

00:13:17.300 --> 00:13:20.300
This is an important part of software development job.

00:13:20.660 --> 00:13:27.980
Most meetings are not productive because you're being forced to be there by a person whose only job is to have meetings.

00:13:27.980 --> 00:13:29.160
That's their job.

00:13:29.160 --> 00:13:29.920
That's their work.

00:13:29.920 --> 00:13:30.620
Right?

00:13:30.620 --> 00:13:31.620
Which is, ugh.

00:13:31.920 --> 00:13:37.300
However, other meetings with your team members and stuff, planning out code and whatnot is pretty good.

00:13:37.300 --> 00:13:37.480
Yeah.

00:13:37.480 --> 00:13:41.000
If you're the one responsible for the meeting, be okay with cutting it short.

00:13:41.000 --> 00:13:44.480
Getting everybody together and leaving in 10 minutes is fine.

00:13:44.480 --> 00:13:45.280
Remember that.

00:13:45.480 --> 00:13:45.680
Yep.

00:13:45.680 --> 00:13:46.100
Okay.

00:13:46.100 --> 00:13:47.000
A hundred percent.

00:13:47.000 --> 00:13:47.300
Okay.

00:13:47.300 --> 00:13:48.380
On.

00:13:48.380 --> 00:13:50.360
I feel like you should have done this article.

00:13:50.360 --> 00:13:52.380
No, I'll be the heckler in the background.

00:13:52.380 --> 00:13:52.820
It's fine.

00:13:52.820 --> 00:13:53.160
It's good.

00:13:53.160 --> 00:13:55.580
They will ask you for estimates a lot of times.

00:13:55.580 --> 00:13:57.080
I told you about this one.

00:13:57.080 --> 00:13:57.980
I mentioned this.

00:13:57.980 --> 00:13:58.340
This is fun.

00:13:58.340 --> 00:14:01.740
So here's a great cartoon for this one, too.

00:14:01.740 --> 00:14:04.060
This is also a good, like, basically the joke segment.

00:14:04.060 --> 00:14:05.920
It says, would you rather?

00:14:05.920 --> 00:14:12.340
For better estimates, we switched from measuring story points to a different style.

00:14:12.740 --> 00:14:18.520
We now ask, how many duck-sized horses are you willing to fight rather than implement this task?

00:14:18.520 --> 00:14:20.800
Isn't that awesome?

00:14:20.800 --> 00:14:21.600
Yeah.

00:14:21.600 --> 00:14:23.360
Yeah.

00:14:23.360 --> 00:14:27.880
And it sounds silly, but I kind of think of it as it's actually kind of practical.

00:14:27.880 --> 00:14:28.420
Yeah.

00:14:28.420 --> 00:14:35.080
It's using your, like, your desire to avoid negative stimuli more than your ability to predict something.

00:14:35.080 --> 00:14:36.140
I love it.

00:14:36.140 --> 00:14:40.900
That one is only a two duck-sized horse battle.

00:14:40.900 --> 00:14:41.540
All right.

00:14:41.660 --> 00:14:44.620
Bugs will be your arch enemy for life because they come from different places.

00:14:44.620 --> 00:14:47.100
Could be your own code, but it could be third-party libraries.

00:14:47.100 --> 00:14:50.740
It could be hardware failure, electricity, all sorts of things.

00:14:50.740 --> 00:14:53.200
Uncertainty will be your toxic friend.

00:14:53.200 --> 00:14:56.580
So it could be implementing something you never worked on.

00:14:56.580 --> 00:15:00.100
It could be getting transferred to a new project with new technologies.

00:15:00.100 --> 00:15:01.900
It could be a move to a new company.

00:15:01.900 --> 00:15:05.060
It could be a bug report the day you need to finish the work.

00:15:05.060 --> 00:15:06.240
You're going to break the deadline.

00:15:06.240 --> 00:15:10.340
Job security, evolution technology, all these things totally resonate.

00:15:10.580 --> 00:15:14.480
Number nine, it will be almost impossible to disconnect from your job.

00:15:14.480 --> 00:15:16.300
So, yeah, that's rough.

00:15:16.300 --> 00:15:19.360
But it's true because you're thinking about it, right?

00:15:19.360 --> 00:15:19.860
Yeah.

00:15:19.860 --> 00:15:26.140
However, a lot of these come with actually good advice on what to do to combat it or to counteract it or to deal with it.

00:15:26.140 --> 00:15:26.680
Oh, that's good.

00:15:26.680 --> 00:15:33.860
Because one of the best things I ever did was not – I don't have the ability to get email on my phone now, my work email.

00:15:33.860 --> 00:15:34.800
Oh, that's nice.

00:15:34.920 --> 00:15:39.960
Because I was checking it all the time, even when I was off work, and that was bad.

00:15:40.640 --> 00:15:41.620
Yeah, that's bad.

00:15:41.620 --> 00:15:48.320
Last one, number 10, you will profit more from your soft skills than your coding skills.

00:15:48.320 --> 00:15:50.800
Not that your coding skills are important, but –

00:15:50.800 --> 00:15:51.740
Yeah, definitely.

00:15:51.740 --> 00:15:54.700
Soft skills are tough, and they're also required.

00:15:54.940 --> 00:16:04.260
So, things like teamwork, learning mindset, time management, emotional intelligence and empathy, approachability, persistence, confidence, all these things amongst a whole zillion others.

00:16:04.260 --> 00:16:07.220
Anyway, if you're new, I think this is a pretty good article.

00:16:07.220 --> 00:16:09.880
I didn't go through all the little details, but –

00:16:09.880 --> 00:16:10.260
Yeah.

00:16:10.360 --> 00:16:11.360
I don't know.

00:16:11.360 --> 00:16:12.140
I don't know.

00:16:12.140 --> 00:16:12.600
What do you think, Brian?

00:16:12.600 --> 00:16:17.980
I think the soft skills probably ought to have been at the top.

00:16:17.980 --> 00:16:24.840
Being able to communicate well and stay positive and don't be a jerk is huge.

00:16:24.840 --> 00:16:29.820
The ability to not be a jerk under pressure, that was a struggle for me.

00:16:29.820 --> 00:16:31.760
Also, embracing deadlines.

00:16:31.760 --> 00:16:34.640
People are going to ask you how long it's going to take.

00:16:34.640 --> 00:16:37.140
You just have to learn how to do that.

00:16:37.140 --> 00:16:38.600
Estimating is part of the job.

00:16:38.600 --> 00:16:39.420
It sucks.

00:16:39.660 --> 00:16:44.900
It's wrong, but you get better at it, and you're also okay about telling it.

00:16:44.900 --> 00:16:46.400
I mean, it can be ballparks.

00:16:46.400 --> 00:16:49.460
It's going to be – is it going to be two days, or is it going to be two months?

00:16:49.460 --> 00:16:50.440
Pick.

00:16:50.440 --> 00:16:52.260
People just need to know.

00:16:52.260 --> 00:16:53.040
So, yeah.

00:16:53.040 --> 00:16:54.120
Yeah, absolutely.

00:16:54.120 --> 00:16:54.560
It's good.

00:16:54.560 --> 00:16:55.300
All right.

00:16:55.300 --> 00:16:59.520
Before we move on to the next one, let's talk about a sponsor that I'm very excited about.

00:16:59.520 --> 00:17:03.120
Let me tell you real quick about Gout APM.

00:17:03.120 --> 00:17:06.800
They're big supporters of Python Bytes, so we appreciate that very much.

00:17:07.140 --> 00:17:15.880
So, if you are tired of spending hours trying to find the root cause of issues impacting your performance, then you owe it to yourself to check out Scout APM.

00:17:15.880 --> 00:17:25.060
They're a leading Python application performance monitoring tool, APM, that helps you identify and solve performance abnormalities faster and easier.

00:17:25.060 --> 00:17:35.940
Scout APM ties bottlenecks such as memory leaks, slow database queries, background jobs, and the dreaded N plus one queries that you can end up if you do lazy loading in your ORM.

00:17:36.120 --> 00:17:38.320
And then you say, oh, no, why is it so slow?

00:17:38.320 --> 00:17:40.660
Why are you doing 200 database queries for what should be one?

00:17:40.660 --> 00:17:42.080
So, you can find out things like that.

00:17:42.080 --> 00:17:49.480
And it links it back directly to source code so you can spend less time in the debugger and healing logs and just finding the problems and moving on.

00:17:49.480 --> 00:17:52.460
And you'll love it because it's built for developers by developers.

00:17:52.460 --> 00:17:54.100
It makes it easy to get set up.

00:17:54.100 --> 00:17:56.640
Seriously, you can do it in less than four minutes.

00:17:56.640 --> 00:17:57.460
So, that's awesome.

00:17:57.460 --> 00:18:00.540
And the best part is the pricing is straightforward.

00:18:00.540 --> 00:18:06.020
You only pay for the data that you use with no hidden overage fees or per seat pricing.

00:18:06.020 --> 00:18:08.440
And I just learned this, Brian.

00:18:08.440 --> 00:18:13.580
They also have, they provide the pro version for free to all open source projects.

00:18:13.580 --> 00:18:21.000
So, if you're an open source maintainer and you want to have Scout APM for that project, just shoot them a message or something on their pricing page about that.

00:18:21.000 --> 00:18:24.880
So, you can start your free trial and get instant insights today.

00:18:25.080 --> 00:18:27.520
Visit pythonbytes.fm/scout.

00:18:27.520 --> 00:18:29.800
The link is in your podcast player show notes as well.

00:18:29.800 --> 00:18:31.220
And please use that link.

00:18:31.220 --> 00:18:35.180
Don't just search for them because otherwise they don't think you came from us.

00:18:35.180 --> 00:18:36.780
And then they'd stop supporting the show.

00:18:36.780 --> 00:18:39.340
So, please use our link pythonbytes.fm/scout.

00:18:39.340 --> 00:18:40.260
Check them out.

00:18:40.260 --> 00:18:42.200
It really supports the show.

00:18:42.200 --> 00:18:42.680
Cool.

00:18:42.680 --> 00:18:43.180
Yes.

00:18:43.180 --> 00:18:44.020
Thank you indeed.

00:18:44.020 --> 00:18:44.580
Over to you, Brian.

00:18:44.580 --> 00:18:51.000
Well, we've talked in the past about Python coming to Excel, but I haven't tried it.

00:18:51.000 --> 00:18:57.580
So, I was kind of curious about this person that wrote up an article called My Thoughts on Python in Excel.

00:18:57.580 --> 00:19:00.960
And this isn't just a rando person.

00:19:00.960 --> 00:19:05.720
Apparently, this is, let's see, or maybe, I don't know.

00:19:06.180 --> 00:19:10.720
They wrote a book on Python in Excel or reported, yeah.

00:19:10.720 --> 00:19:12.480
Or the creator of Excel Wings, maybe?

00:19:12.480 --> 00:19:13.140
Yeah.

00:19:13.140 --> 00:19:13.320
I'm not sure.

00:19:13.320 --> 00:19:14.140
Oh, yeah.

00:19:14.140 --> 00:19:20.220
As a creator of Excel Wings, the author of the O'Reilly book, Python for Excel, I was obviously curious to try it.

00:19:20.560 --> 00:19:23.060
So, anyway, yeah, okay.

00:19:23.060 --> 00:19:25.320
Anyway, so somebody tried it out.

00:19:25.320 --> 00:19:26.160
Great.

00:19:26.160 --> 00:19:29.160
And this is from the Excel Wings blog.

00:19:29.160 --> 00:19:35.580
So, yeah, it's probably somebody that's worthwhile looking at this and tried, actually really wanted it to work.

00:19:35.580 --> 00:19:38.300
So, what are their takeaways?

00:19:38.300 --> 00:19:40.080
And I'm just kind of loving this.

00:19:40.080 --> 00:19:42.320
We'll just run through them.

00:19:42.320 --> 00:19:49.680
We wanted it to be an alternative to VBA, but mostly got an alternative to the Excel formula language.

00:19:49.680 --> 00:19:49.980
Okay.

00:19:49.980 --> 00:19:53.260
So, I thought it was going to be a VBA replacement as well.

00:19:53.260 --> 00:19:54.040
Apparently not.

00:19:54.040 --> 00:19:59.060
The integrating the Jupyter notebook cells inside Excel grid was a mistake.

00:19:59.060 --> 00:20:03.600
So, not sure what they did there, but apparently they didn't like that.

00:20:03.600 --> 00:20:11.140
So, Python in Excel is not suitable for Python beginners nor for interactive data analysis.

00:20:11.620 --> 00:20:13.720
That's kind of, that's a bummer.

00:20:13.720 --> 00:20:16.040
So, there's that one person left.

00:20:16.040 --> 00:20:18.020
Yeah.

00:20:18.020 --> 00:20:20.700
Right now, there are too many restrictions.

00:20:20.700 --> 00:20:22.120
You can't use your own packages.

00:20:22.120 --> 00:20:23.760
You can't connect to the web APIs.

00:20:23.760 --> 00:20:26.600
So, what are the current use cases?

00:20:26.600 --> 00:20:31.140
Probably computationally intensive things like Monte Carlo simulations.

00:20:31.140 --> 00:20:39.500
AI stuff via the included packages like scikit-learn, NLTK, stats model, imbalance-learn.

00:20:40.700 --> 00:20:42.420
That, actually, that makes sense.

00:20:42.420 --> 00:20:50.320
And so, there's a, that's a good use case, I guess, for being able to use AI scikit-learn stuff in Excel.

00:20:50.320 --> 00:20:50.740
Nice.

00:20:50.740 --> 00:20:55.680
Being able to use Matplotlib and Seaborn for visualizations.

00:20:55.680 --> 00:20:57.600
That's pretty cool because these are great packages.

00:20:57.600 --> 00:20:59.220
Time series analysis.

00:21:00.500 --> 00:21:01.700
And, but that's really about it.

00:21:01.700 --> 00:21:08.520
Said, not sure about data cleaning or data analysis since you're mostly certain, almost certainly need power query.

00:21:08.520 --> 00:21:09.540
I don't know what this is.

00:21:09.540 --> 00:21:11.000
Must be an Excel thing.

00:21:11.000 --> 00:21:16.540
It's like a BI Microsoft Office Tableau type of thing, I believe.

00:21:16.540 --> 00:21:17.000
Okay.

00:21:17.000 --> 00:21:20.960
So, what's the conclusion here?

00:21:20.960 --> 00:21:27.720
Before we dive into details, I want to clarify that this is my personal opinion and not meant to be a rant or critique, but I'm amused by it.

00:21:28.000 --> 00:21:32.720
I've been in contact with the Excel team a few times and they're super friendly.

00:21:32.720 --> 00:21:33.060
Okay.

00:21:33.060 --> 00:21:35.320
So, he wants the whole thing to succeed.

00:21:35.320 --> 00:21:36.820
So, we'll just, that's good.

00:21:36.820 --> 00:21:38.920
So, these are just interesting takeaways.

00:21:39.580 --> 00:21:52.460
One of the things, and then goes through a bunch of the little bits, and in more detail, the part that wasn't in the summary, which I find is interesting, is Python is not really in Excel.

00:21:52.460 --> 00:21:55.800
It's in the cloud, which I'm surprised by.

00:21:55.800 --> 00:22:04.600
So, as you've probably heard, but I hadn't, that the Python that you're running runs in an Azure container instance, not inside Excel.

00:22:04.600 --> 00:22:06.400
That's just kind of weird, I think.

00:22:06.400 --> 00:22:07.760
Did you know this?

00:22:07.760 --> 00:22:09.020
Yeah, I did.

00:22:09.120 --> 00:22:12.600
And it's interesting that it means that you can't configure the environment.

00:22:12.600 --> 00:22:14.880
You can't control which Python is running.

00:22:14.880 --> 00:22:22.380
You can't install third-party packages that are not pre-approved, like you saw that there was a list of a couple of ML ones.

00:22:22.380 --> 00:22:24.880
If you don't like those, then you don't use it.

00:22:24.880 --> 00:22:29.420
Well, can you do it when your laptop's disconnected, like when you're on an airplane or something?

00:22:29.420 --> 00:22:30.720
No, I don't think so.

00:22:30.720 --> 00:22:31.280
Okay.

00:22:31.280 --> 00:22:38.880
You know, just like quick, to me, I was hoping for like some kind of VBA, like true automation.

00:22:38.880 --> 00:22:39.280
Yeah.

00:22:39.280 --> 00:22:41.860
Sort of beyond the cell, this cell, that cell.

00:22:41.860 --> 00:22:50.400
But kind of what you do with notebooks, and then sometimes you bring in like Excel writer or something to like actually save the stuff out or something, right?

00:22:50.400 --> 00:22:52.300
Like a little way to orchestrate bigger.

00:22:52.300 --> 00:22:52.840
Okay.

00:22:53.260 --> 00:22:53.800
But yeah.

00:22:53.800 --> 00:22:56.600
So it's just different.

00:22:56.600 --> 00:22:58.880
It's just like stuff within a cell?

00:22:58.880 --> 00:23:00.820
Well, multiple cells, but yes.

00:23:00.820 --> 00:23:01.400
Okay.

00:23:01.940 --> 00:23:04.780
Well, it's not really what I was hoping for, for Python and Excel.

00:23:04.780 --> 00:23:06.040
So anyway.

00:23:06.040 --> 00:23:06.560
Yeah.

00:23:06.560 --> 00:23:07.940
It's also not quite in it, right?

00:23:07.940 --> 00:23:08.680
Say that again?

00:23:08.680 --> 00:23:10.120
It's not quite in it.

00:23:10.120 --> 00:23:11.560
As I said, it's in the cloud.

00:23:11.560 --> 00:23:11.940
Yeah.

00:23:12.780 --> 00:23:14.660
It is weird that it's got to be online only.

00:23:14.660 --> 00:23:15.320
Yeah.

00:23:15.320 --> 00:23:19.980
That's kind of a deal breaker for me, but maybe I shouldn't care that much.

00:23:19.980 --> 00:23:20.940
But anyway.

00:23:20.940 --> 00:23:21.720
Yeah.

00:23:21.720 --> 00:23:32.800
But one of the comments around that was that it's not really a problem for a lot of people because a lot of people that are using Excel are already sharing their data through OneDrive and SharePoint.

00:23:33.260 --> 00:23:43.180
And I don't know if that's, maybe that's a majority of corporations, but there's a lot of corporations like the one I'm in where we cannot do that because we don't want our stuff to go out anywhere.

00:23:43.180 --> 00:23:44.100
So anyway.

00:23:44.100 --> 00:23:44.600
Yep.

00:23:44.600 --> 00:23:55.080
Just an interesting takeaway of, I guess, if you've been hoping and thinking, this might be a good article to peruse just to make sure that it's really your use case before you jump in.

00:23:55.080 --> 00:23:55.840
Yeah.

00:23:55.840 --> 00:23:56.280
Good point.

00:23:56.280 --> 00:24:02.080
Christopher out there says, it's nice that it doesn't require Python to be installed locally, unlike Power BI.

00:24:02.680 --> 00:24:06.860
because I wouldn't be able to have my IT department install it.

00:24:06.860 --> 00:24:08.820
So that's an interesting bonus there.

00:24:08.820 --> 00:24:14.040
And Avaro says, you got to fight for your right to sudo.

00:24:14.040 --> 00:24:16.560
There you go.

00:24:16.560 --> 00:24:20.420
Can't you, I mean, Python now, can't you install it on Windows machines?

00:24:20.420 --> 00:24:24.840
I think you can install it in like personal mode that's just in your home directory or something.

00:24:24.840 --> 00:24:29.480
I don't think you need like administrator privileges anymore.

00:24:29.480 --> 00:24:32.280
Yeah, that's true with the, it's actually true.

00:24:32.300 --> 00:24:35.720
With the Python in the Windows store and Windows 10 and 11.

00:24:35.720 --> 00:24:36.200
Yeah.

00:24:36.200 --> 00:24:36.620
Yeah.

00:24:36.620 --> 00:24:37.280
Okay.

00:24:37.280 --> 00:24:39.200
Henry Schreiner on the audience.

00:24:39.200 --> 00:24:42.180
Henry says, this feels like the perfect use case for WASM.

00:24:42.180 --> 00:24:43.560
Sad it wasn't the default.

00:24:43.560 --> 00:24:44.580
Totally agree.

00:24:44.580 --> 00:24:46.320
Some pyodide here would have been awesome.

00:24:46.320 --> 00:24:46.820
Yeah.

00:24:46.820 --> 00:24:48.180
All right.

00:24:48.180 --> 00:24:48.820
Um.

00:24:48.820 --> 00:24:49.340
Not as awesome.

00:24:49.340 --> 00:24:50.760
The next thing I'm about to tell you though, Brian.

00:24:50.760 --> 00:24:51.360
Okay.

00:24:51.360 --> 00:24:52.800
What's, what's the next thing?

00:24:52.800 --> 00:24:57.520
This, special live event course that I'm running.

00:24:57.520 --> 00:24:58.320
All right.

00:24:58.320 --> 00:24:58.760
Cool.

00:24:58.760 --> 00:25:07.420
So this is happening in, in October and I'm doing a code in a castle event in Tuscany.

00:25:07.420 --> 00:25:08.220
Oh, wow.

00:25:08.640 --> 00:25:17.120
So this is a six day luxurious, core, course in a luxury, luxurious Tuscan

00:25:17.120 --> 00:25:17.780
villa.

00:25:17.780 --> 00:25:23.700
And every morning we're going to wake up and we're going to spend four hours working on Python.

00:25:23.920 --> 00:25:31.300
And then the rest of the day is excursions and winery tours and other stuff around the Italian

00:25:31.300 --> 00:25:31.700
countryside.

00:25:31.700 --> 00:25:32.920
This looks like fun.

00:25:32.920 --> 00:25:33.720
Sounds awesome.

00:25:33.720 --> 00:25:33.900
Huh?

00:25:33.900 --> 00:25:34.140
Yeah.

00:25:34.360 --> 00:25:36.120
So the course is going to be super fun.

00:25:36.120 --> 00:25:40.880
The course is, I called it Python zero to hero, but you don't have to actually be zero.

00:25:40.880 --> 00:25:45.140
Just, you gotta just like, there's probably some areas of this that would be, you haven't

00:25:45.140 --> 00:25:46.520
any, had any experience with.

00:25:46.520 --> 00:25:50.720
So basically it takes you from, I'm maybe learning Python.

00:25:50.720 --> 00:25:57.960
Maybe I know Python, but then talks about async and await MongoDB talks about, we cover

00:25:57.960 --> 00:26:00.280
a FastAPI using HTMX.

00:26:00.280 --> 00:26:05.380
We'll be back to that in just a second and building out awesome web apps and web APIs and

00:26:05.380 --> 00:26:09.660
then performance testing this and then deploying it to Linux.

00:26:09.660 --> 00:26:12.100
If we got time, maybe using Docker as well.

00:26:12.100 --> 00:26:16.460
So yeah, that's, that's what the plan is and it's going to be awesome.

00:26:16.460 --> 00:26:21.700
So if you were interested in being part of this, click the link in your player show

00:26:21.700 --> 00:26:23.980
notes and, so show notes there.

00:26:23.980 --> 00:26:27.100
And yeah, I think I only have a talk Python link.

00:26:27.240 --> 00:26:32.960
So talk Python.fm slash castle is the link and everyone, when they come, they get a

00:26:32.960 --> 00:26:35.760
room in the villa and the room has up to two beds.

00:26:35.760 --> 00:26:41.880
So if you wanted to bring your wife or a good friend, there's actually a separate, set

00:26:41.880 --> 00:26:45.600
of events for the people who are not in the course, but who are attending the event as like

00:26:45.600 --> 00:26:46.600
a companion or something.

00:26:46.600 --> 00:26:49.020
So there's like morning excursions as well.

00:26:49.020 --> 00:26:49.460
Yeah.

00:26:49.460 --> 00:26:53.940
I was reading up on that and it sounds really pretty like some, some good quotes from people

00:26:53.940 --> 00:27:01.360
from last year, enjoying the plus ones, having fun in the mornings.

00:27:01.360 --> 00:27:01.820
So.

00:27:01.820 --> 00:27:02.460
Yeah.

00:27:02.460 --> 00:27:03.020
Awesome.

00:27:03.020 --> 00:27:04.660
Maybe I'll just say the morning track.

00:27:04.660 --> 00:27:05.140
No, I'm just kidding.

00:27:05.140 --> 00:27:07.900
So I forgot to mention this is an extra, extra, extra.

00:27:07.900 --> 00:27:09.880
So this is number one of the extra.

00:27:09.880 --> 00:27:10.180
Okay.

00:27:10.180 --> 00:27:10.480
More.

00:27:10.480 --> 00:27:11.020
Okay.

00:27:11.020 --> 00:27:11.360
More.

00:27:11.460 --> 00:27:17.000
So first one code in a castle, learn Python, FastAPI deployment, load testing, all that

00:27:17.000 --> 00:27:17.240
stuff.

00:27:17.240 --> 00:27:18.060
Hopefully you can be there.

00:27:18.060 --> 00:27:22.380
Number two, I had this awesome use case for HTMX.

00:27:22.380 --> 00:27:27.500
That is so incredibly clean that I just want to give people a feel for it.

00:27:27.500 --> 00:27:33.960
So Brian, if you go to, talk Python, click on the courses, put in your course here.

00:27:33.960 --> 00:27:34.400
Okay.

00:27:34.400 --> 00:27:40.660
you see, it has a price as $59, but if you're European, it would have a price in euros.

00:27:40.860 --> 00:27:44.940
If you were in India, you would have a price and something else.

00:27:44.940 --> 00:27:51.260
So in order to pull that, all that information in, this was usually fast, but periodically

00:27:51.260 --> 00:27:55.340
we'd have to hit our credit card processor for places that are less common.

00:27:55.340 --> 00:27:58.980
I tried to pre-compute all this, but it's like combinatorially out of control.

00:27:58.980 --> 00:28:04.260
So if you're like from a certain part of Greece where there's a certain tax that's different

00:28:04.260 --> 00:28:08.200
than another part of, you know, like all of that factors into what shows up on this page.

00:28:08.200 --> 00:28:10.400
So I just showed them without prices and like, well,

00:28:10.460 --> 00:28:15.260
what if I could reload, like show the page and then recompute the page with prices.

00:28:15.260 --> 00:28:20.780
And if it takes 10 seconds for 50 API calls to the credit card processor, so be it.

00:28:20.780 --> 00:28:22.480
And maybe you'll see it, maybe you won't.

00:28:22.480 --> 00:28:27.680
But if it's already seen that and it's saved to the database, we'll just show it to you basically.

00:28:27.680 --> 00:28:28.180
Wow.

00:28:28.180 --> 00:28:29.000
Really, really quick.

00:28:29.140 --> 00:28:30.080
So watch this.

00:28:30.080 --> 00:28:34.720
If I refresh it, you can see that it kind of flickers for a second and then the prices come back.

00:28:34.720 --> 00:28:35.240
Cool.

00:28:35.300 --> 00:28:37.300
So all of that is in HTMX.

00:28:37.300 --> 00:28:43.140
And if you look at the implementation of it, three lines for that entire client side implementation

00:28:43.140 --> 00:28:48.020
of show the page without prices instantly, start a computation to figure them all out,

00:28:48.020 --> 00:28:50.380
get the answer, and then rebuild the page out of that.

00:28:50.380 --> 00:28:54.760
Just div, hx get, some URL, hx trigger to load, render partial.

00:28:54.760 --> 00:29:00.440
This is the implementation that both shows it on the first load without prices and then refreshes

00:29:00.440 --> 00:29:01.540
it and loads it with prices.

00:29:01.780 --> 00:29:03.800
Those three lines and one of them is a slash div.

00:29:03.800 --> 00:29:04.860
Well, that's pretty cool.

00:29:04.860 --> 00:29:05.760
Is that insane?

00:29:05.760 --> 00:29:06.080
Yeah.

00:29:06.080 --> 00:29:08.840
So, yeah, hx for the win.

00:29:08.840 --> 00:29:09.620
Just want to.

00:29:09.620 --> 00:29:10.200
Nice use.

00:29:10.200 --> 00:29:12.100
Encourage more people to use that.

00:29:12.100 --> 00:29:15.380
It lets you do more Python and less JavaScript, right?

00:29:15.380 --> 00:29:18.080
Because most set implementations on the server, which is where it's all Python.

00:29:18.080 --> 00:29:18.620
Yeah.

00:29:18.620 --> 00:29:22.320
And one of those three lines is just the closing of the div.

00:29:22.320 --> 00:29:24.180
So it's really like two lines of code.

00:29:24.180 --> 00:29:25.220
It's really like two lines.

00:29:25.220 --> 00:29:25.660
It's incredible.

00:29:25.660 --> 00:29:26.180
Yeah.

00:29:26.180 --> 00:29:26.760
All right.

00:29:26.760 --> 00:29:27.620
Another one.

00:29:27.620 --> 00:29:29.720
Something I've been recently using.

00:29:29.840 --> 00:29:32.620
And some people will be like, Michael, where have you been all this time?

00:29:32.620 --> 00:29:33.500
Why have you not done this?

00:29:33.500 --> 00:29:36.520
I'll put this out to you as my test candidate.

00:29:36.520 --> 00:29:43.100
Did you know that if you find yourself sitting down to the terminal, SSH into a server, running

00:29:43.100 --> 00:29:48.480
a command, and then leaving often, even if that has like text output and all sorts of responses,

00:29:48.480 --> 00:29:53.760
colored text output, like rich or whatever, you can just run that on your machine using

00:29:53.760 --> 00:29:56.060
SSH to execute a command remotely.

00:29:56.060 --> 00:29:57.140
Is this news to you?

00:29:57.140 --> 00:29:57.720
No.

00:29:58.180 --> 00:30:00.820
So you can say SSH for people who don't know.

00:30:00.820 --> 00:30:06.040
You can say SSH user at host, and then in quotes, some command.

00:30:06.040 --> 00:30:10.340
So like if you want to say tail your log and see what's happening on your server, instead

00:30:10.340 --> 00:30:15.040
of logging into the server over SSH and tailing it, you could just create an alias that says

00:30:15.040 --> 00:30:19.860
SSH user at host, do the tail log thing, and you just type it locally and just boom,

00:30:19.860 --> 00:30:20.440
you're telling log.

00:30:20.440 --> 00:30:20.940
It's beautiful.

00:30:20.940 --> 00:30:22.020
Or whatever you want to do.

00:30:22.020 --> 00:30:25.340
And if you want to run multiple commands, just separate them by semicolons.

00:30:25.340 --> 00:30:27.460
Get a little alias for that bad boy, and off you go.

00:30:27.460 --> 00:30:27.960
Yeah.

00:30:27.960 --> 00:30:28.400
Nice.

00:30:28.400 --> 00:30:30.360
So anyway, that's one of my extras.

00:30:30.360 --> 00:30:36.700
I use it for, so the reboot is built in, but we have an extra command that we do for restarting

00:30:36.700 --> 00:30:39.020
the, we have an application that we often have to restart.

00:30:39.020 --> 00:30:45.200
So doing a single command to SSH and run the restart to restart all the software.

00:30:45.200 --> 00:30:45.980
Do that a lot.

00:30:45.980 --> 00:30:46.400
So.

00:30:46.400 --> 00:30:46.800
Yep.

00:30:46.800 --> 00:30:47.040
Cool.

00:30:47.240 --> 00:30:47.480
All right.

00:30:47.480 --> 00:30:48.840
I told you it's extra, extra, extra.

00:30:48.840 --> 00:30:49.700
There's still more extras.

00:30:49.700 --> 00:30:49.960
Okay.

00:30:49.960 --> 00:30:50.320
Okay.

00:30:50.320 --> 00:30:50.760
Okay.

00:30:50.760 --> 00:30:52.180
We got time.

00:30:52.180 --> 00:30:52.500
All right.

00:30:52.500 --> 00:30:53.380
Yeah.

00:30:53.380 --> 00:30:54.240
These are short.

00:30:54.240 --> 00:31:00.700
So polyfill.io is a CDN, I believe for a JavaScript.

00:31:00.700 --> 00:31:05.840
Polyfill is if a browser doesn't support a feature, but you can implement it in JavaScript

00:31:05.840 --> 00:31:07.340
on top of the features that are there.

00:31:07.340 --> 00:31:12.140
That's a, because include a script that's a polyfill, like add features to an old one,

00:31:12.140 --> 00:31:13.180
an old browser.

00:31:13.180 --> 00:31:13.660
Okay.

00:31:13.660 --> 00:31:19.300
So apparently, according to Bleeping Computer, this thing has been impacted by a supply chain

00:31:19.300 --> 00:31:25.340
attack where a Chinese company acquired the domain and then the script was modified to

00:31:25.340 --> 00:31:27.840
redirect users to malicious and scam sites.

00:31:27.840 --> 00:31:28.280
No.

00:31:28.280 --> 00:31:33.780
And everyone who had that in their web app, 100,000 different websites, the CDN got a

00:31:33.780 --> 00:31:35.260
new version of the script for you.

00:31:35.260 --> 00:31:36.320
Oh, geez.

00:31:36.320 --> 00:31:43.220
Which means it's time for required reading from Wesley Apticker Castle's reasons to avoid

00:31:43.220 --> 00:31:44.140
CDNs in JavaScript.

00:31:44.140 --> 00:31:46.580
I'll do my highlighted one here.

00:31:46.580 --> 00:31:47.340
Oh, wow.

00:31:47.340 --> 00:31:48.960
Look, systemic risk.

00:31:48.960 --> 00:31:54.000
It says one of the CDNs out there supports 12.5% of all websites.

00:31:54.160 --> 00:31:59.080
If that goes down, having 12.5% of the internet vanish is silly.

00:31:59.080 --> 00:32:03.800
We've swung too far towards away from resiliency as a society.

00:32:03.800 --> 00:32:08.400
Privacy, obviously, because they can track everyone who makes a request for that and coordinate

00:32:08.400 --> 00:32:10.660
that across browsers and sites.

00:32:10.660 --> 00:32:14.500
They see speed, but if you're using ACP2, it doesn't matter that much.

00:32:14.500 --> 00:32:16.760
You could use your own CDN security.

00:32:16.760 --> 00:32:21.500
This points out that modern browsers have sub-resource integrity.

00:32:21.660 --> 00:32:25.980
Basically, you put a hash onto it, and if you're using a CDN, put the hash in there.

00:32:25.980 --> 00:32:28.780
That way, if something like this happens, it won't load the page.

00:32:28.780 --> 00:32:30.640
Like, the browser's like, no, it doesn't match.

00:32:30.640 --> 00:32:32.320
I'm not running this, which is good.

00:32:32.320 --> 00:32:36.760
Unfortunately, this doesn't work for libraries that are split into multiple pieces, you know,

00:32:36.760 --> 00:32:40.260
where one thing requires another type of deal as part of it.

00:32:40.260 --> 00:32:41.540
So what to do instead?

00:32:41.860 --> 00:32:43.900
Just download it, is what they say.

00:32:43.900 --> 00:32:52.680
Although what we do, Brian, over at Python Bytes, is we just download it, but then we serve that content back over our own CDN at bunny.net.

00:32:52.680 --> 00:33:01.400
Well, it's not ours, but the one we use at bunny.net, which still gives it all the global reach, but we control whether or not it changes other people, which is awesome.

00:33:01.800 --> 00:33:10.600
And just to keep beating the drum, major ad networks are basically malware delivering funnels, and don't feel bad about ad blockers.

00:33:10.600 --> 00:33:14.680
Mac users served info stealer malware through Google ads, so why not?

00:33:14.680 --> 00:33:15.560
Who wouldn't want that?

00:33:15.560 --> 00:33:16.360
Oh, geez.

00:33:16.520 --> 00:33:23.700
So that's an article on Ars Technica you can check out, but that's my extra, extra, extra, extra, extra hear all about it.

00:33:23.700 --> 00:33:24.660
Okay, nice.

00:33:24.660 --> 00:33:25.340
You got extras?

00:33:25.340 --> 00:33:29.020
I do, but I've got a link that I can't show.

00:33:29.020 --> 00:33:30.680
That's okay.

00:33:30.680 --> 00:33:37.120
So I want you to go to the, like, either in the notes or the private chat and click on that link, and we'll talk about it.

00:33:37.460 --> 00:33:41.280
It's called, I will effing pile drive you if you mention the AI again.

00:33:41.280 --> 00:33:48.380
So it's just a, it's a funny reaction to all this ChatGPT stuff and AI and everything.

00:33:48.380 --> 00:33:51.480
And it's interesting, it's the interesting position.

00:33:51.480 --> 00:33:53.740
So this is somebody that was studying data science.

00:33:53.740 --> 00:34:01.520
They're in, I think they're in college, and they're doing grad, I think grad school stuff now, doing a master's thesis.

00:34:01.520 --> 00:34:06.340
But he's kind of sick of a lot of the hype around AI.

00:34:06.620 --> 00:34:08.580
So there's, it's just an interesting take on it.

00:34:08.580 --> 00:34:09.960
And it's, it's so funny.

00:34:09.960 --> 00:34:22.320
Like, if you'd like to have an alternate, if you're tired of all the hype around AI, and you'd like to, you know, read some, somebody else's perspective, click the link in the show notes.

00:34:22.320 --> 00:34:25.420
And it'll be an interesting read for you.

00:34:25.420 --> 00:34:32.240
The reason why I'm not showing it is because I want to keep this child friendly and safe for this pod, for the live feed.

00:34:32.240 --> 00:34:33.280
So anyway.

00:34:33.280 --> 00:34:33.960
Thanks, Brian.

00:34:33.960 --> 00:34:35.380
Well, check it out.

00:34:35.620 --> 00:34:37.420
That's my, that's my only extra.

00:34:37.420 --> 00:34:38.640
All right.

00:34:38.640 --> 00:34:42.200
Well, let's close this out with a joke, huh?

00:34:42.200 --> 00:34:42.800
All right.

00:34:42.800 --> 00:34:43.040
Yeah.

00:34:43.040 --> 00:34:43.720
Let's do that.

00:34:43.720 --> 00:34:47.100
By the way, I have this AI fatigue as well.

00:34:47.420 --> 00:34:49.480
It's like, chat TVT is cool.

00:34:49.480 --> 00:34:50.920
Llama 3 is cool.

00:34:50.920 --> 00:34:53.680
But like, not everything needs to have AI in it.

00:34:53.680 --> 00:35:01.800
And certainly a lot of times software use has just like easiest all persistent bugs because the whole team is like on an AI mission.

00:35:01.900 --> 00:35:03.080
You're like, I don't want any of this junk.

00:35:03.080 --> 00:35:06.240
Could you just make it when I click this that it works?

00:35:06.240 --> 00:35:06.800
Yeah.

00:35:06.800 --> 00:35:07.400
You know?

00:35:07.400 --> 00:35:07.880
All right.

00:35:07.880 --> 00:35:08.520
Off to the joke.

00:35:08.520 --> 00:35:13.740
Over on Reddit, we have something called the HTML hacker.

00:35:13.740 --> 00:35:15.580
We just talked about like the malware, right?

00:35:15.800 --> 00:35:19.740
So this is sort of two sides of the picture.

00:35:19.740 --> 00:35:22.140
Both people don't see either side, really.

00:35:22.140 --> 00:35:25.460
So woman, she says, my boyfriend is a programmer.

00:35:25.460 --> 00:35:26.380
He'll hack.

00:35:26.380 --> 00:35:27.300
He says, don't mess with me.

00:35:27.300 --> 00:35:28.380
My boyfriend is a programmer.

00:35:28.380 --> 00:35:30.020
He'll hack your world into oblivion.

00:35:30.200 --> 00:35:34.640
Meanwhile, the boyfriend on his computer, Google, how to declare variables in HTML.

00:35:34.640 --> 00:35:37.200
Yeah.

00:35:37.200 --> 00:35:38.200
Yeah.

00:35:38.200 --> 00:35:42.040
Both things can be true at the same time.

00:35:42.040 --> 00:35:45.380
He also could be a hacker and still don't know how to declare variables in HTML.

00:35:45.380 --> 00:35:46.020
You never know.

00:35:46.020 --> 00:35:47.980
I don't know how to declare variables in HTML.

00:35:47.980 --> 00:35:49.800
Can you declare variables in HTML?

00:35:49.800 --> 00:35:50.780
No.

00:35:50.780 --> 00:35:51.240
No.

00:35:51.240 --> 00:35:51.700
Okay.

00:35:51.700 --> 00:35:55.300
But you can in like modern CSS and, you know.

00:35:55.300 --> 00:35:56.400
Well, okay.

00:35:56.400 --> 00:35:59.820
So one of the things I think is funny about this is because sometimes in the movies,

00:35:59.820 --> 00:36:04.320
you'll see somebody like pouring through lines of code and then you look at it and it's

00:36:04.320 --> 00:36:09.140
just like the view source of some web page or something.

00:36:09.140 --> 00:36:12.240
It's like, that's not like, you're not hacking anything.

00:36:12.240 --> 00:36:16.160
Guys, guys, I found the source to this web page.

00:36:16.160 --> 00:36:17.620
I'm going in.

00:36:17.620 --> 00:36:21.960
Yeah.

00:36:21.960 --> 00:36:22.640
Wow.

00:36:22.640 --> 00:36:24.220
And I've got the JavaScript next.

00:36:24.220 --> 00:36:24.900
Oh my gosh.

00:36:24.900 --> 00:36:28.180
I can't believe they just published this and don't hide it.

00:36:28.180 --> 00:36:29.600
Yeah.

00:36:29.600 --> 00:36:31.260
So anyway, that's funny.

00:36:31.260 --> 00:36:31.520
Yeah.

00:36:31.520 --> 00:36:31.940
Anyway.

00:36:31.940 --> 00:36:33.080
All right.

00:36:33.080 --> 00:36:33.880
That's it.

00:36:33.880 --> 00:36:35.420
Thanks a lot for a great episode.

00:36:35.420 --> 00:36:35.880
Yeah.

00:36:35.880 --> 00:36:36.240
Fun.

00:36:36.240 --> 00:36:36.840
As always.

00:36:36.840 --> 00:36:37.580
Catch you later.