Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book

Transcript #303: This title is required or is it optional?

Return to episode page view on github
Recorded on Wednesday, Sep 28, 2022.

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

00:05 This is Episode 303, recorded September 27th, 2022.

00:11 I'm Brian Okken.

00:12 >> I'm Michael Kennedy.

00:14 >> We've got a lot of great stuff to talk about today, and it's a wonderful September day.

00:18 It's finally not feeling like the blazing summer, but it's still too hot.

00:22 >> It's that lovely fall before it rains for 120 days straight.

00:27 >> It's like the pre-fake fall.

00:28 >> Yeah.

00:29 >> Exactly.

00:31 >> All right. Well, the Python news still flows in the fall.

00:36 >> Yes.

00:36 >> All sorts of good stuff.

00:37 >> Yeah.

00:37 >> But what I got on deck for us is a bit of a follow-up.

00:41 So I got this message from Mikhail Honkala, who sent over this repo that he put together.

00:50 Says, you spoke about Humre, Humre, Humre, H-U-M-R-E.

00:56 I said, you know what? There's a bunch of these projects I'd really like to kind of get my head around them.

01:00 And so he went to all the trouble to like do a whole research project and a categorization or a taxonomy of these different libraries, which is really fantastic.

01:12 So I'm linking to his GitHub repository.

01:14 That's basically a read me.

01:16 I mean, get ups kind of the new blog for code analysis.

01:20 Isn't it?

01:20 And it, it says Ari for humans, a reg regular expressions for humans.

01:26 And it says, there's a bunch of different options.

01:29 This list could be useful to help you decide, you know, if you're looking for a tool, you'll just know what's out there and you'll get a quick look and feel of how each library's API is.

01:40 Or if you're thinking about building a tool, you can check out the alternative approaches and either contribute to an existing package or see if your thing is truly unique.

01:48 And if you're building a tool or already have one, you can communicate your differences compared to the other libraries.

01:54 Okay, so there's a bunch of packages listed here with some code examples.

01:59 So the first one Mikio calls flow style regular expression generators.

02:05 I would call them fluent style, but where you say, you know, function call dot function call dot function call dot function call.

02:12 Basically the result of working with a library or calling a function, it returns the same thing again and again, and you can kind of build it up.

02:20 Like ORMs are a lot like this.

02:22 you know, you'd say like objects.filter.orderby.limit.sort, like that kind of model.

02:30 Okay, so these include Python verbal expressions, edify, MRE, regularize, and RE_patterns.

02:39 And they all are similar, but not the same.

02:43 So I'll just, I'll read something off the top one, the Python verbal expressions.

02:48 You would say verX for version expression, dot anything dot then space dot then left bracket dot or parenthesis.

02:59 So square bracket or open square bracket, open parenthesis, then dot anything.

03:02 And that'll generate a regular expression that would then go and, you know, match basically like star and then space and then either square bracket or parenthesis open.

03:14 What do you think?

03:14 I don't know if we're getting better than actual regular expressions at this point.

03:19 All right.

03:20 Well, let's go to the next category then.

03:22 the, these are categorized as plus style, regular expression generators.

03:27 Oh, I would call them ones that like overload operators, right?

03:31 They use, they override what plus means and the pipe, what that means.

03:36 And it's a little bit like what path lab does for forward slash or time time Delta, right?

03:41 Yeah.

03:42 So here I could say, you know, this includes the humor.

03:45 That's the one from Al Swaggart.

03:47 So this, the, let's see, which one of these do I, I think that I like the best. I'll probably go with this first one here.

03:54 So you could say capture one or more of anything uppercase plus the empty string or the string of the space rather plus either the open preface or the open square bracket.

04:05 Is that one? Do you like this style better?

04:08 >> Well, I'm probably a bad one to ask because I actually I don't have a problem with regular expressions.

04:14 >> Sure. Well, neither of these two are my favorite style either.

04:18 I actually think I would use the format strings, which is the third category.

04:24 The reason I say that is it's really different than regular expressions, where these are like a semantic wrapper on regular expressions.

04:32 There's a way I call functions, I give a name to the thing instead of just the symbol, like plus versus plus star, dot star, it could be anything or you could say anything.

04:45 >> Also, with all of these, they have a special syntax that they use.

04:49 You don't have to learn regular expressions exactly, but you still have to learn their syntax.

04:54 >> Yeah, that's true. When I might use one of these libraries, is when it's not enough to go do full-on regular expressions, but find is not sufficient or index, things like that.

05:09 That's these string format styles.

05:12 If you knew I had a log file or something, and it said power colon, some number, percent, a string, and then a temperature, then another number, you could just say power, this is the scanf library, power colon, percent f, bracket percent, percent s, comma, and then temp.

05:32 So you would basically, the format string you would use to generate this thing can now be used to parse it in reverse.

05:41 And so it'll say, you have to have the word power colon, and then a floating point number, and then and so on.

05:46 That's the older, that's the Python 2 style, I suppose.

05:50 Then you have pars and simple match, which are both much more F-string style.

05:59 >> These are great. I'm looking at parse and that looks pretty cool.

06:06 >> Here, yeah, it says, here's the regular expression pattern thing you would make.

06:11 you would say just as a string to get curly bracket amount colon D item colon W comma meet me at curly time.

06:20 Right?

06:20 And it just goes and finds the amount, the time and the item as a beautiful, you know, just like is a basically it's a reverse F string is what it is.

06:29 So if you can express what you're looking for as an F string, then all of a sudden you can get it back.

06:34 And so for those kinds of matches, I think this is really, this is a, it's pretty different than a regular expression.

06:40 >> It is, but it's especially those ones where you're not just trying to match a string, but you're trying to pull data out.

06:48 >> Yes.

06:48 >> Where the regular expressions really get ugly.

06:50 >> They do. I got to have a capture group and all this stuff.

06:54 You're like, "Oh, geez, how do I do that again?" >> Exactly. The capture groups, and it's guaranteed to confuse somebody on your team, but something like this, I think it's pretty neat.

07:03 >> Yeah. It does mean the data has to be more structured.

07:07 But if it's highly unstructured, go crazy with regular expressions.

07:10 If you just need more than, like I said, a little more than finder index, this is pretty cool.

07:14 >> Yeah. There's some wacky things that really you need to jump into regular expressions or the other kinds.

07:22 >> Indeed. All right.

07:24 Well, Mikhail put his thoughts on which ones to pick and when, and then a little bit more diving into each of these and some comparisons and whatnot.

07:34 You can check this out. It's really good work.

07:36 If you know of other ones, maybe contribute to them or add some more explanations, but there you have it.

07:42 >> This is really nice.

07:43 >> Yeah, this is real nice. I'm going to start.

07:45 It looks like I may have already started, so let's go.

07:47 >> Cool.

07:48 >> Thanks, Mikhail, for sending that in and creating it.

07:51 >> Well, what do I got? I got just some newsish things.

07:56 I've been playing with Pydantic and FastAPI a lot.

08:04 With that, you've got types.

08:06 you're intentionally adding types, not just because you want my PI to pass, but you're adding types because it helps you.

08:15 You kind of have to for fast API and stuff and paydantic.

08:19 So one of the things I was curious about is the whole, the optional part, because somebody actually caught me on this.

08:29 I have this, I tend to just say like, int x equals none, or no, x of type int equals none.

08:38 And that means it's supposed to be an integer or it's supposed to be a string or something, but it doesn't have anything yet.

08:46 So the default value is none, but none is obviously not a string or an integer.

08:50 So what do you do?

08:53 And so there's like a bunch of options.

08:56 One, you could just say, well, the language allows it.

08:58 So I'm gonna do it anyway, but I don't recommend that.

09:01 The other is, one option is to use optional, but there's some issues with that.

09:07 We'll talk about those in a sec.

09:09 And then another is just to union or in, so you can either use like int or int bar none or union of int and none, and then assign it to none.

09:21 And so I, for a while, like when I, I'm like, the language allows it, just go fine.

09:30 because what I really mean, my intent is, I expect somebody to pass in, in this case, an integer.

09:37 But if they don't pass anything in, I want the function to handle that case also.

09:44 That's what the none is for.

09:46 The union is a little weird because it says you can pass in a none.

09:51 That would be weird for somebody to pass in none, but that's what our language is also.

09:57 That's the default. I put out this, I put out a little survey, the recommendation that of the 630 votes, it was either use the union or optional.

10:10 People are kind of on the fence about that.

10:13 So Adam Johnson replied to just the other day, said, "Well, mypy just released and they don't deprecate this yet, but there's going to be a future deprecation of implicit optional types.

10:28 I can't use the old style.

10:30 If you're using mypy also, you should--

10:32 - The old style being int equals none.

10:34 - Yeah, of just like ignore the type for the default value.

10:40 So mypy, the mypy 0.981, I don't know why we're not, where it's zero version still, but whatever.

10:52 But it has, it talks about implicit optional type.

10:55 So this, yeah, of saying it's a string, but the default value is none, that's bad.

11:02 We don't want that anymore.

11:04 What we want is optional, we'll say will work, and we'll say, you know, then this is the weird part.

11:12 So the weird part is optional isn't optional.

11:16 So what I'd like to use is optional.

11:19 Like in FastAPI, it looks nice to say this variable is optional, But what really optional means is just that optional just translates to the type or none.

11:32 That's it.

11:33 Those are the types.

11:34 It doesn't say it's actually optional.

11:36 It's only optional if you have a default value.

11:40 Default value makes it optional.

11:42 - You can have a thing that explicitly says this type is optional, but it's a required parameter, which is a little odd, right?

11:49 - Yeah.

11:49 (laughing)

11:50 What's up with that?

11:51 Yeah, so a required optional.

11:54 So anyway.

11:55 - The third parameter name such and such of this type is required, but it's literally of type optional.

12:01 Yeah, I hear you.

12:01 Okay, that makes sense.

12:02 - So the basic gist is you have to pick.

12:05 You gotta pick either optional, use an optional and then assign it to none or use a union.

12:13 But another option is just to actually assign something other than none.

12:18 So if it's a string, you could have a flag value to say like--

12:22 - Sentinel.

12:23 >> That means like an empty string, like a great one for a string is empty string.

12:28 The problem is with numbers like a floating pointer and integer number, there aren't any sentinels.

12:33 I mean, I guess you could use nan, not a number, but that's weird.

12:39 Anyway, I wanted to reference typing.

12:42 So just to say my proof that optional is really just the union of the type or none.

12:47 It doesn't say anything.

12:49 They explicitly say in the Python documentation that you can, basically you don't have to use the keyword option, you can just put a default value that makes it optional.

13:02 >> Yeah.

13:02 >> It's only a type. Anyway, the other thing, the last bit I wanted to talk about with this is the best introduction.

13:09 If you're confused, like I still am apparently about this, the best discussion that I've found is in the FastAPI docs and go to, there's a Python types intro.

13:22 like at the top partway down it says possibly none.

13:26 And it discusses all of this and the fast API recommendation is to use union instead of optional.

13:34 And I think I've finally gotten there that I think I prefer just the either union or if you're in the bar thing.

13:41 So you can say type or like type bar none.

13:45 And that's if you're only if you're Python 3.10 that works.

13:49 But if you're on the others, I would use union.

13:54 >> There's a bit of a voting in the audience.

13:59 Alvaro says, "Int or none," which is a voting for that one.

14:03 Anthony says, "I prefer optional of int equals none myself." I also concur with Anthony, but I still very much would love to see some language syntax.

14:16 it's a little bit cleaner, like in C#, in Swift, they just have question mark at the end to say, it's either can be none or it can be its value.

14:27 It's just such a common thing to set something to none, and then or alternatively have its value that I would just love to see some simpler syntax there than we see now.

14:39 >> Yeah, or some other Sentinel that like SQL, doesn't SQL have null or something like that?

14:46 That's not a legitimate value for anything.

14:50 >> Yeah. Also, if we use, by the way, one more reason I think people would want the question mark, or something I think would be cool is it gives you this tonal inflection.

15:02 This function takes an int, boom, hard stop.

15:06 That means it has to be an int, or it's like an int.

15:09 Well, then you're not sure, it's optional.

15:11 >> Or you're not sure what type it is.

15:13 >> Yeah.

15:13 >> I think it's an end.

15:15 >> Yeah. In question mark, come on.

15:17 It's in a lot of the other languages that have this, things that can't be nullable unless you express their null, you say they can possibly take on their value or null.

15:26 Anyway, I know this has been discussed and shot down, but we make it happen.

15:33 >> I was pretty sure you could do this.

15:34 Thank you, Alvaro.

15:36 Mentioned that you can use from future import annotations to use the bar for everything on three, eight and above.

15:44 So that's good.

15:46 But if I'm doing a fast API, the optional is really what I mean.

15:51 I mean, it's optional, but it's frustrating that the type optional doesn't actually fill in anything.

15:58 >> Yeah. Bit of a mismatch there.

16:02 >> Okay. That's enough.

16:05 >> That is enough. Enough on that.

16:06 It is so good though.

16:08 Good stuff that those types are there.

16:10 Brian, you want to tell us about our sponsor for the week?

16:13 - Sure.

16:14 So Microsoft for Startups Founders Hub, it's very cool.

16:19 So Microsoft, this episode of Python Bytes is brought to you by Microsoft for Startups.

16:26 And the Microsoft for Startups Founders Hub provides all founders at any stage with free resources to help you solve startup challenges.

16:37 And it's a platform, the platform provides technology benefits, access to expert guidance and skilled resources, mentorship and networking connections and so much more.

16:47 And those skilled resources and the one-on-ones and the networking, it's so valuable.

16:54 So unlike others in the industry, Microsoft for Startup Founders Hub doesn't require startups to be investor backed or third party validated to participate.

17:05 It's truly open.

17:05 and you don't have to live in San Francisco.

17:08 So what do you get?

17:09 You get free access to GitHub and Microsoft Cloud with the ability to unlock credits over time.

17:14 And they also have partnered with innovative companies like OpenAI, a global leader in AI research and deployment to provide exclusive benefits and discounts.

17:24 Through the Founders Hub, becoming a founder is no longer about who you know.

17:30 You'll have access to their mentorship network, giving you access to a pool of hundreds of mentors across a range of disciplines, across areas like validation, fundraising, management, and coaching, sales and marketing, as well as specific technical stress points.

17:44 And you know that there's at least one or two of those fields that you need help in.

17:49 You'll be able to book a one-on-one meeting with the mentors, many of whom were former founders themselves.

17:54 Make your ideas a reality today with the critical support you'll get from the Founders Hub.

17:59 To join the program, visit

18:05 and of course the link is in our show notes.

18:07 - Absolutely, thank you Microsoft.

18:09 All right, let's talk about linters.

18:11 I know you're a fan of linting code and making it look good as am I, but if you did Cython, you might not be able to get great information about it.

18:22 So Marco Gorelli sent in this project that he's just getting started called Cython Lint.

18:30 So have you done much Cython?

18:32 I know you do C and you do Python, but you live in this weird middle ground.

18:35 - I don't, but I want to, or maybe I don't, I don't know.

18:39 - I think it's pretty neat.

18:42 There's a bit of a build, like a bit of a build step you gotta go through to get code that will run, but the ability to just say, I wrote Python, it has type-ins, like, oh, let's just do a little bit different code, and now it runs at C speed for just like a function or two, I think that's a pretty appealing idea, and Cython is definitely a good way to do that.

19:00 So Cython-lint will go through, and you can just pip install it and then run it as a command line, give it your files, or you can even install it as a pre-commit hook, and then just whenever you commit, it'll obviously run as well.

19:16 Just like the no QA in Flake 8, there's a hash no Cython lint to turn off the lines, and right now it mostly checks things around variables, but he's working on more, and hopefully other people out there are interested in this and can add some ideas too.

19:32 This is really cool.

19:33 And I hope that he does get people helping out and adding to this.

19:38 Definitely it was something needed.

19:41 - Yeah, he said he ran it on Pandas, NumPy, Scikit-learn and QPy and found ways in which all those libraries could be cleaned up.

19:49 So pretty neat.

19:51 And all those libraries are notable because they're really highly, highly used and have been around for a long time.

19:57 So if this is finding issues with them, then maybe it points out that something like this should exist.

20:02 - Yeah, definitely.

20:03 - Yeah, cool.

20:04 So not a whole lot more to say about it.

20:06 You know, Cython's cool.

20:07 Having some more tools to support it, also cool.

20:09 - Yeah.

20:10 I've got another sort of possibly short topic.

20:14 I found out about this cool diff tool called Difftastic.

20:19 Have you seen this before?

20:20 - Diftastic?

20:21 I don't think so.

20:22 I'm always looking for a better diff tool.

20:23 I'm never really content with my diff tools.

20:25 I use one called Beyond Compare.

20:27 It looks like it's cutting edge out of the early '90s.

20:31 It's useful, but boy.

20:34 >> I'm finding that also, I use diff a lot, but I also use it a lot with respect, like with Git.

20:44 I do a Git diff of older versions or something.

20:49 Diff-tastic, how it stands out against other diff tools is, It's not line-based.

20:57 So it's a structural diff tool that understands syntax.

21:02 So what it does is it evaluates the language and tries to determine what language the file is in.

21:08 And then if it, like, and it's got a ton of languages.

21:11 And if you, it figures out like it's Python, for instance, or any other language, it creates an abstract syntax tree of the files and then checks the differences of those.

21:23 So in the past, like one of the things that messes things up is just spacing problems.

21:29 Like in something like C or C++ where spacing doesn't matter, you can just say, well, ignore white space.

21:35 But in Python, you really can't say ignore white space because white space is significant.

21:41 But with the Difftastic, the diffs will know, if it's significant white space, it'll tell you.

21:48 So I tried this out this morning And it's pretty amazing.

21:54 So I tried it.

21:56 So the thing I tried was replacing with the diff tool.

22:00 So there's a with get.

22:01 So in get, you can say, and I just tried this single line thing to just temporarily say, I wanna try get diff.

22:09 It has is diff T instead of get diff.

22:13 So what this does is it does a diff.

22:18 And there's ways in the documentation where you can permanently turn it on, but it's colorized.

22:25 So you've got like syntax highlighted files side by side and it'll show you what's different and it highlights the difference.

22:32 Well, I got a little bit confused because there's syntax highlighting and highlighting to show you the difference.

22:40 So there's a flag and I'm not sure where it is in the documentation, but basically you just turn off, you say dash test syntax highlight equals off.

22:49 >> Wow.

22:50 >> It turns off the file syntax, but it shows all the highlights are just diffs.

22:56 If you normally say get diff just without anything, it'll say what's different about my file versus the last version or the working directory or whatever.

23:08 It usually does the right thing.

23:11 But it's on top of each other, it's not side by side.

23:15 having it side by side is cool and having a highlight.

23:18 So I had some code where I changed stuff and I've been working on it a month ago or so and I forgot what I did and Git diff showed me just tons of changes.

23:28 But Difftastic showed me that I was just changing some minor things like adding types, a couple of types here and there or changing double quotes or single quotes to double quotes.

23:40 So I apparently ran black on it at one point and there was like, oh, since AST wise, there's really nothing different.

23:48 So I can just commit this and be done with it.

23:51 So it was really helpful.

23:53 - It is a pretty interesting idea, right?

23:54 Sometimes you really care about those little formatting differences and you wanna make sure they get merged and committed.

23:59 And other times you wanna know what is the essence of the change?

24:03 And this sounds like that'll answer that.

24:04 That's pretty cool.

24:05 - And it showed me a bunch of stuff that Git says, there were file changes, but Difftastic said, there's no syntax change.

24:14 So I apparently had changed some, you know, line, some formatting or something, or ran black on it, but there was nothing significant change.

24:23 So interesting on that.

24:25 And apparently this was a huge pain in the butt to make.

24:29 And there's a, we're going to link to a blog article called "Difftastic the Fantastic Diff" by Wilfred Hughes, who wrote it, that basically said he thought this was gonna be sort of a minor thing to build and it was a big thing to build.

24:47 - Six months later.

24:48 - Yeah, I'm not sure how long he spent on it, but yeah.

24:52 But yeah, and here's an image of the little different highlighting, the colors and changes and stuff.

24:57 So anyway, it's nice.

24:59 - Yeah, looks like a great tool.

25:00 I've never heard of it.

25:01 Thanks for finding it.

25:03 Alvaro out there says code dash dash diff.

25:07 I'm guessing that's VS code diff.

25:09 I've never done anything.

25:11 - I haven't used that for my command line.

25:12 I should try that.

25:13 - Yeah, perhaps.

25:15 Okay, also one that I've been looking at that I haven't gone and used is this one called Kaleidoscope.

25:20 That's just for Mac only, but it looks pretty interesting.

25:23 It's supposed to work on code, but also on like directories, but you know, images and other documents as well.

25:32 So I don't know, maybe someday.

25:35 The only challenge, it looks beautiful.

25:36 The only problem, that's not a problem, The thing that has held me back is it's $150.

25:41 So it better be darn good.

25:43 At least there's a free trial.

25:44 Maybe I'll try it someday.

25:45 - I volunteer you to try it out and get back to us.

25:48 (laughing)

25:49 - Exactly, let me know how that goes.

25:51 (laughing)

25:53 - Yeah.

25:54 - All right, well, that's our items, right?

25:55 I got an extra if you're ready.

25:57 - Yeah, let's go to extras.

25:59 - So this is not a Python thing, but a thing that developers may be interested in.

26:03 Have you heard of Next DNS?

26:06 - No.

26:06 One of the things that's a big hassle is spyware, tracking, all sorts of trackers like fingerprinters and Facebook cookies and all these different things that are trackers, which is not lovely, but also malware as well.

26:27 And a lot of those are being served off of third-party domains.

26:30 So there's this product called NextDNS, and I'd never heard of it, but apparently it more or less acts like a firewall by not allowing malicious or unwanted things to resolve over DNS.

26:45 - Wow.

26:45 - So what you do is you just, you set it up, you just set your DNS server to be, you know, 1724, or whatever their DNS server number is.

26:54 And then it goes, everything goes through there.

26:56 And if it says, hey, we're trying to go to DoubleClick, you know, like, no, we don't know what DoubleClick is.

27:00 It's not on the internet, I'm sorry.

27:02 And just, there's no more ads.

27:03 So it blocks a lot of the ads and trackers.

27:06 And because it's a DNS service and not like an ad blocker in your browser, it works on whole devices.

27:14 So you could set it up on say your router and then everything including your television and the mobile apps and everything on, they would all get this blocking, which I think is pretty cool, pretty interesting.

27:25 - Yeah, I'm definitely gonna check this out.

27:28 It looks great.

27:28 - I'm not quite ready to set it up on my router yet because every now and then you basically are forced to turn off your ad blocker for some small weird website or do I wanna impose this on my wife?

27:44 Maybe, maybe not.

27:46 Do I want the tech support that like, so I'm on the fence, but I think it's a neat idea and I might play with it as well.

27:52 You can always get it and just set it on your computer, right, but if you wanted to like, every device I have automatically gets malware and add tracker blocking to put it on your router.

28:03 - Yeah, so one of the things, oh, do you have any other extras?

28:06 - No, that's it.

28:07 - Okay, so one of the things I've been trying to block ads and stuff is I found out about this a VPN called Malvad.

28:15 I don't even know how to pronounce that.

28:19 But it's been pretty good.

28:22 It blocks a whole bunch of stuff.

28:25 Of course, switching to Vivaldi helps.

28:27 You can have Vivaldi block stuff.

28:29 but Movad is so, so like into security that it doesn't even ask for a password or an email account or anything.

28:42 So what you do is when you sign up, it gives you an account number and you just have to write that down and use that.

28:48 And to pay for things you can use, they encourage you to use cryptocurrency or something, but you can use cards or whatever, but that potentially could tie you to them, right?

28:58 So they also allow you to just put money in an envelope with your account number and just mail it to them.

29:06 (laughing)

29:07 - That's awesome.

29:08 - They'll add money to your account.

29:09 So anyway, that's pretty neat.

29:12 - I've done a massive amount of research on VPNs and there's a really whole bunch of shady ones out there, but Mulvand and NordVPN, those two come out really, really good.

29:23 And so I've heard of great stuff from all that.

29:26 I use Nord VPN and the reason I'm not using Next DNS or something like it is I just run Nord VPN and everything and check the block all the ads over that as well.

29:34 So it's very, very similar.

29:37 So yeah, I think this is a great solution and basically do the same thing.

29:41 - I also wanted to remind everybody that the current, this is got a little bit old news, but the current Python 3.11 is Python 3.11.0 RC2, definitely worth people trying out.

29:54 and definitely if you've got a module that you're, you should have been doing this already, shame on you.

29:58 But if you've got a package out there on PyPI and people are using it, you should be updating your testing to make sure that it's testing the latest Python 3.11 to make sure it continues to work.

30:10 The last extra I wanted to bring up is, I saw this the other day called Oh My Git.

30:15 And so this ends up being, what it is, is it's a little game and it's a little weird.

30:23 But I tried it out, downloaded and tried it out.

30:26 You've got most of it, it's like this view.

30:31 There's a workspace area in the middle, there's cards at the bottom, and the cards are skills that you get.

30:37 But on the right, there's a description of what you want to do, and you have to learn the Git commands to do something, like rebasing or merging or whatever.

30:51 I started out at the trying out at the very beginning, the basic stuff, and it actually was, the introduction was pretty cool.

31:00 And then, but what I really like is that you can just go to the course, the available, available lessons.

31:08 You don't have to do it in order.

31:10 You can jump out of order and just hop ahead to something else that you're having problems with and sort of have a visual introduction to get.

31:19 So it's kind of neat.

31:21 That's weird and kind of wonderful.

31:24 - It is a little weird too, yeah.

31:27 - But wonderful, yeah, very cool.

31:29 All right, one more quick follow-up.

31:32 Wagon Race says, "I know we don't want ads, "but ads are the reason most stuff is free.

31:37 "Or do you make donations to sites "that you block ads from?" I just wanted to comment on that real quick.

31:44 I understand that there's a lot of services that do need support.

31:48 I mean, I was just listening to an interview with the guys from The Verge.

31:50 We have a hundred person team at The Verge working on stuff.

31:54 And yet there is so much like collection and triangulation of who you are and what you are by these ad networks through like data brokers and behind the scenes stuff that is just, it is a plague on society.

32:10 I mean, think about the 2016 election and the Facebook stuff.

32:17 God, what is that name of that company?

32:18 Do you remember Brian?

32:19 - I don't.

32:21 - Yeah, so they were using all those things to basically, that kind of information collected from those ad networks to target and manipulate people.

32:29 So it's not just about like, do I not really want to see this ad for a new programming book, whatever.

32:37 It's the fact that they're using these terrible third-party networks to deliver it.

32:43 So for example, Brian, check this out,, right?

32:47 If we go here and we go to our episodes and let's just pick one here.

32:52 I got to zoom it back out a little bit.

32:53 There we go.

32:54 Look, this one right here, it has an ad.

32:56 That's been, there's an ad blocker on my VPN on the network and there's an ad block blocker in my browser.

33:01 And right here, we have an ad with no blocking.

33:03 It shows up just fine.

33:05 Do you know why?

33:06 Because we're not using an evil third party network.

33:10 There's no tracking, there's no retargeting.

33:12 We show you things from people who support us.

33:15 We ask you to please check them out and at least consider it to support our show.

33:21 And yet there's as much ad blocking here as there is on somewhere like CNN, or you pick your spot.

33:29 These places have like 30, 40 different tracking networks on you, triangulating stuff and reselling it, and it is a plague on society.

33:38 And if CNN wanted to show you ads, they could do just what we do.

33:41 I'm sure they have better relationships with advertisers than we do.

33:44 So Cambridge Analytica, thank you for letting me know.

33:47 So I'm not against ads.

33:49 I mean, to a large degree, we are ad supported.

33:52 I'm against people building behind the scenes information and using it to manipulate society.

33:58 Bit of a rant, sorry, sorry, Brian, if I went too far there.

34:01 - But no, and some people just don't realize that, that the ads are not just, there's a product that we think that you might like based on the content of this page.

34:10 That totally makes sense.

34:12 Like this, the people that are listening to Python Bytes, they might be interested in Python or Microsoft Restarters Founders Hub or something.

34:19 Magazines used to be like this all the time, right?

34:22 So you buy a magazine, it's not tracking you, that whether or not you looked at something or looked up somebody's website because of a magazine ad.

34:29 There's just stuff collected about you that I don't think is necessary.

34:35 And I think, like for instance, Read the Docs has like the ethical ads that they don't do, yeah, they don't do tracking, so yeah.

34:45 - Exactly, and neither do we.

34:47 On purpose, it probably, we've had to turn down sponsors.

34:50 People said, "We want to sponsor you, "but we need you to install this tracking thing "for your MP3 downloads, "we need to install this Facebook pixel "and these other things." We're like, "You know what, we don't want your money." Like, no.

35:01 We're happy to sell your product 'cause it's relevant, but we're not gonna spy on our users.

35:07 So thanks, but no thanks.

35:09 All right, and WagonRace, just a quick follow up, says, "Thanks for the explanation.

35:13 "I do understand you better, "and I'm glad you guys are big enough "to have direct sponsors without trackers." So are we, thank you.

35:21 Okay, with all that, let's flip the table and make something, fill it out with a joke.

35:26 What do you think, Brian?

35:26 - Yeah, I'm ready for something funny.

35:28 - All right, so this one comes from somebody who had to go through this online, multiple choice, "Prove to me you know JavaScript test to be hired." Okay?

35:38 And it says, "So I got this wrong because the person who typed in the question made a mistake." So here, check this out.

35:45 It's one of these multi-choice question things.

35:47 It says, "What is the result of the function call shown below?" And it's just super simple JavaScript.

35:54 It's creating one of these little Lambda expressions here and it has the equivalent of an F string, an interpolated string.

36:04 is really the essence of it.

36:05 And it says console.log, open parenthesis, this is important, as you would, open parenthesis, quote, hi, my name is, you know, dollar curly first name, close off the curly, and then it closes out (laughs)

36:19 - Oh no.

36:20 - Console.log, instead of with the closing parenthesis, with a closing curly brace.

36:25 And so the options are like, hi, my name is John, I'm logged into the console.

36:28 Hi, my name is undefined, I'm logged into the console.

36:31 And what the machine thought was the correct answer is, "Hi, my name is John Jr." 'Cause that's the name of the variable, the value variable.

36:40 "I'm logged into console." And you answered, "Uncaught syntax errors logged to console." (laughs)

36:48 And you're like, "No, wrong.

36:49 "It was supposed to say John Jr." "No, wrong, you typed it in wrong." (both laugh)

36:55 Wouldn't that be frustrating if you're trying to apply for a job and they put syntax errors in there and you're like, >> Nope. Because they may be checking whether or not you're finding that closing curly brace.

37:04 That's a legitimate test, I guess.

37:07 But no.

37:08 >> Yeah. I think it's fine that you don't get to work for them because they're probably not someplace you want to work for.

37:14 They've got syntax errors in their on-boarding.

37:17 >> Exactly.

37:19 >> In their application process.

37:21 >> Exactly. Oh, well.

37:23 Anyway, I thought that was pretty funny, and I'm sure people have been through that.

37:26 There's all these weird go home and write this test or take this thing to prove, you know how to write code sort of things.

37:34 I'm sure people have been through so, they'll probably get a laugh out of this.

37:37 >> Yeah, that's pretty funny.

37:41 >> It was.

37:42 >> Shall we wrap it up?

37:44 >> Let's.

37:44 >> Cool. So thanks everybody for coming and watching the show, and also everybody that listens.

37:50 We love all of you. Thanks Michael.

37:52 >> Indeed. Thank you everyone. Thank you Brian.

37:55 Yeah. See you next week.

Back to show page