Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to
your earbuds. This is episode 370, recorded February 6th, 2024. I'm Michael Kennedy.
And I'm Brian Okken.
And this episode is brought to you by us. Check out our courses,
the ones over at Talk Python Training. We have 250 hours of them there, including some from Brian,
but Brian also has the complete pytest course, which just got finished up. So check that out
as well. Links in the show notes, of course. And connect with us on Mastodon or all over there,
the show, Brian and me. And now with that, Brian, how are you doing?
I'm doing good. It's funny, the date. One of the things that I've noticed lately,
I've actually had to write a couple of checks recently.
What?
Yeah. The hard part is not the day because my watch tells me what day it is or the day of the month.
And I usually remember the month, but I'm still having trouble with 2024, man.
So here's a problem. It's definitely a problem.
Yeah. Anyway.
When I got to write stuff these days, it's like I break out the claw.
I used to write so good when I was in grad school. It was like beautiful writing. All right.
Not cursive, but just really fine print. And it was excellent to read. Now you'd be like,
did you even go to school? What is wrong with you? Like, ah, no, I can't write. I'm sorry. The claw is not working today.
That's funny. I write all the time. And I was writing, I found some old ID cards from like high school and junior high.
And, and my daughter, I showed him to my daughter and she's like, how is your hand? Like your signatures the same now as it was in like eighth grade.
Incredible.
I don't know. I just nailed it, man. So anyway, or I haven't gotten any better since eighth grade.
Right off the bat. That's awesome.
Yeah.
Well, what topics are connecting with you today?
Well, I, a couple of things. I've been, converting a lot of projects to Python 3.12. So, and I know it's been out for a while since December, I think it's December.
Yeah.
But a little bit before then.
I can't remember.
Yeah. Yeah. Like November or something like that.
Okay. So, but, wanted to do like a summary. So, I've been thinking about like, should I upgrade projects? So some of my projects are still in 3.11, which is fine, but hopefully I'm,
kind of like halfway between 3.11 and 3.12. So there's an article called, and we do this every, every couple of years, I guess, a summary of major changes between Python versions.
It's like reasons, you know, look back as to why you might want to update. And this is kind of a fun, fun walk through. so hopefully you're not still in 3.7 because 3.7 and earlier are all end of life.
Yeah.
You're living in the past if you're on 3.7.
Yeah. But some of those things that, that, some of the things that came in, it's kind of a nice thing looking.
We've had f-strings since 3.6. So definitely use f-strings everywhere. And then, underscores in numeric literals. And you know what? I, it's been around since 3.6, but I've just started using this. I know it's been around for a while, but I'm whenever I need to do a constant or something like that. I'm like, I, oh yeah, we can put underscores in, in there. It's, it's nice.
Yeah. I like that one a lot. Actually, I've been doing that a lot too. It really makes a difference. Like, is it 10,000 or a hundred thousand or is it a million or a hundred thousand?
Yeah. It's really nice. Anyway, a couple and, data classes also been around since 3.7. Anyway, those are ancient history. Now let's, jump ahead. I'm just going to highlight a few of these, the, for people, 3.8. Of course we had, the walrus operator in 3.8.
And, self-documenting f-strings. So this is something that I've been using all the time now. And for some reason I thought it was later, but putting equal sign in a F string variable so that you could, so that it prints out like variable name equals value, super handy when debugging. So that's great. three, nine brought us, brought us a whole bunch of great stuff with typing. So, people were starting to use a lot of typing in Python even before then.
But, but one of the things was if you wanted to type a list or a dict, you had to say from typing import capital dict or something. And in three, nine, you don't have to, you can just do the lowercase three, nine and above. so that's really handy. And I use that a lot with, even when I'm not type checking, but if I want to like tell people what the, what the parameter list looks like. so I've been more using, I do use the typing like a type checkers, pipe high and stuff, or was it? Yeah.
I don't know. I can't remember. It's all built in. Yeah. But the, but mostly I'm doing it not for like correctness or anything, but for readability. So that's one of the things I like it.
And editors. Hey, one other thing that was really notable in that release was they added remove prefix or move suffix.
Yeah. Because, to strings, because there was strip L strip, R strip. It looks like I could put a string in there and it'll take it out. Like if you could say L strip ABC and you have the string ABC, because it would actually remove four letters, not three. Cause it just says if any of these letters appear in the beginning, start taking them away.
Right. And people imagine they were this remove, like this word at the beginning, take it away if it appears. And so this, this is here and I always try to get it's here and I should be using it more.
Actually, it's a, this is another thing that I've just started using more now, even though it's been since three nine is this remove prefix and suffix. So kind of fun to look back and look at all the fun goodies and go, wow, it's been in for a long time. I should totally use that more.
and sometimes people postpone it because they're, they're supporting multiple versions of Python. So this is another reason why this is a great thing to have these kinds of lists around is, is when you start deprecating old versions, you can look back and go, oh yeah, I can use this now since it's been, we're doing only doing three, eight and above.
So we can, or three nine and above, you can use, use some of these things. 310 brought a structural pattern matching. I can't believe it's been that long. but, yeah, the, the, we now have switch cases in, in Python mother, their match case statements, but totally fun.
And then also one of the big things that are typing time savers for me is to be able to use the pipe operator for unions. So, I, I'm not going to go through all of these, but it's a, it's a fun look at, oh,
310 also brought us slots in, in data classes. That that's pretty cool. but, I've had no problems with switching over to 312 in any of my projects. So I think, people should just, jump the gun and, and try it. One of the cool things with this article comes up, I'm going to swing down to the bottom is some of the useful things in converting, from different versions. There's, there's different changes to the typing extensions and stuff, but there's a, a project called pie upgrade that'll allow you to just
automatically upgrade a lot of your source code. And I think that's cool. And I've done that for a couple of projects, but also I just sort of upgrade in, in, I'd leave the code alone often if it's, unless it, unless I go back and it bugs me. some of the things that bug me, do you, do you proactively pie upgrade your projects?
I haven't used pyupgrade. It's looking interesting. Maybe I should.
I've used fluent though. I think it's fluent is what it's called where you can just say,
convert every string format of any variety to an f string. And that to me was like, just f strings,
just give me f strings. There's so much more readable, but other ones, I don't, you know,
if it upgrades say an optional of a thing to thing pipe none, I don't necessarily want that.
Right. There's certain things where I know I could have a different syntax, but I kind of like it the
way it is, you know, so I don't necessarily do that. Okay. Although I do use Ruff format these
days and I think Ruff format kind of does that as well, but not as, not as aggressively.
Yeah. One of the things that article brings up, and I'm curious about this with rough,
I'm pretty sure they do this as well, but it mentions that black, if you're using black to
reformat things, it will, the formatting, at least it, there's some conventions that have changed
or some, some different things about different versions of the language,
but it respects the requires Python setting in your pyproject.toml. So if you have that set,
black will do that. And I'm, yeah, I'll have to look that up. I'm not sure if rough does that.
Anyway, fun article to look back and go, Hey, why, why am I not using these features now? Cause we've,
we've already upgraded. So.
Yeah. Excellent. I think rough does, but I don't know a hundred percent for sure either.
All right. Brian, you want to talk about a Heroku sort of.
Sure.
All right. So Heroku, you know, the web hosting platform as a service, like, Hey,
you just get push and then your Python code runs or whatever other platform you want to run on probably
runs. And you can get these managed databases and you can get the, it'll just run this stuff and
kind of like Docker, but you don't really have to think about it. It was the darling of many
tutorials and other things among, as well as people using it because it had a free tier and
completely reasonably, they said, you know what? Can't just run software for free for everyone.
We're going to stop this, but it's a hassle, right? So people might've had the feeling like, Hey,
I'm had this change forced upon me against my will. I was using the service and then that service
changed and I'm committed to that service, but I don't necessarily like the way it's changed.
Right. And as you know, as everyone knows, I've been on this Docker kick and all the things that
you can get out of it and how awesome once you get some kind of infrastructure set up to,
to run those kinds of things, how easy it is to adopt additional stuff. Right. So I want to tell
people about Doku, Doku.com with two K's D O K K U.com. It is a open source platform as a service
alternative to Heroku. So basically here's what you do. You create $5 server somewhere, maybe 10,
if you want to go crazy, like digital ocean or something like that, you go in there, you run
Doku install, and it just runs on top of Docker. And then once that foundation is created, you can just
go and do all the stuff that you would normally do with Heroku, but here, right? So you install it
with just W get a curl or whatever, set some information, set some domains, and then you create,
go and create your app. Right. And then later, somewhere down the line, you can come over and
you just say, basically Doku get sync, give it your app, give it your, your GitHub repo or your
get repo. And it'll go clone it, create the equivalent of dynamos that they had over on
Heroku and just run it on your machine. Start, you give it, and also it, it integrates with many of the
same constructs that they had at Heroku. So with Heroku, you had, what is it called? A proc file
or something. I can't, I don't, I didn't do Heroku. So I don't really know, but you basically
had this file that's, that was kind of like a Docker file that said, when the app starts,
this is the command to make it run, right? Like a flask run or UVicorn run or whatever,
right? Like you just tell it the stuff to do to start. And so you basically do that and then you
just get push or scale out. Right. So you can say, Hey, I would like to scale up my web app to have two
nodes. Boom, done. Do that on your local machine and off you go. That's cool, right?
Yeah. I'm, I mean, I assume you can use, you'd have to set up like multiple droplets if you're using
like a database and stuff, but no, it just runs a multiple containers in a cluster on there. Right.
So every, everything this does is that basically is orchestrating Docker on some particular piece of
hardware that you set up. Like I would recommend a VM, not a real piece of hardware for most people.
Although the DHH leaving the cloud makes sense if you're going to have something huge, right? But in
general, get like a $10 VM on one of the clouds that is more focused on that, like digital ocean.
And then you just, once you run this, it'll just scale up and create and build all the Docker
containers and put them in networks together and all that kind of stuff.
Wow.
Yeah.
Pretty neat.
Yeah.
Oh, Kim is pointing out maybe that I'm, I say Doku. He's right. I said, that would be Doku.
Maybe.
Okay.
I think, well, DOK.
But it's DOK. Oh yeah. It's two, it's two Ks.
From Docker, right? Probably. Yeah.
Yeah.
I should know this and be having a last name with two Ks in it. Yeah. It would be totally Doku.
Doku. Okay. Because it's a riff on Docker, right?
Yeah.
There's also a ton of plugins you can get for it, which is pretty cool. So if you look at it,
you can see there's, there's stuff that just like copies files, but there's also CouchDB. You can
integrate Let's Encrypt, MariaDB, MongoDB, RabbitMQ, all these different things you want to plug into it.
Also come along, right? Maintenance mode. I don't know what that is, but they all look interesting.
People can check them out as well. So it looks neat. Final thoughts on this is it does.
It's open source and free, which is excellent, but there's also a pro version if you want,
if you want, like this is not required. Yeah. Right. So it gives you a little bit more features.
It also gives you support and it's like $850 once. A month. No, it's just once.
If your, if your company says like, we really want something that we can get support with and
whatever, you know? Yeah. Yeah. It's an option out there. It's cool that there's a way for this
project to be supported. And also if you're in a company and something goes,
wrong, the company's paying for it. It's kind of nice to be able to say somebody, please
help rather than, all right, who knows the most about Docker here? Get over there and get
in that server and make it work. Right. If, if it comes down to it. So anyway, that's what
I, that's what I got for our first item. I think it's for people who are looking for an alternative
to Heroku. Yeah. Well, I was just looking in, I was like, well, what if I want to use it and I want to
throw them a few bucks anyway, but I don't want to give them 850. on GitHub, they do have a sponsor
this project. So you can give them a few bucks if you want. Yeah. Yeah. And what, what about their
GitHub? How many, they have 25,000 stars. So this is not just a, Hey, Hey, guess what I've, I created
this weekend, right? Like this is a project that's been around for a while. It's a 500 yesterday. So
yeah, exactly. It's like, it's mostly built with go, but has a little Python love in there.
Nice. Okay. Looks fun. Yes, indeed. what's your next one?
Well, my next one is sort of a plea to everybody out there. I was looking for topics today and having
a little difficulty. So I think that we should have more people writing more blog posts. but okay.
So I've got some information. So the, one of the great things is, we can follow Jeff triplet
because he's leading the way here. He's right. Trying to do one blog post a day in February.
so let's get more people trying to do it. You can start late. It's only the sixth.
you can start from now, and move on. So, want to highlight Jeff triplet. So awesome.
starting, starting this. so one post today in February and let's, let's go through the ones he's
got so far. so on February 1st, he said he wrote a post called choosing the right Python.
and Django versions for your project. So kind of, I was just thinking that you just, use the
latest all the time, but, interesting, take on it. it is like, he does talk about,
uh, waiting for possibly the third or four fourth patch release of a particular version of Docker.
Maybe. yeah, there's, if you're doing production stuff, that makes sense. So anyway,
um, so that's his first one. Second one was my first Mac. And actually I really enjoyed this.
This is kind of, kind of one of those types of, podcasts or podcasts, blog posts that
just sort of says, you know, what his history with, with Macintosh and, with max. And then also,
uh, talks about some of his favorite software. So, he picks out bartender and Alfred.
I've used bartender. I haven't used Alfred yet. So I'm kind of intrigued by that.
Bartender is so good. It is so good. And I don't use Alfred. I use Raycast, which is incredible.
Raycast. Okay. so I kind of love this sort of thing for just because people like me and other
people are like, Oh, I've never heard of that. So just sort of a list of some, sometimes a list of
things that you use on your, on your, your personal computer or your development computer. It's,
it's helpful to other people. he does link to a post that he wrote last year called default apps
of 2023 or default apps in 2023. And I was, kind of looking through it as both, both stuff on
his computer and also, web apps and things. And I saw cal.com, which is kind of an alternative to,
uh, Calendly. And so I'm like, Hey, I should check that out. So it looks pretty nice. so I kind of
love these sorts of things of like, what software do I use in every day? So that's great.
I see a lot of section with stuff that, that I like as well there. Yeah. on the show,
uh, I was surprised to see, sublime text still. so I haven't used sublime text. It's a great
product, but I haven't used it for a while. February 3rd, what's your go-to comfort
media? kind of fun. Just sort of, what do you, what do you do in your free time? those are
fun posts. Why not? February 4th, Django apps. I actually use rough cut. So, this,
this sort of thing I love, like I wanted to do a one on pitest plugins of like plugins. I almost
always use. So this is a Django plugins that he almost always use. And there's no description
around them. It's just a list. So just great. You can, you can kind of go and look those up if you want.
And at the end he tagged, projects I no longer use, which is also interesting things. You things
people used to use, but don't, for some reason, that's also interesting to talk about. So I encourage
people to, to take, take that up. lastly, how to test with Django and pitest fixtures,
uh, right up my alley. This is what the article that brought this series to my attention, but he talks
about model bakery and using fixtures. And one of the things I love, which is, is that I learned
something kind of new. I mean, I, I, I, he talks about, using you normally you put fixtures
in a conf test file, but he's using a, a, a feature of pitest called, which is the pitest
underscore plugins variable. And that's a global variable that you can say, Hey, I've got other
plugins go look for it here. and he uses that to put, like model bakery fixtures in,
in a Django project. And it's an interesting idea. And it's a use model that I haven't
seen. I haven't played with myself before. So that that's fun. All right. So good job, Jeff.
the, I wanted to look at, if you want more ideas, there's another article I wanted to point out,
um, called build an idea bank and never run out of blog ideas. So just this, this notion that pick
some way to write down whenever you have an idea, whether it's a notebook or, or you email yourself
or text yourself or something, keep a list of all the kinds of things that you'd like to write about.
And then whenever you want to write, you can just sort of look in there and grab an idea.
So yeah, this is the only way you have a little idea. It'd be kind of interesting, but then you
don't have time to work on it. Just throw it in there. Come back to it. I do this right now. I'm
keeping stuff in to do list and I have a just separate category of to do's and every blog post,
I just check them off when I write it, but I moved a lot of my stuff to notion. And I just absolutely
loving notion these days. It's, it's pretty amazing. And so maybe it'll find its way over there, but
that's not the really important. Just have a place. Yeah. Dealey, something you can check off both
notion and to do is has a little checkbox. You can check whether or not you've written it. So it can
kind of move out of the way and filter it and so on. Yeah. I think I have too many ways. So I've got like
paper slips that I write notes or notes down. I've got notebooks, actual physical notebooks. I've got
a email myself and it just sort of is a lot. I've had to narrow it down to something manageable.
Also the last thing around this writing, writing more is if you want to highlight that you're not
using AI to help you help you write. There's a website called not, not by AI.FYI that has these little
downloadable, downloadable icons or logos that you can put on your, on your work to say that you,
it was handcrafted and you didn't do it by AI. So I thought, I love it. I absolutely love it.
Put a badge on your work. Yeah. So I actually was thinking about playing with AI with helping writing,
like to sort of rough out a topic idea or something to start with. But I haven't, I haven't tried doing
that yet. Interesting. So, so that's kind of my topic is people blog more, please.
Hopefully about Python, but hopefully not with AI and hopefully not with AI.
So I use AI to like think of content and sort of, but just take the AI and paste it in.
Yeah. Yeah. Anyway, we should get people ideas.
So what you got for us next?
I do have some more stuff here. Let's see the next one. Oh, I just closed it. That was not ideal.
Here we go. Oh, let me get my screen up. All right. No, not that one. I'll come back to that
just a second. Okay. So this one was going to be an extra. Okay. How fast is your server? If you had
a server at AWS or you had a server at digital ocean or wherever, how fast is it? I don't know.
No idea. Network speed, not compute speed. How fast is it? Well, the way I would do it at home is I
would go to speedtest.net or one of the other speed mechanisms and I would run it. Right. And you know,
that's, I got to tell you doing speedtest.net is just more fun since I got fiber. Remember we talked
about like one of the episodes, I got it like straight away. So you go and run that and it tells
you, all right, four milliseconds over wifi, I'm doing 500 megs megabit per second, which that's good.
But how do I do this on my server? So this was originally going to be an extra, but it has a little
more to it than I first thought. So there's an exact identical way to do that on an arbitrary Linux
machine. But, you know, ideally I think the use case is a server with no UI, no web browser. It's
called speedtest-cli and it's a command line interface for testing internet bandwidth using
speedtest.net. Cool. Yeah. So use case is pretty simple. X, they always get this wrong. This is pip. I
don't know what this is about. PipX install speedtest-cli. That is how we pronounce this. I
know the X is invisible, but not silent. So pipX install speedtest-cli. And then somewhere down
here, you just run it with different options. So let's go over here to my server and we can just say
speedtest-cli. Look at it go. It does the same ping. It's checking the download speed. Who knows
what it's doing? It's kind of just chilling. It's not a great sign. Let's try again. It says,
oh, we got 2.8 megabit. This is incredible. You have no idea how happy this makes me, Brian.
I'll tell you in a second. So 2.8 gigabit down, 1.3 gigabit up on my server. That's excellent,
right? But that's a lot of output if you just run it normally. So I created a thing called,
which is an ALA, it's called speed. It's just a speedtest-cli-bytes because my brain works in
megabytes, not megabits. I think about how much data I have and how much I can send in bytes,
not like 1.8 or 8x bytes, whatever. And I don't need all that output. I just want the results. So you
can say just simple. Then you run it and you get, wait for it, download. Oh, now it's back down to this.
Oh, because it was in bits versus bytes. Anyway, 269 megabytes per second down, 190 megabytes up.
That's cool, right? Yeah.
It uses multiple connections to like the multicast testing that speedtest.net does and all that stuff.
And it's written in Python.
That's pretty great. I think it's funny that a lot of things are in bits per second because like-
Do you think in bits? Like how many, how big is your hard drive? Oh, it's 30 terabits. Like,
oh, really? That's a big one. Oh, wait, what? Yeah, exactly. That actually is still big, but-
Why don't we measure in tenth of a bit? Like decibits.
Decibits. Dude, my networks are real fast if I measure in decibits. All right. So this would
have probably just been an extra, like I said. If this is all I do, I type speed. It tells me the
speed. Excellent. But if you go back here, you go down a little bit. It also has a, because it's written
in Python, has a Python programmable API. So you can add these capabilities to your code. So you can do
things like if you've got an app that depends on speed, you could report, hey, it needs to be fast
enough. You could have a unit test that says, before we run this test with timeouts and things, we need
to make sure that the internet is working well because we're, I don't know, whatever, right? So you can go
and just create a speed test object called get servers, get me the best server, pass in the servers,
how many threads you want to download, how many threads you want to use to upload, all this kind of
stuff. Very cool, right? Yeah. Actually, this is great. I was just thinking about that because I've
been working with timeouts a lot, like pytest timeout and long test suites can slow down if
your network is slower, if you're actually hitting a service. So being able to check that, it's pretty
cool. And it's pretty cool. It gives you ping time, upload speed, download speed, and you can say only
do uploads, only do downloads and so on, right? That's like, those are separate functions to call in the
Python API to test those things. Okay, neat. Apparently you can even set a mini server.
What is a mini server? I don't know. I don't know. I guess you just specifically set a server. So I
don't know. Anyway, this is cool. If you want to know the speed of your network on your server or in
CI or something like that, you know, here you go. Yeah, nice. Indeed. All right. How about extras?
You got any gathered today? Just so last, just one last week, I mentioned that pytest 8 was out
and people should upgrade. And so I've been upgrading to pytest 8 and debugging stuff. And I,
I mean, I haven't, there's no problems except for something weird. So I was looking at a parameterized
test and then I ran it in my, in PyCharm. I just right clicked on it and said, Hey, rerun this.
And it ran the parameterized list backwards. It was like one, it was one, two, three, four to start
with. And then it reran it as four, three, two, one. And I thought I did something wrong. So I spent
like an hour debugging my code. And then I tried to do like a small example in another virtual environment,
which happened, happened to have an old version of Py, older version of pytest. And it was working just
fine. But when I moved it over, it was backwards again. And it, it just turns out it's a, it's a,
it's a new feature in quotes of a pytest 8. Actually, I am, we're going to link to a defect report.
I haven't had any feedback on it yet, but I let the core pytest people know that this
is going on. I don't know if it was on purpose or if it's a surprise, it shouldn't make a difference.
I just wanted to highlight this so that if you, if you, you know, if you run across this,
it's, you're not doing something wrong. It's just, it was a change in the behavior. So anyway,
implementation detail has surface. Yeah. Yeah. All right. Did it promise to run them in order?
It does. I don't, I don't think that's documented anywhere. Yeah. But people probably assume like
that it would, right? Well, and I did something terrible. I like, in, in the case where I found out
I was actually caching the value in my first parameter to compare it with others. Cause I was,
I was like starting at the zero, like zero offset case at the beginning and, and it failed because
that was being run last instead. And I'm like, what's going on? And so, yeah, it was bad form on
my part. I don't, don't cache the first value. So don't do that. So anyway, I'm just going to do what
you got to do. Yeah. All right. I got a few extras for us as well. First of all, a quick follow-up on
orb stack. I spoke about orb stack and also saw Jeff triplet says orb stack was the thing he's
going to. Remember I mentioned this before as an alternative to Docker desktop, open source,
all that two really quick notes. One, it does, it does require a paid version for commercial use.
So the free version is only non-commercial, which is, you know, whatever, like take that for that.
If that is good or bad to you, you know, whatever it's their business model. But I just wanted to
point out one of the things that this thing did that is super awesome. And I'm just really enjoying it.
Brian, when you create a Docker container, it's kind of like this isolated thing. And yes, I know you can
run a shell in it while it's running to basically attach into it and then like go through the terminal,
go explore it. But sometimes it's nice to just visually look at it or even edit in an editor with
syntax highlighting all this stuff. So with orb stack, see, there's a little on some of these,
oh, not this one is wrong. You got to get to the volume section. I don't know if it shows it, but
in the volume view next to every volume, which is like the little hard drive that's temporarily assigned
to that container, there's a button to click and open it in Finder or Windows Explorer. And then it's just
like a thing you could open it up in PyCharm or VS Code or whatever, and just start working inside of one of
these running things, which is, that's pretty excellent. So just wanted to give that a little
bit of a shout out. No time for a joke yet. We're talking CSS. CSS is not funny.
So have you, have you mostly moved over to like orb stack and not using Docker desktop then?
Yes, but I mean, it's really just like something running in the background. So Docker commands work.
I haven't really.
Okay.
Although I'm doing more and more stuff with like running some of my apps in Docker. So in a sense,
yes, but, but not too much, but that's just really delightful. You're like, wow, I can just
use a proper editor to like, see what's going wrong with this. That's pretty excellent.
Yeah. Okay.
Yeah. As I said, the next one is CSS. So there have been traditionally like meta frameworks,
meta languages or languages on top of CSS that transpile or compile down to it. You know,
less SAS, SAS, these things that have more like, well, there's all these problems with CSS. Like you can't
have nesting where you can't have variables and they make it really hard to do stuff with CSS in a
way that doesn't duplicate code and values and stuff, right? If you want to have a background color,
you can't just say normal background color is gray. You have to repeat the word gray or to value gray
50 times through your file, right? Which is a hassle. Well, apparently modern CSS and most of the
browsers support this have built in CSS nesting already where you can put a value part of your
CSS design inside of the other one. So like, instead of saying parent space, child, parent space, other
child, right? You just put the child and other child inside the parent and modern day CSS takes that and
loves it. Awesome. Right. That's cool.
I didn't know that.
I didn't either. I thought you had to use one of these other languages, but apparently you can also have
variables, right? If you say this minus minus some variable name has a value that will create a thing,
a variable called minus minus, in this case, it's a main background color. And then later,
somewhere around here, where you can then go and then actually work with those. I don't know where
the example is, but somewhere you can go and just say, yeah, the background color is var of this thing.
It's kind of, I think this is actually super janky. It looks really weird, but yeah, modern CSS has
nesting and variables with no transpiling, nothing. You just write it and it just runs, which is pretty
excellent.
Yeah. The variables thing is the one thing that drove me to a transpiler. So cool.
Yeah. I think less, fewer steps, right? The modern web has got so gnarly to just get something to work.
It's like, oh, did you npm install this? Oh, and then did you set up the watcher so that when you
change this, it like shakes the CSS tree over here and then transpiles the tri script and then
what is going on? I just could just type and run like, where did, where did this go wrong? Right.
I just want my dumb button to be blue, please.
Exactly. Why is it still gray? I'm going to go play in traffic. If it doesn't turn blue in the
next 30 minutes, I can't quit programming. I just can't. That's kind of the feeling in the modern web a
lot of times and like not depending on that stuff because apparently it's already supported is,
is like, you could just write this. It's great. All right. One final extra before we get to the joke
is I just want to give a shout out to this new feature in Safari where you can go and you can say
on any website, file, add to doc, progressive web apps, right? Because they're Apple, they can't call
it that. They have to say, we have a feature. It's called add to doc. No one else has add to doc.
It's like, cause they already had it under something else. Like Chrome has it, Vivaldi has
it and so on. So why, and I'm not a Safari person, right? I kind of think Safari is like one of the
least good browsers out there, but so why would I give a shout out to this? You're going to get hate
mail. I'm going to, please don't mail me. Show me how to set a DNS over HTTPS in Safari. Even a simple
thing like that. Can't do it. Okay. Back, back to Safari in a good way. So one of the things that's,
I like, I use Vivaldi, right? Everyone knows, I talk about it all the time. You can do this in
Vivaldi and it's excellent. The problem is if I want to open one of those apps and I don't have
Vivaldi open, Vivaldi with all of its histories and all the windows I had open come blasting into the
screen. And then that little thing I was trying to open opens, right? Which I got, or if I'm on the
big regular Vivaldi and I happen to have that on the side and I close Vivaldi, oh no, that thing closed
as well. And I forgot it was actually part of Vivaldi because it looked like it's own, right? It's just like a
hassle. With this, they're like standalone apps that just run completely dedicated. They don't
even have to be PWAs. They just have to be URLs. You can alt tab or command tab between separately.
They're really nice. So I encourage people who are on Macs to check this out. If you're not on a Mac,
well, then don't worry about it. We can title this the grumpy old man episode.
Write more blog posts. Write more blog posts. Use Safari, even if you don't love it.
All right. How about this? How about a joke? Shall we wrap it up?
Yeah, let's.
And I got to tell you, this joke is entitled White Lies and it connects with me so much,
so much. All right, here we go. I'll tell you, Brian. So there's a woman developer who's being
distracted by their manager, obviously wearing a suit and tie. I'm saying to talk to her.
Talked to her and says, apparently talking about this new app, this amazing app that they're about
to launch. The boss asks, will this solution work for a million concurrent users? The very smart
developer says, how many concurrent users do we have today? 10, says the manager. Yes. Yes,
this will work for a million concurrent users. Exactly. You can dream all you want. We got 10 users right
now. Whatever I'm building is going to be fine until we got a whole lot more time to worry about it.
Yeah. Does that connect with you? Yeah, very much. Yeah. It's hard to not think about that. Like,
what if this takes off tomorrow? And we like, you know, well, then we'll add capabilities tomorrow.
Yeah. Yeah. Exactly. That's why it connects with me.
So it used to be that in the software world, you could tell if somebody was going into,
has had a job interview that day was because they were wearing a suit or wearing a tie or something
like that. And so I, when I first started, I would wear ties on Fridays and people would say,
you're freaking me, freaking everybody out. Cause everybody thinks you're interviewing for another
company. Hey, just keep them on edge. Just don't let them, don't let them get too comfortable.
Yeah. But now I kind of, I watch out for any of my coworkers that are not wearing the same shirt
they were yesterday. they might be on the job interview. So thanks. Thanks for the joke and the,
the wonderful episode. Absolutely. Great to, good to be here with you, Brian and with everyone else.
See y'all later. Bye.