Transcript #77: You Don't Have To Be a Workaholic To Win
Return to episode page view on github00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
00:04 This is episode 77, recorded May 12, 2018.
00:09 I'm Michael Kennedy.
00:10 And I'm Brian Otkin.
00:11 And we have a very special episode and a live audience.
00:14 That's right, we're recording live from PyCon.
00:20 Thank you everyone for being here and everyone who couldn't make it.
00:23 You missed a great party.
00:24 This episode is brought to you by Datadog.
00:26 They actually, I think they have a booth out there?
00:28 Yeah.
00:28 Yeah, I think they have a booth out there.
00:29 I've been stuck at my booth the whole time, which is wonderful, but I don't know what's out there.
00:33 So that's amazing.
00:34 We'll tell you more about them later.
00:36 Right now, Brian, what do you got for us?
00:37 I have a fun article that actually comes from the Java world, but it's why senior devs write dumb code.
00:44 And it starts out with a quote from Kent Beck, which I love, is any fool can write code that a computer can understand.
00:54 Good programmers write code that humans can understand.
00:59 Just some tips to make sure that you try to keep clean, straightforward, obvious code.
01:05 And follow principles like Yagni, single responsibility, dry, etc.
01:11 And I think this is important in the Python world because there are some cool language features that we have that are fun to play with.
01:20 And I definitely want people to go ahead and try all the cool new language features, but make sure that your code still is readable, even by people that aren't as Pythonic savvy as you are.
01:33 That's awesome.
01:35 Are you telling me that the shortest code is not the most readable, always?
01:38 Yes.
01:39 That's hard for me to do also because I really like one-liners that pack in a whole bunch of stuff.
01:47 Yeah, I do too.
01:48 So does that cover the solid principles, like single responsibility, open-close principle, or is it just more general, like write good code?
01:55 Well, I think may write readable code.
01:59 Readable code, right.
02:00 I don't necessarily adhere to solid being readable.
02:03 You know, that's a really good point.
02:05 So like solid principles, I don't know if you all know, it's single responsibility principle, open-close principle, list-cost substitution principle, etc.
02:12 And a lot of times that is like super design pattern heavy, and you're like, there's so much abstraction here.
02:18 Like, I know this looks like it came out of a textbook, but it's bad, right?
02:22 Yeah.
02:23 Yeah.
02:23 So actually, maybe not so much.
02:25 Well, and I've seen it in code reviews, too.
02:27 We've had people do like maybe a C-ism in Python.
02:34 And sometimes that's bad, but also sometimes if you can look, if it's a little bit of code and you can look at it, it's easy, obvious what it's doing.
02:41 Maybe it doesn't need to change to be more Pythonic.
02:44 Yeah.
02:45 It's probably fine.
02:45 That's true.
02:46 So, Brian, have you been having a hard time finding your way around here?
02:50 Yeah.
02:51 You got lost?
02:52 You guys having a bit of a hard time?
02:54 I feel like I've taken like a walk where it's like, okay, we've gone like a quarter mile, and there was a door to that place on the other side of the expo hall.
03:02 Why didn't I go that way, right?
03:03 Well, the next thing, if they had used it, I'm sure they haven't, if they'd used it, there's this thing called GeoAlchemy 2.
03:10 You've heard of SQLAlchemy, right?
03:11 Yeah.
03:12 So there's this thing you can layer upon SQLAlchemy called GeoAlchemy 2.
03:18 And what it does is it provides geospatial queries and operations on top of, say, Postgres.
03:25 So you can ask questions like, how far is it from here to there?
03:29 Like, am I within this room?
03:31 Like, you could easily define all these as polygons, insert them as SQLAlchemy objects, and ask questions like, who is in such and such room if we all say RFID?
03:40 And that would be easier to navigate, Python?
03:42 If we could throw some A-star algorithms to, like, say, find the shortest path through all the open doors and stuff, yeah, it'd be easier.
03:50 Anyone out there do any, like, geospatial queries, things like that?
03:56 Yeah?
03:57 Yeah, not that query so much, but we do some geospatial work, and so sometimes you need to, you know, give it an object, find it in Europe.
04:05 Nice.
04:05 Have you tried GeoAlchemy?
04:06 No, I haven't.
04:07 Actually, I wanted to ask.
04:08 Is that from the same people who bring SQLAlchemy?
04:11 I think it's a different group.
04:12 There was a thing called GeoAlchemy, and then you could use that, and this is like a reimagining of the API, so this is like a second edition.
04:23 So the way it works is basically, just like SQLAlchemy, you connect to your database, you declare mapping, you declare, like, the class that just arrives from, like, a SQLAlchemy base.
04:33 It has a name and an ID, but it can also have columns like a geometry, which is a polygon, and then about that, you can ask questions.
04:40 Like, you can go to it and just say session.query.filter where this thing contains this point, or where the area is greater than or less than such and such, and just all sorts of interesting questions.
04:51 So if you like SQLAlchemy, and you want to ask questions about physical stuff, boom, GeoAlchemy 2.
04:57 Nice.
04:58 Yeah.
04:59 Well, since we didn't share each other, we have no cool segue between everything.
05:07 Not too much, but I can see what you got here for this one.
05:10 Yeah.
05:10 Yeah, so we've been on a rant, haven't we?
05:13 A UI rant?
05:15 Yes, a little bit of UI in the podcast.
05:19 But one of the things that has come to our attention is Qt is not staying still.
05:24 So there's, what I'm talking about here is there's another PySide 2, which is going to be called, like...
05:36 Qt for Python?
05:38 Qt for Python.
05:39 But it's not quite ready yet, but there's actually a lot of Python bindings that I know of.
05:46 There's PySide 2, there's PyQt 5, there's PyQt 4, there's the original PySide, and there's a couple...
05:52 And then there's Qt.py.
05:54 And this is just for Qt, not WXPython, not all the other stuff, right?
05:58 Yeah, just for Qt.
05:59 And there's two projects.
06:05 Qt.py convert is a project that converts these interface bindings to an intermediate, which is a shim layer, which is Qt.py, which is a minimal...
06:18 You can build it as a minimal Python 2 and 3 shim around all of the Qt bindings.
06:22 And just sort of fun to be able to use one, whatever you've got now, and convert it back and forth.
06:31 I think it's a great idea.
06:33 So you...
06:34 It's going to be awesome that there are new, better ways to write Python UIs.
06:38 But there's all this other code that people have written, PyQt 4, for example.
06:43 And this thing will let you sort of run a converter across it to adapt from all these different older versions to the new hotness.
06:50 So it should make it work really well.
06:51 Yeah, and one of the neat things about this is it uses a conversion that leaves all your comments in place.
06:57 So it rewrites Python code, but it rewrites it.
07:02 It leaves a bunch of your stuff in there.
07:04 That's pretty advanced.
07:05 Yeah.
07:06 So maybe do like a branch or something before you do that.
07:09 Yeah, probably.
07:09 All right.
07:12 Anybody got a comment on Python UIs?
07:14 All right.
07:16 No.
07:16 All right.
07:18 Cool.
07:18 So I'm really excited for that.
07:20 I'm excited for Python for Qt coming.
07:22 I think that's going to be good.
07:23 There's a bunch of other stuff.
07:25 I think there needs to be more work done there, as I've said.
07:28 All right.
07:29 So let me tell all the listeners and you guys about our sponsor.
07:32 So Datadog, who are big supporters of the Python space.
07:35 They're here at the conference.
07:38 Obviously, they've been supporting the show for a long time.
07:39 So check out Datadog.
07:40 They're like a monitoring solution, mostly for your distributed application.
07:44 So if you've got like microservices and containers and all that, you can trace a request from one part to the next and the next and figure out where things are slow, where you run into errors, all sorts of stuff like that.
07:54 So get a cool Datadog t-shirt.
07:55 Go to pythonbytes.fm/Datadog.
07:57 Do the tutorial.
07:58 Get a cute dog shirt.
08:00 It's awesome.
08:00 All right.
08:02 So, Brian, we live in a pretty laid back city, Portland.
08:06 It's pretty chill, right?
08:08 Love it.
08:08 Yeah, I love it too, man.
08:10 But even in Portland, there is a bit of a sense of people are like working really hard and it's almost like a badge of honor.
08:16 Like, oh, man, how are you doing?
08:17 I'm so busy.
08:18 You wouldn't believe how busy I am.
08:20 I know you're busy, but I'm like way more busy.
08:21 I've got all these projects and I've got this stuff going on and that.
08:24 There's this great article written that is a reminder that you don't have to be a workaholic to get ahead in tech.
08:31 So the article is called You Don't Have to Be a Workaholic to Win 13 Alternative Ways to Stand Out.
08:37 And I really, really like this because I feel like there's two things going on that I don't like.
08:41 One is this is what I kind of opened with.
08:43 People like busy brag.
08:45 Like it's cool to them to be super busy.
08:47 Yeah.
08:48 And so they just tell you how busy they are and, you know, we just one up each other.
08:52 Yeah, I ran into this guy that's just like, yeah, I've got two podcasts.
08:55 I wrote a book.
08:56 Yeah.
08:56 That's not cool, man.
09:01 That's not cool.
09:01 And the other one is like actual tech companies or other companies that are like, you know what?
09:07 We're going to put just a fake deadline here six weeks out and make everybody work overtime so we can hit it.
09:12 And there's like, well, what happens if we don't hit it?
09:14 Well, then my manager will be upset.
09:16 Like that is not a real deadline, right?
09:18 Those are not actual deadlines.
09:20 And so there's just a bunch of great ideas in here.
09:22 So let me run by you.
09:23 See if you think.
09:24 Oh, by the way.
09:25 Yeah.
09:27 Let me just run through the tips.
09:28 Hold on.
09:29 This thing like popped up, Anthony.
09:32 All right.
09:34 So here's the tips.
09:35 The first one is like you can be a workaholic or you can be creative.
09:40 And if you really try to think differently about solutions, if you're the person that says, yeah, we could work all night and we could build this thing this way.
09:48 Or did you know you can pip install a thing that did this, right?
09:52 If you just like think outside of the box and try to solve a solution, like creativity could be more value than working hard.
09:57 Yeah?
09:57 Yeah.
10:00 Stubbornness.
10:00 Stubbornness is not generally considered a good thing.
10:02 But in programming, like I've had lots of people go, Michael, you're so good with computers.
10:07 You're such a good programmer.
10:08 How did you learn this?
10:08 It's like I tried this.
10:10 It was hard.
10:10 It didn't work.
10:11 I'm just like, well, I tried it for three hours and then it did work, right?
10:14 Like I tried everything I could think of until it worked and it just wasn't going to quit.
10:18 And that's one of the things they're talking about.
10:20 You have that experience?
10:21 So that's a way to work less?
10:23 No, that's not a way to work less.
10:25 But what they're saying is if you're the person that like can actually solve the problem because you don't give up on it rather than just like, ah, we can't do this thing.
10:33 We've got to do something else.
10:33 Okay.
10:34 You know, that kind of thing.
10:35 They're all like pretty interesting little takes.
10:37 Curiosity.
10:37 Yeah.
10:39 Right?
10:39 Like I'm willing to like be the person that learns Kubernetes and actually now we can all go home because
10:44 our deployments don't break and I don't even have a pager.
10:46 It's amazing.
10:46 Right?
10:47 That's cool.
10:47 Kindness.
10:49 I really like the kindness one.
10:50 Like if everyone is a jerk and you're the person that's nice and helps everyone, right?
10:54 Like all of a sudden you become the person in the office or the company and they're like, yeah, go talk to Jeff, man.
10:59 He will help you and he won't insult you at the same time.
11:02 Planning.
11:04 Planning is good.
11:05 Improvisation.
11:07 Like sort of the opposite of planning.
11:09 Like, well, things aren't going to accord in plan.
11:11 Let's fix it.
11:11 Enthusiasm.
11:12 Kind of like kindness.
11:14 Communication.
11:14 That's good.
11:16 Presence.
11:17 I really like that one.
11:17 Yes.
11:18 Right?
11:19 Like so many people are like, yeah, that's a great idea.
11:21 Yeah, I'm going to go work on my thing.
11:23 Right?
11:23 But just like take the time to like be in the moment.
11:26 That's actually hard.
11:27 It's hard.
11:28 I'm making fun of it, but it's hard.
11:29 And especially in a work environment, you've got – you're like in the middle of something.
11:33 Somebody comes over.
11:34 If you're going to be interrupted anyway, then really be interrupted and pay attention.
11:39 Yeah, exactly.
11:40 Yeah, yeah.
11:41 For sure.
11:41 So I'll keep going just a little bit more collaboration, right?
11:44 Open source.
11:44 Like we're all kind of in that space.
11:46 Anyway, willingness.
11:48 Honestly, I forget what that is about.
11:50 But I remember it was really good.
11:52 Patience also.
11:53 And then finally, institutional knowledge, right?
11:55 Like – Where to lock people up.
11:58 Yeah, where the bodies are buried.
11:59 No, like why do we have that old server over there?
12:03 And like can anybody work with it?
12:05 Yeah, actually, I know where the source code is and I could fix that for you, right?
12:08 Yeah.
12:08 I don't want to.
12:09 It's PHP.
12:09 But I could fix it if I had to.
12:11 Right.
12:12 Anyway, like so do these resonate with you guys?
12:15 Yeah.
12:16 It makes me think of, Brian, you had Stephanie.
12:18 I'm forgetting her last name.
12:20 Herbert.
12:20 Yeah.
12:21 Yeah.
12:21 And she talked about – I mean, your conversation over there was about mentoring, but she talked
12:26 about her worker approach and how she only works like four hours a day.
12:30 She goes around like data compression and consultancy.
12:34 But this also makes me think of a post I've seen from somebody who works with Starbucks'
12:40 web applications group.
12:42 And it talked about how they pretty much almost burned out of the tech industry.
12:46 And they just – that AI instituted some of these principles to just make things – obviously,
12:53 probably not only more productive at work, but just more sustainable for you long-term
12:57 on a personal basis.
12:58 Yeah.
12:59 That's great.
13:00 Yeah, absolutely.
13:00 All right.
13:04 So are we going back to World War I?
13:05 No, we're actually going back to QT.
13:08 Oh, okay.
13:08 So pretty much the trenches?
13:12 Yeah.
13:13 So actually, we – just related to that, when I was researching for the QT PyConvert, I was
13:21 curious as to how they did the conversion while leaving the code comments in place.
13:26 So I followed the rabbit hole.
13:28 And there's a project called Red Baron, which I hadn't heard of before.
13:32 But it calls itself a FST, which is a full syntax tree.
13:37 So it's a lossless abstract syntax tree thing, which you can do queries and modifications.
13:46 And I think it's – they've got a few uses that they list of possibly like renaming a variable in a source file and making sure that it doesn't clash with anything that's not a variable,
13:58 like not clashing with things and strings and other bits.
14:04 A few handful of like splitting up files.
14:07 There's other – I think this is sort of maybe a tool to build other tools with.
14:11 I can't imagine like – I personally wouldn't try to like write a script of like doing this.
14:19 But if I built it into an ID or something like that.
14:21 Yeah.
14:22 This sounds like this is like the foundation of a refactoring tool.
14:25 Yeah.
14:25 Pretty much.
14:26 That's awesome.
14:27 But there's no off-the-shelf thing that's going to do that.
14:33 But maybe something like this is like – Yeah.
14:34 That's really, really awesome.
14:35 But it's a fun project.
14:37 Michael, you joke about like the conversion of two to three, but that's exactly what two to three, the tool does.
14:44 Yeah.
14:45 No.
14:45 Yeah.
14:45 So like everyone here knows the AST module, I hope.
14:49 It's really cool.
14:49 And then I guess they call it a full syntax tree, but it's often more broadly I refer to it as a CST or concrete syntax tree.
14:56 Okay.
14:57 Nice.
14:57 And so that's what two to three is based on.
14:59 That's also what the new black code formatting tool that they're going to talk to us today is based on.
15:05 Right?
15:06 Because it has to maintain comments and all these things that otherwise go away with AST.
15:10 Right.
15:10 That's awesome.
15:11 Yeah.
15:11 Thanks for that.
15:11 Yeah.
15:12 Black is awesome.
15:12 We covered it before.
15:13 You've got to like the color.
15:15 All right.
15:18 So I want to close out the official items with something pretty cool here.
15:21 So our booth is right next to the Beware guys.
15:25 And the Beware guys are trying to fill another major hole that I see in the Python space, which is really around packaging and especially mobile.
15:33 Right?
15:34 Like they're trying to build native apps in Python.
15:38 And I've been a little bit of a – I've criticized them a little bit previously saying, you guys, there's like not really many demos.
15:44 There's not a lot of screenshots.
15:45 You've got to like show me where this stuff is if you expect people to use it.
15:48 Right?
15:49 Well, so one of the announcements this week is that Project Beware just launched an app in the Apple App Store.
15:55 Like a straight up approved by Apple, installed on your phone, and it does stuff.
15:59 It's not super advanced.
16:00 It's basically like gives you currency conversions and tip calculations.
16:04 Like how much do I need to tip in like RMB?
16:07 You know, things like that.
16:10 But it's really cool that there's an example of a Beware app in the App Store.
16:16 Yeah.
16:16 Yeah.
16:17 Is it up on the source code?
16:19 I'm sure that it is.
16:20 I haven't looked at the source code, but yeah, I'm sure that they've got it up there.
16:24 So the link I have, I think, either goes to an article or straight to the App Store.
16:29 And it's pretty cool.
16:30 So it uses Briefcase and Toga.
16:32 And Briefcase is a tool for converting a Python project into a standalone native app on Mac, Windows, Linux, iPad, iPhone, Android, Apple TV, and tvOS.
16:42 Actually, are those different?
16:45 Anyway, yeah.
16:46 Apple TV and tvOS.
16:47 Awesome.
16:47 So it's pretty cool.
16:48 So it's like a first step.
16:51 I was talking to Keith Russell McGee about it, and he's pretty excited, but it's just the first step.
16:57 But if you guys are looking to contribute to open source, they're really, really big at accepting new folks.
17:04 They're a really great project for that.
17:05 And you get a token.
17:07 And you get a cool token, like a token to say I contributed to the Beware project.
17:12 Yeah.
17:13 I was actually talking with Ken.
17:15 Russell.
17:16 Yeah.
17:18 And he was one of the things that I, one of the parts of their system is Cricket, which is a testing GUI.
17:27 And it doesn't handle pytest, but that's one of the things they'd like to have somebody work on is to try to convert.
17:34 Oh, are you going to add pytest to Cricket?
17:35 I'll look into it, but I'm bringing this up now to recruit anybody else that wants to help out with that.
17:42 Because I would definitely try it out more if it already had a pytest link.
17:47 Yeah, that's awesome.
17:48 Yeah, you gave your talk on visual testing with PyCharm, which is awesome.
17:55 And it's going to be on one something I'm going to mention in a second.
17:57 But that's sort of another analogous thing, right?
18:01 Like a GUI for running your tests and your project.
18:03 Yeah.
18:03 So we use PyCharm for the test runner part.
18:07 But this would be just a standalone test runner without an IDE.
18:10 Yeah, exactly.
18:10 No editing, just the running.
18:11 Yeah.
18:12 Right.
18:12 It's easier to fix a test if you don't have to edit it.
18:14 All right.
18:16 Well, I think that's it for all of our items that we have for you guys this week.
18:19 I have a few extra things I want to throw out.
18:21 Actually, this one more and more to the listeners.
18:23 So first of all, all the videos, except for things like this, are recorded and put online.
18:30 So already the videos from PyCon 2018 are live, and people can check them out, right?
18:36 There's some.
18:37 Yeah, not all of them, but they're coming in.
18:38 There's a day or two latency there.
18:40 That's pretty good, though, for video.
18:41 So just go to youtube.com slash PyCon 2018.
18:45 The other one is not so good.
18:48 Apparently, there was some package that caused some trouble.
18:50 Like previously, remember we talked about there being bad packages getting into the PyPI?
18:57 So there's some Reddit post that says, Hey, guys, you should be a little bit careful with the SSH-decorator package.
19:06 And it says, Don't install it or use it from PIP.
19:11 It has a backdoor to steal all your SSH credentials.
19:13 Oh.
19:14 And if that's true, you should not have this running anymore, and you should uninstall it.
19:20 I don't know, but the people say the compromise package has been taken out.
19:25 They reached out to the developers, and initially there was no response, but apparently it's gone now.
19:30 So you can't update it.
19:33 But if you already have it, you should not have it anymore.
19:35 So just like a sort of PSA, public service announcement, don't use that.
19:39 Yeah.
19:40 Yeah.
19:41 So anything else you want to add, Brian?
19:43 No, I'm just having a great time at PyCon.
19:45 Yeah, PyCon.
19:46 PyCon is awesome.
19:48 I call this my geek holiday.
19:51 I try to refrain telling my wife that because she's like, you just got back from geek holiday.
19:56 I'm like, no, I'm really actually tired.
19:57 I need to rest.
19:58 No, you need to take the kids and do this and do that.
19:59 It's all right.
20:00 But yeah, I really love coming here, and I really look forward to meeting everybody and having these experiences.
20:05 It's exhausting.
20:07 It's exhausting in an amazing way.
20:08 Talk with nerd stuff all day long and then go out and have dinner and drinks with nerds also.
20:13 I know.
20:13 I had to have cocktails yesterday.
20:15 It was really hard.
20:16 All right.
20:19 So how about everyone in the audience, you guys want to just close it out, say goodbye from PyCon?
20:25 Goodbye.
20:26 Goodbye, PyCon.
20:28 Thank you, everyone, for listening.
20:29 Thank you for being here for this live recording.
20:31 Thank you for listening to Python Bytes.
20:41 Follow the show on Twitter via at Python Bytes.
20:43 That's Python Bytes as in B-Y-T-E-S.
20:46 And get the full show notes at pythonbytes.fm.
20:49 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.
20:54 We're always on the lookout for sharing something cool.
20:56 On behalf of myself and Brian Okken, this is Michael Kennedy.
21:00 Thank you for listening and sharing this podcast with your friends and colleagues.