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


« Return to show page

Transcript for Episode #201:
Understand git by rebuilding it in Python

Recorded on Thursday, Sep 24, 2020.

00:00 Hello, and welcome to Python bytes where we deliver Python news and headlines directly to your earbuds. This is Episode 201. Recorded September 24. I'm Michael Kennedy. And Brian is not here this week instead, my friend his special guests sessile. Philip, welcome sessile Hey, Hey, everybody. I'm have been a long, like fan of the show. And so, you know, Brian, I'm sorry that you're not here. But I'll promise I'm gonna do a good job. And do you justice? So I'm going to do my best Brian impressions today.

00:27 Beautiful, beautiful. So sessile, you've been on the show before? You're a developer advocate at Microsoft. Is that right? Yep. Yep, still Developer Advocate. And as far as I could imagine, we're all at home and not traveling as much as we used to anymore, which, you know, is usually something that's attached to the job. But now we're just trying to find different ways to kind of reach out to the community and work with folks and make sure that they have what they need to, you know, just be successful and productive. Yeah, absolutely. And you're doing a lot of live streaming stuff these days, rather than appearing in conferences. Yeah, we do a lot of live streaming a lot of live events. And even you know, live conferences, too. I think a lot of conferences now. And you've seen this a lot as well with the pipe with pay con and tons of the other tons of other online conferences, just because we can't do it physically together, like we used to, you know, not a lot of folks just doing an online. So no show, if you'd look online, you see tons of, you know, register for free. Here's my conference on Tuesday and Wednesday and Thursday. And you know, everyone's just trying to find a way to connect. Yeah, it's got some interesting implications for accessibility, right. Like, I couldn't necessarily go to euro, Python, but I could attend the virtual one just as easily, as long as I'm willing to get up a bit early. That's kind of cool. Actually, yeah, that's one of the things I like about it the most, is that, kinda like what you said, like before, I didn't want to go buy a plane ticket to go to Australia, or, you know, somewhere that's maybe halfway around the world. So me, but now I can have maybe not the same experience. But I could still engage with that community of folks, virtually by just signing into their YouTube or their twitch stream, or whatever the case is. And I can get the content the same way. And it's great. Yeah, absolutely. So let me kick this off with our first item where we go from Python to speak another language, a little different cultural here. So we're going to talk about talking from Python to c++, maybe not what you thought when I said that, but really, c++ is one of these or C, really, the more low level is one of the reasons I think Python is doing as well as it is these days, right? Like a lot of what you do in Python might be a little bit slow. But you know what? you implement part of that package and see, and then all of a sudden, it's a lot faster than things you might compare it to. And that's a lot of the magic, a lot of the data science works that way and whatnot. Right? Right. Yeah. So there's this article that I'd like to point folks to that basically walks you through what it's like to call C and c++ code from Python. So there's a lot of things to cover that it's pretty interesting. And it talks about it first, what do you get, when you compile C, obviously, you get something that's executable, what it is, is actually different depending on the machine you're on, right. So if you're on Linux, you'll get an executable and linked format, which have Elf on Windows, you get a portable executable. On Mac OS, you'll get a mock object, a mock dot O, and so on. So it compiles to whatever machine instructions you need. And then, depending on what platform you're on, again, you can put that in some central location. So that compiled C library can be used by Python. So on Linux, it'd be user slash lib. On Windows, what do you think? windows slash system system? 32, something like that. This is 32, or something crazy like that? Yeah, yeah, exactly something there. But once you put it there, then your program can find it. And you can just import it. There's different ways you can do this, right? Like, you can use the C types library, which is simple, or sometimes simple. And you can just go and import c types, and then just say, here's a C DLL and point literally at the file the output from compiling some C code, and import it and call it. That's pretty simple. Coming from Microsoft formators, DLL import type of equivalent. That's what I'm not entirely sure. But there's some interesting things that you run into, like you get this library back. But it doesn't necessarily know what the return types are, right? Like, you get a function you call it returns a float, maybe it doesn't know what to do with that. So you've got to like, as you import it, tell it Oh, you return a float here. And here are your functions that you can call and so on. So there's a lot of interesting things you can do. If you remember your C, you have to set the calling convention, which can be really tricky, like extern C, Oh, my gosh, our standard call. Is it c deckle. I mean, there's so many variations. Do you remember? Like, did you ever do some C and just go Why won't this library work with that other one? I know now, like I'm looking through this document as you're talking about it, and I'm like, Oh my gosh, this is bringing back so many memories. Oh, yeah. I mean, you remember like how hard these things were they to get them right and it

05:00 reminds you how nice it is to work with like more modern languages like Python. So there's actually an interesting library called lib, FF i, this is a C library. So if you're going to write the C code, you can use lib ffvi. And when you compile it, as you compile it for different platforms and stuff, it'll automatically figure out the calling convention for the functions at runtime. Oh, nice. So, so that's pretty sweet. So you can I mean, this didn't exist, to my knowledge when I was trying to do these things. That's interesting. Another thing you can do is you can add an entry point function to your code. And then Python will ask, basically can call that and say you'll what functions do you have? And what are their signature? So there's a way to have your library kind of introduce itself over this kind of like providing metadata, I'm guessing. Yeah, exactly. Yeah, here's the structure of my stuff. And I'm going to give it to you. And now you kind of understand it exactly. Because you don't have a header file or anything like that. That defines it's just here's the executable compiled functions go, right. And so it gives you that metadata Exactly. Of course, you find you, the goal is to have c++ code that you can call from Python. And there's a Python specific, a Python friendly way to do this as well, if you're willing to work with a Python type, so like pi, object, pointers, and so on. And the way you would do that is you create this entry point, but it's the function name is pi init, underscore module name. So if it was requested, be pi in it, underscore or, exactly. And so that returns all this metadata that says, here's all the C stuff, and the signatures and whatnot, to have to go and do all this stuff. How you write the C code, you do it, it says, You know what, maybe just want to skip that. Yeah. And can we please What can we lose? Yeah, so what you could do is, you could write it in scythe on it, which compiles to C, which compiles to machine instructions, or there's also boost dot Python. I wasn't aware boost up Python. That's pretty cool. And pi bind 11, which allows you to bind I believe, to c++ 11. Which is probabilistic? Well, yeah, so really nice integration stuff there. And some examples of libraries that people might know of that are written in scythe on. But basically come natively compiled and do awesome stuff is a IO HTTP? Oh, I didn't know that. That's cool. Yeah, yeah, he's a scythe on for the HTTP parsing. So that string stuff is super fast. If you do async younkin, one of the thing that's interesting in Python about pythons async await, in a way is you can change the implementation of the underlying of the event loop, right. And so one way you can do that, as you can replace it with UV loop, which is based on libuv, which I always thought of as a C library. But it's actually fully written in scythe on Oh, I didn't know that either. Really, that's pretty cool. And then finally, HTTP tools bindings to node HTTP node j. s, HTTP parser is fully written in Python, along with Sanic, UV core and a bunch of other stuff that use this library. So if your goal is to try to get a little bit lower level, maybe work with some C, make your code go faster. Here's a really cool write up of how to do all those things. That's really cool. You know, I'm a big fan of language interoperability in general. Yeah, and no, one thing I could tell you, it feels like every language knows how to work with C, at least, like see, like the common denominator to every language knows how to, like talk back to. And I really wish there was a way for us to I mean, I love C, I used to love C. But I really wish there was a way for us to like, have like a very standard way to like, interact with each other a little bit better. And I remember, I think the last time that I was on the podcast, I talked about Waze, so I think it was webassembly. Yes, it's like a webassembly module that you could use. And now all of your code compiles down to webassembly. And it exposes different functions and whatnot. But now that that'll be like a portable runtime, but essentially, I can I can import it in Python, and I can import it in Java, or JavaScript, or dotnet, or whatever the case is, because they all have that, you know, that knowledge of how to work with that webassembly binary, right? That portable, webassembly thing? Yeah, I should look that up. I don't know where they are with that. But I know that was the thing that folks were getting really excited about, not just from the fact of, Hey, I could run my Python code or my language x code in the browser, but also to I can consume it from other languages. That would make it right, if somehow you can package your code in whatever language you use in a web assembly format, all of a sudden, it becomes interoperable with other web assembly libraries, anything else that can be packaged into web assembly, basically. Right, right. And what's what's good about that is it's relatively a standards compliant way where because web assembly is a standards based thing, it's not owned by a company or one particular runtime. All of us run and play in the web and use browsers and use browser technologies for one thing or the other. So it's definitely something that everyone can kind of get

10:00 Get involved in one way. Yeah, for sure. I'm super excited about that as well. All right, moving on to the next one, your topic here, you've got something very small. That's actually quite cool. Yeah. And so just kind of talking about interoperability a little bit. One of the things that we all use a lot as developers is git, right? Like I use Git a lot, and particularly in the GitHub space. I actually, I don't think I know a developer today that does not have a GitHub account. But you know, maybe you remember when people used to debate about what kind of version control they use, like, Oh, we use Perforce. Oh, we use subversion. We're still on CVS, we use a winsy. I use tortoise, you CVS and I got a right click. That used to be a debater, that debate is gone. It seems like I remember man, I remember there was a debate back when good first started. So there was a debate between Git and Mercurial, because those are the two distributed version control systems. And people were like, Oh, I'm going to use this one. I'm going to use that one and trying to figure out like, which one that was going to be the thing to use. But I think it's pretty safe to say that GitHub have won. Yeah, pretty much. Yeah, you know, get up to Yeah, get up. Awesome. Yeah, I think they've pretty much just won. So now, this article, why I think this is really interesting is, you know, as a developer, since we, again, Git is pretty much like the standard of source control for all of our projects, it's important for us to understand how Git works, or maybe might be curious about what the underlying internals of that looks like. And so what this is, is a really cool tutorial is interactive tutorial that you could do kind of in your browser as well, where you could play around and implement, get yourself your own version of Git in Python. And I'm like, Oh, that sounds cool. Like, I definitely want to do that. Because one, I think, Hey, you just give me another project that I could get better at writing Python, but too, I can also really try and understand what Git does. I know a lot of folks, you may know, a few Git commands, but man, like, I really don't understand what rebase does. And I don't know, what's the difference between git branch and get switched, and you know, like, some of those types of things. And so I'm hoping like, we could go through this tutorial. And by implementing it, we could really understand like, how the underlying data structures are different and how that Git databases differ. That's so interesting. And thinking about understanding Git by re implementing it from scratch is pretty interesting. Yeah. And I think it's worth pointing out just the format of this article tutorial thing, it's, it's quite unique. So if you open it up, on the left hand, the browser split 5050, the left hand column is the description and no message. And on the right, it's basically got a diff of the code that you're writing and each step, so it's doesn't look like you can execute or anything, but it's a little bit like repple, ID or something like that. Yeah, I'm looking at this. And I think I was trying to see if you could click on this thing, if it'll take you to the source. But I think this is, in addition to just be a really cool topic. I think it's Oh, he does as you click around it, it'll it'll reload the site to like, take you to different parts in the code. Yeah. Oh, does it? Okay. Yeah, yeah. So there we go. There you go there, it doesn't. But I think there's a really interesting experience just for learning in general, right. It's very interactive. So I could read the text, the verbiage on the left hand side, and I could look at the code, and I can see how it changes on the right side. So it's not just like, Hey, I'm just reading the super complex book about like Git internals, I can actually see the code which, you know, for folks that like to learn by seeing is a really good experience to be able to understand, like, what exactly is going on? I might actually go to this, this looks really interesting. And I might learn a couple of things by doing it for sure. Yeah, this definitely looks really cool. But no speaking in terms about learning, like you had a topic you want to talk about, right? That has to do by learning, right? I would say you and I, probably these days, we qualify as senior software engineers, I didn't. So I don't really want that title on me anymore. Because I don't know sounds like I go to an office. That's my title. But nonetheless, we've been around software for a while, right. And there's this cool article by Neil Carr, who wrote it is an in depth write about things I learned to become a senior software engineer. I love these things where people sort of look back on what they've done in their career, how it's, you know, what went right, what went wrong and trying to help other people short, shorten that cycle, to get farther, faster, quicker, that kind of thing. So there's a lot of lessons he talked about. I just wanted to cover some of them said it's really long. And so I'm not sure I want to go into all of it there. But so the first one was, he advanced his career by rolling his skills and experience using different ladders of abstraction. That's how I put it in. So it looks for the first year or so he had basically learned the ins and outs of software, like he knew his language, its compiler was working, and I believe it's doing Python, so maybe not as compiler. But all this stuff that he's doing to work there is pretty much figured out the software side of things. But his software development lifecycle, it was like a small cog within a bigger cog, and so on. So he said, Look, there's really the the lifecycle

15:00 Have the product, there's a lifecycle of the infrastructure and the business and like working your way, and sort of out of that loop to understand the bigger pieces really helped him do more than just like write code, but like really be a bigger part of the team. I guess this is really interesting. And I'm kind of scrolling through the article, again, as you're talking about it. And it brings up to mind like a discussion that I get a lot from some of the students that we talk to, you know, with the different engagements we do. And that's always their question. It's either one, how do I become a good software developer? Or how do I level up in my career? Like, what are the things that I need to do to step forward in my career? And sometimes I feel, there's certain things that for sure, you could definitely do. But then I think that's only like 50% of it. And I think there's another 50% that's could be a little subjective, based on the area that you're in, and the region that you're in, and, like, what are the things that you really want to do? Like, what are the things that you really care about? Like I could tell you when I first started, honestly, I was just, I was just trying to get a job.

16:05 I wanted to leave school, I wanted to work. Because being an international student, then I had to worry about like, visas, and, you know, green cards and all that type of stuff. And I'm like, the first person that hires me, I've gone like, that's it. Right. But obviously, that's not something you base your longevity on. When you think about a career, right? You want to think about, okay, now I'm working. And you know, I maybe I've spent the year or a year or two inside of the environment, you know, you know, you know how to code you know, how your deployments go, you understand your ticketing system and all the scrum meetings that you have to sit in on. But now you got to understand, well, well, how do I get better? And one of the things I always tell folks is, well, it's kind of like being a specialist, right? Like, what are the things that you want to get better at? Because there's so many different things to look at? What are some of the key things that really interests you? So do I want to be really good at doing security? Do I want to be really good at doing performance? Do I really want to get good at maybe microservices and distributed systems is interesting thing. Right? Right. You get pigeonholed. And people will just leave you there if you don't try to stretch, right? But you have to want that though, right? Like you have to want to get better. And then after you have that one, you got to figure out where exactly do you want to go? And then for me, then the next step after that is really trying to understand, well, what are the fundamental pieces that I need to understand? Like, what are the fundamental algorithms and data structures I need to understand and I'm not talking about like link lists and bubble sorts, and that type of stuff. But like within that space, right, like so in when we talk about security, like one of the things I need to know about cryptography, right? When I talk about like distributed systems, what do I need to know about networking and how networks work? You know what I mean? Like, how do I get the knowledge to understand that, so now I could continue to move forward, and really become, like, very knowledgeable and successful in that particular aspect of software development? Yeah, I think that's a really big part of it. And that's definitely some of the stuff they are touching on. I think one of the big levers you have to pull is to try to get yourself to do stuff that is uncomfortable, right? Like I don't really know about continuous deployment, but we don't have a great answer for that. So I'm going to force myself to learn that and I'll volunteer to be the person to make that happen, even though I'm not totally there yet. Right. But that'll get you there. If you take the steps. Another one that Neil pointed out, was learning what people around him are doing. So not just for the developers team, but we're the project managers, the sales people, the analysts, and so on, you know, for you working in a company like Microsoft, there's layers and layers and layers of that, right. Yeah, for sure. And, you know, there's there's good and bad things to that. One of the good things I like about that is that there's always people that you could ask a question to. And sometimes you might be an environment, that that's not really the case, sometimes you're in a company, and everyone is at the same level that you are, yeah, you can't talk to other people, at least. Or maybe you don't have access to talk to other people. But when you need an environment that there's a lot of folks that you can ask questions to, one of the best things that you could do for your career is make sure that you spend time with them, however, that works to really understand like, how does their world kind of move, particularly with some that you're interested in. So again, like, Hey, I don't know a lot about security, and I have a security feature I need to work on. And it's something I really want to dive deep into, let me go and find the pm that does security for this thing. Or let me go and find the person that works under Docker integration for this thing, or the Python integration for this thing, and really have like, a deep conversation with them. And the good part about it, if that person is willing to sit down with you and give you the time, that is like gold, like it is the best thing ever, to be able to have someone pass on knowledge to you. I say that too, because we move forward. And as we become quote unquote, senior engineers, we have to remember to that the folks that are coming that are not so senior, they're gonna want to do the same thing for us, right? And we have to have that mindset of being willing to share that information. Not try and keep it inside and take it with us when we leave the company kind of thing.

20:00 Yeah, well, the other flip side is, you know, the best way to learn something is to teach it often. And that's your opportunity. Yeah, yeah, exactly. Exactly. Another interesting lesson was strategies for making the day to day more efficient, which I suppose the larger the company, the more important this can be. And Neil said, some good habits notice was never leave a meeting without making a decision or having a next action to do. Meetings drive me crazy. And it's so often you just have a medium because we always been on Mondays for half an hour, even if we don't have to, like, no brains not again, decide who's getting the thing done. Because if no, it's not, on, you know, somebody's responsibility to get it done, it's probably not getting done. And then document design decisions made during the project. So that was pretty cool. Those are good ones. Yeah, acquiring new tools for thought and mental models. So one example in the software space would be like, was recently struggling with the domain of a lot of complex business logic, and all these weird edge cases and stuff. And so I found the domain driven design book by Eric Evans, and that whole space and said, oh, there's a whole world over here around like modeling objects and relationships that I didn't understand, or didn't know about and dive into that stuff's pretty interesting. Here's my favorite. And this has driven me crazy about so many different things. Protect your Slack, though, not your Slack, the knockdown competitor, not your channel. But slack as in, I've got a little bit of time in my day to day schedule, that is not clearly assigned, right? Not like, I'm spending the next two hours on this feature, because I agreed to it in the sprint. And then I'm done. And I have to move on to the very next thing, right? If it's so tightly packed, that you don't have the

21:49 the freedom to explore, like, that didn't quite work the way I expected it. Let me dig into that, or what if we reimplemented it this way, let me just try that idea. Or I don't know anything about domain driven design. So let me learn. Let me spend the next hour reading about that. And see if that'll help us later. Right. If all those opportunities are taken away, and Your time's like squished just back to back to back, you end up just doing 20 years of the same thing, instead of actually growing and learning new stuff. I'm a big fan of companies that allow their employees developers are not time to sit down and experiment and try out new things. And, and whatever. You know, prior to coming to Microsoft that was in a company that they used to have, like, every time there's a release, right after the release, they had this thing. Oh, man, what was it called? I don't remember what it was called. But there was it wasn't like in events, it was like a whole company event. Where for like the next week, all they could do was just work on side projects. Like it was a whole week. Right? Wow. Obviously, the service folks had to be on service. But for everyone else, like the PMS, the engineers, the developers, you know, they spent this entire week just hacking on stuff. And then the next week, you know, there was a day where they gave presentations, and everyone talks about what they did. And it was a whole showcase. But it was only internal it was just for the folks inside of the company. And not only did you have time to do that, and learn and try new things out. But you know, there were prizes, right? They were whether it was stock or money or like just you know, there was stuff that you got, wow. Which was really cool. So now it shows like how much the company like really believes in you. And so again, I bring it up, because I think it's an important one, not only do you give your employees, if anyone is an employer that's listening, and you give your employers employees the ability and space to learn, but also incentivize them to do it. Right? Like really encourage them and let them know that you're supporting it, regardless of whether that means it's something that's going to go in your product or not. Like the fact is like they're becoming better, right. And so if you all of your employees are becoming better like that means that they're going to be able to do better work for you at the end of the day. And so I think that's always a really cool thing to do. Yeah, absolutely. I think this concept of slack is super important and so much, people looking from the outside, they try to squash it and compress people's time down. And I think it's in the end, it's not so good. So there's a ton of other stuff I wanted to throw out really quick, one last thing. Take a time, so we don't spend too much time on this. The last was this idea of building up superpowers. So are you getting into the source code of some project, some package and the documentation isn't enough? All right, you have a quest that's to go read the open source code and spend some time like learning from the code, not from the docs, you want to quickly build a mental model for code, you're looking at reading open source code, again, I'm embracing fear. You're something you're not competent or feeling comfortable with. Do it as a side project. That's your quest, confidence to express ignorance or not knowing like, fine, right? Just we all got to ask questions. We don't get over it and think you practice with that. There's just a lot of good takeaways from hearing like we really just scratched the surface on it. Sure. And kind of going back to that point about reading the open source code. I think that's one of the reasons to why GitHub is so popular because it made searching source.

21:49 It's so easy. And I'm not gonna lie, there's a lot of times throughout my day that I'm thinking, hey, the documentation is not the best for whatever it is that I'm looking at. I'm going to search for like the class or the method, I literally just look for the class name and the method and filter by language. Just to see, I just want to see how other people using it. And, you know, what are the types of issues that are created around it? And hey, should I wrap this in a try catcher, you know, like, what kind of parameters Do you pass in? Like, how do you deal with these things? And being able to kind of look and see how other folks do it gives you some ideas now? Okay, well, this is how this thing was meant to us. Now, the flip side of that is that, you know, you might run into a bad example. But again, that's a learning experience, right? Like you're running, and you'll figure out, and then, you know, we'll work it out. Yeah, exactly. Yeah, that's great. So speaking of learning, you guys have a pretty cool project, a data source, I guess, to learn from, or context to learn from, oh, yeah. So what's happened over the past over months, and months and months. So Microsoft actually started a project where they're working along with NASA to create these learning modules on Microsoft learn, where you can kind of go in and learn how to do like machine learning with Python. But you could do it within the context of exploring space, which is really cool. So you can do different things like classifying space rocks, and predicting whether they'll help you like predicts, you know, rocket launch delays based on the weather, like tons of great stuff. And so there's a, I'm trying to think about how many are there, there's a 123. Yeah, there's at least six learning modules, again, all based on Python and AI, with machine learning, and NASA, we can kind of kind of go in and learn all these different things. So definitely recommend that folks go and check it out. It's 100%. Free. So you could, you know, just click on the link and kind of go through them yourself. You don't have to sign up for anything, which I love. Like, I love free learning resources. Right? But um, yeah, I thought this was really cool. Um, so if anyone's a space buff at all, like this would be a great adventure for you to kind of go through and kind of play around with some some data from NASA. Yeah.

21:49 space. Yeah. And so much of being successful, especially when you're learning early, is about having context that inspires you. Yeah, cuz we all get stuck or things get frustrated, you're like, Why won't it? Why is this function not doing what it's supposed to do? But if you're like, if I get it to work, I get it. I understand the space rock or something like that, all of a sudden, it's like, yeah, that's not so frustrated. Right, right. And I think NASA also has for folks that want to get a little bit more into NASA. NASA also has like, I think it's called NASA socials, which is like a national social club where you could, again, work along with other folks in a community back before a social distancing, you could actually go to a social events, and you're just learning different things about the work that they're doing with NASA. So that's also really cool, too. I think you could do those social events online. So if you're interested, probably like a maybe you learn a little bit and doing some of these courses, and you want to engage with other like minded folks that are into space exploration, but they don't necessarily work at NASA. You know, that might be another thing to definitely check out. Yeah, absolutely. The next one I want to cover has to do with performance. And I don't know if you've ever had this experience, but I definitely had it where the code is going slower than I expect. And I'm like, Oh, it's got to be this part of the code that is so slow. Yeah. And then I profile it, or I tried to fix it. It is absolutely not has nothing to do with it. That's like 5% it's somewhere else. It's completely somewhere else. Have you had this experience? Yeah. And you know, what happens? It's always a database.

21:49 Have you heard that? Oh, indexes? Yeah, people always say that. There's like, Oh, you have a you have a secret, you have a performance problem. It's always the database. I know. It's not always the database. But I totally get what you're saying. There's definitely cases where because you Who else would know your code better than you would? And so if you're thinking, Oh, man, if this is where the problem is, this has to be worse. Yeah. Well, we just have such a often we have a bad conceptualization of what is fast? And what is slow? Yeah, I don't know, computers are so fast. It's a little bit crazy. But profiling is usually the first step to figuring out what that answer is. And then if you're gonna change it, you can see to make it better, to get worse, where to get better and worse, and so on. So if you're doing Django, I want to talk about profiling requests there, because there's a couple of interesting options. So there's one library that will let you plug in basically c profile, which is the low level c profiler from Python that ships with it right into your request. So if you plug it in, you can just do a basic question or an ampersand prof a question mark prof at the end of the URL, and you'll get a profiling output. Oh, nice. It's pretty cool. So there's a thing called Django dash c profile dash middleware, you just install that. And then if it's installed, you can put basically prof in the query string, and you'll get that which is great. And that gives you an output there. Or you can put in percent download, it'll download, you can visualize it graphically with snake fizz. So that's even better. So you get like this download profiling report for your request. All that's pretty good. But what

21:49 would be a lot better is to be able to like visually dive in to the request and do things like understand talking about the database being slow like understanding, like the time you're spending in the database versus other places. There, there's this thing called Django silka. And you also add that as a middleware, but then it keeps track of all the requests on your site. Hopefully, you're doing this in development, not production. You keep track of all of those. And then it'll show you like, this is the general time for this URL, click on it, it'll show you things like these are the database queries that were run? Actually, as sequel even though using RM, it'll show you the sequel that was run, and it'll show you how much time the database is spending, how much time other parts of your code are spending. So yeah, really cool way to explore the performance from like, all the tiers of your single app. Yeah, that's really cool. And I always find database interceptors to be a really powerful concept like across all languages, right? Like being able to see like, like, let's say, I'm using SQL alchemy, or I'm using, you know, Mongo engine or something like that. Or like, I'd really want to know, what's the query that I'm sending over? Like, was it like I'm asking for, and versus what I wrote in code, right? And what am I actually getting back, and being able to see, oh, man, like, this thing is doing like, four or five joins, like, I don't need to do that. Like I could try and optimize this query a little bit more to one making more performance from a database perspective. And to obviously passing on that that performance over to my application. Or I thought I did one database request. Why are there 51? Right, right, exactly. That lazy property that that we forgot about every single time to that loop for hitting the database again, like such a bad idea. Maybe we should do a sub join, like eager, eager load sort of thing? Yeah, for sure. Yeah. Yeah. So I think this is really nice. Yeah, yeah, it is really nice. And it's this is one of the scenarios to where I think it's interesting to get like a log collector. So you know, there's tons of services that do this, but like something like data dog or roll bar or something like that, that not only capture your logs, but allow you to kind of go in and search through them search and filter your logs. So you could say, Okay, well, hey, I'm having performance problems. But it only happens at two o'clock in the afternoon, for some reason, or, you know, my memory always spikes within these hours of the day, and being able to have a history of logs and be able to query them, and then get that rich information and in a way that you plot it or turn into reports or something like that. Being able to do that, I think is hugely important. Yeah, absolutely. I totally agree. And be able to visualize it, right. So often having the picture is what you need. Sometimes, though, it's good to just get a text. Yeah.

21:49 That's true. Sometimes it's good to just get a message or get like an alert. Hey, Michael, the website is going down, you need to get here ASAP. Exactly. So that kind of leads into the next one. That was a good segue. I like that. Thank you. So that can leads into the next topic I did want to talk about at the time that we're recording this this week is actually Microsoft Ignite, which is, you know, are one of the conferences that we do and it's all online, we announced products and tons of stuff like that. Well, last time that we got to actually see each other in person and hang out a little bit was that Microsoft Ignite in Florida, and I was blown away at how ginormous that conference is like you were on top of my thumb then. And by the way, right? That's 30,000 people. So I guess it's 30,000 video streams now.

21:49 Yeah, I remember that last time. We were all together. It was in Orlando. And Dan Bader was there I remember. Yes. Right. Yeah. upcoming episodes with Dan. I don't even know what the numbers are this year. That'd be interesting to find out. I should look that up. Yeah, for sure. If you'd like what those numbers kind of seemed like, so it's been a year and you guys have a new announcement? Yes, it's been a year. And so it is a new service. And so this is Azure communication services, which is cool one because you know, we have a new service, but to like, I had no idea this was coming out I kind of funnel like everyone else did on social media. So this is Azure communication services. And essentially, it's a way for you to add, well, communication services, the application. So it does a lot of cool things like it does voice does video, it does text messaging, and you can obviously receive and send phone calls and things like that, which is really cool. But what's even better about this more specifically for the folks of this show, is that there's a Python SDK on day one, I guess we could call it Day Zero, since it's not officially out yet. But, you know, on today, you know, in preview while the service is in preview, there's a Python SDK is a JavaScript SDK. And there's also a dotnet SDK. And I looked at the code for the Python SDK. And there, I almost want to say like, there's nothing there. I mean, obviously, there's something there, right. But most of the code is like, create a directory, create a virtual environment that install Pip, SMS client that send message I'm like, wait, that's it.

21:49 Yeah, it's like literally, the meaningful bed is like five lines of code. Right, exactly. And so it looks, it looks like a really easy thing to kind of get started with. And so I haven't played with it yet. Again, I just literally discovered this yesterday, kind of like everyone else did. So I'm really interested into plugging it into some of my demos and seeing like, what the experiences were like.

21:49 Yeah, this looks really cool. I forgot to send if you want to add text integration like text alerts to your app seems like a really good choice, right. And so then we could plug in, imagine if we could plug that into the the Django profiler. And as things are happening, it sends us text messages, alerts. And so now we can Oh, there's a problem with the website. No, that's right. It's running slow. memories. You Hi. Check it out. Yeah, that's awesome. Nice when people could check that out? I guess that's it for our items for the week. quick shout out, I just say I was on you mentioned and beta is unreal, pythons podcast, with Christopher, the host there last week. So I'll be sure to link to that. It was really fun. Look back on the trends and stuff I've seen over the last five years of podcasting in the Python space. So if you don't hear about that chat, follow up on that show. And then how about you anything else you want to share? One of the things that our team does is they work with students from different universities across the world. And Neil did join a program that we have that's called the Microsoft student ambassador program. Now, if you're familiar with like, Microsoft MVP, or Docker captains, or what is it called GDS, Google Developer experts, is something very similar to that. But it's just this time, we're talking about students, right. And so you know, these are students that are going out. And they're creating content and doing sessions and workshops, and, you know, writing blog posts and different types of things within their school within their communities. And so, you know, we have them join, you know, this program where we're able to support them a little more, and give them Azure credits and Visual Studio things and LinkedIn learning things and dump some private events. Yeah, yeah, they have little private events and mentorship sessions and things like that. But you know, it's a really great way for us to kind of engage with the students, right? And really just understand, like, what are they doing? What do they care about? What are some of the ways that we can affect their learning. And so what I wanted to do was share the link to the Microsoft Student Ambassador website. And you can actually kind of go here, and you can search by region, by language by area focus, and you can kind of see what the students are doing, which I think is really great. And if anyone that's listening is a student, as well, as a university student that's interested in joining the program, you know, you go ahead and hit that big blue Apply Now button. And, you know, go ahead and submit application for the next for the next court. I think that'd be a great opportunity for students. So people should check that out. All right, let's finish this off with a joke. And we're better together than XKCD. I love SK CD. Now they got some good stuff. So this one is entitled dependency. And I think it just captures the whole bring together different languages and technologies, and especially a bunch of open source libraries. Um, do you want to describe this picture for the listeners, and always grab graphical stuff for our jokes? Sure. So this reminds me of a game of Jenga? It's like a super Jenga. This is like recursive Jenga. Yes. That's what this looks like. And so there's a big blocks, and there's some little blocks, and it looks like, as the closer you get to the top, they start to become a lot more specific with like the type of blocks that are up there. And then at the bottom, it's much bigger at the bottom. And, you know, that looks that looks like that could be trouble. Oh, and then on the right side, there's one little part that's holding everything up. And it's really, really small and fragile.

21:49 At the top, it says all modern digital infrastructure. And at the bottom, does the little tiny stick is a project some random person in Nebraska has been thanklessly, maintaining since 2000 2003. That's amazing. I love this.

21:49 In the hover over messages, someday image magic will finally break for good. And we'll all have a long period of scrambling as we try to reassemble civilization from the rubble.

21:49 To me, I think of this as open SSL,

21:49 that little stick that's open SSL down there. There's like one person who maintained it. And everything seemed to be built upon it. And when there was that bug that needed to fix them, it was a huge problem. I find anytime I try to home so I use a Mac and every time I homebrew install Open SSL, and it updates the version that's on my system. Like everything just stops working. Like I can't install any PIP packages like

21:49 like nothing works. I'm like, What happened to my virtual environment? Like what's going on here? I can install anything. They're like, Oh, open SSL. Yeah. Yeah, exactly. That's the stick that can bring it all down. Yeah. Well, thank you for being on the show. sessile It's great to catch up with you and had a lot of good stuff to share. Hey, thank you for having me on. And Brian, I know you're not here but I hope I did you service. And you know, hope you come back soon. And, and also to I didn't get to say this in the beginning. Congratulations on 200 episodes well over at this point. Remember, I listened to Episode 199 I'm like, wow, has it been like that many episodes Really? Like it's crazy. Yeah, that's coming up in like four years almost. It's insane. Wow. That's awesome. Well, congratulations to you both man. That's a great achievement for for podcasting. Yeah, thanks a bunch and

21:49 get bigger. Thank you for listening to Python bytes follow the show on Twitter via at Python bytes events Python bytes as in V yts. And get the full show notes at python bytes.fm. If you have a news item you want featured, just visit Python by set FM and send it our way. We're always on the lookout for sharing something cool. On behalf of myself and Brian Aachen, this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page