Monitor performance issues & errors in your code

#69: Write an Excellent Programming Blog Transcript

Recorded on Tuesday, Jul 19, 2016.

00:00 Do you have a blog? How many articles have you written for it? Do you find it hard to keep writing or hard to get started doing technical writing? We might be able to help you out with that this week.

00:00 You're probably aware that blogging is one of the key ways to establish yourself as a thought-leader in the industry. You'll make more connections, open more opportunities, and likely find your work more rewarding if you share your experiences and expertise through blogging.

00:00 But it can be challenging to keep writing or find time for writing. That's why I asked A. Jesse Jiryu Davis from MongoDB to share his thoughts on writing an excellent programming blog.

00:00 You'll even learn about Jesse's 5 "design patterns" for blogging to help break writer's block.

00:00 This is Talk Python To Me, episode 68, recorded Tuesday, July 19th, 2016.

00:00 [music intro]

00:00 Welcome to Talk Python To Me, a weekly podcast on Python- the language, the libraries, the ecosystem and the personalities.

00:00 This is your host, Michael Kennedy, follow me on Twitter where I am at @mkennedy, keep up with the show and listen to past episodes at talkpython.fm and follow the show on Twitter via @talkpython.

00:00 This is episode is brought to you by SnapCI and Intel. Thank them both for supporting the show on Twitter via @snap_ci and @intelsoftware.

01:33 Michael: Hey everyone. Before we get to the main interview, actually I have a special little segment for you and a pretty awesome announcement. I am here with Matt Makai, remember him from the full stack guide to deployment episode back in episode 26? So, Matt and I have a pretty awesome announcement, Matt, why don't you tell everybody what we are up to?

01:49 Matt: Sure, Michael, thanks for having me on. So we are launching a Python for Entrepreneurs co-authored, co-taught course on Kickstarter.

01:59 Michael: Yeah, this is a course I've been dreaming of writing for a really long time, so many courses teach you how to build web apps, there is some courses that will teach you how to build online businesses around it, processing credit cards, and things like that in addition to the core web technology. This Python for Entrepreneurs course is suppose to teach you both, so you can go from zero to online functioning business taking credit cards with the real users right away. So the overwriting goal that we are working from really is to dramatically shorten the time from idea to minimal viable product to running production and accepting money, shorten that time form months maybe even a year down to a month or a couple of weeks in some cases. So Matt tell us, who did you have in mind when you were working on your part of the course?

02:41 Matt: Yeah, so I think the ideal student is someone who knows little bit about programming, maybe is just getting, just trying to hack on some programming themselves, for a purpose, or someone who has been in programming for a long time but maybe doesn't have a full range of technologies that they would need to build an online business. So really that's the audience for this, and someone who wants to build a non trivial product, so I think for example if you want to break out of your regular company job and launch an AirBnB competitor for your local market, you could use this course and it will be a good place to start. Of course, that would be a huge challenge, to launch an AirBnB competitor, but you have a general idea of who we have in mind.

03:22 Michael: You know, a lot of people listen to this show, they of course know Python, but in case your Python is a little sketchy and you are not ready to jump straight into web development, in the Kickstarter we set up a Python foundation plus entrepreneurs reward, and that basically gives you access to my Python Jumpstart course as well as the Entrepreneurs course, at almost just the price for the one, so that's really awesome. And, everybody go and check this out at talkpython.fm/launch. We really hope you love this class, we hope you'll back the Kickstarter and we hope this makes a really big difference in the business you've been dreaming of launching. Matt, thanks for being here.

03:57 Matt: Thanks Michael.

03:57 Michael: Yeah, I'm excited to see how this goes. All right, let's get on to the interview with Jesse.

04:03 Michael: I am not going to ask you how you got into programming in Python because I already asked you that, you can start from last year.

04:08 Jesse: That sounds great, last year when we talked I had just begun to transition from being a full time Python programmer to being mainly a full time C programmer and that was a bumpy ride but we've kind of achieved stable flight now where I feel basically competent in C and the project that I am leading, the MongoDb C driver which is what C application developers used to talk to MongoDb, the project has now gone through a number of releases with me and we fixed a ton of bugs and it's pretty stable. I have a collegaue and two interns working with me on it, and that's freed me up to not quite have my head down in C code as much as I did over the last year.

05:02 Michael: Give me sort of a contrasting experience, you've been doing Python for a long time, you are deeply involved in a community and then you go over and do C code and I am sure you knew C before, but what was it like to sort of come back to C?

05:16 Jesse: Well, I knew enough C to be able to read and write the syntax of the language but after 10+ years as a professional Python programmer I knew the difference between knowing a language versus actually being a professional programmer in it. And so I knew I knew the C language but I also knew that I wasn't professional C programmer and so I would have to learn how to use all of the tooling, like valgrind and GDB, how to maintain API and ABI compatibility, how to manage an open source project, how to package a C shared library for Linux in the proper way, both for red hat and Debian, I knew I didn't know all that and I knew that that was going to be the bulk of professional C programming. And, therefore that's most of what I've been spending the last year doing, things like being able to figure out from a core dump what happened on a customer's machine, or figuring out how to give customers a way out of a poorly chosen API while at the same time not breaking backwards compatibility for those who are already using it.

06:37 Michael: Yeah, that's a big challenge if you are supporting customers and they say we think the driver crashed or something we did and the driver crashed our app, because if that happens in Python or Ruby or .Net, you get a nice stack trace and there is tools that you use, it's much harder to just get up like you said a core dump, that's a lot of work to look into, right?

07:01 Jesse: Yeah, the proportion of scary bugs causing sleepless nights in Python is much lower than in C.

07:10 Michael: [laugh] I am sure it is, that's awesome. So, you said you have some people helping out on this project, so that you can turn your attention on a little broader to the community and supporting MongoDb in other ways, and so you said you've been doing a lot of writing, right?

07:25 Jesse: Yeah, so in the last year the scope of my writing has grown enormously, I started writing my blog when I started working for MongoDb about 5 years ago on empty square.net and I am still publishing a lot there, but in the last year MongoDb itself has started up a tech blog and naturally, I've been doing a lot of writing and editing for that so I listen for interesting storing among my colleagues, problems they encountered, ideas they had, management or software engineering practices they tried that failed or succeeded, and I've been soliciting articles and helping people to shape their experiences into tight nit stories that are crisp and compelling and then helping them to write and edit those stories and publish them.

08:28 Michael: That's really cool, you are taking these guys and girls who are mostly programmers, not writers, and you are helping them tell these stories, right, so you probably help them come along as writers a little bit, help them break through things like writer's block and write well structured compelling blog posts, right?

08:47 Jesse: Yeah, and it's a very different kind of challenge, I am really strucked by how much of a problem for people who are not professional writers writer’s block and procrastination are. I was thinking the other day how if you assigned a programmer to implement a feature and three weeks later there was no progress whatsoever, no evidence of any effort whatsoever, that would be a serious problem, you wouldn't see that very often, and you would think about whether this programmer should continue to work for your company for much longer whereas with a programmer who is writing you might easily see three weeks of procrastination and you need to break through it, but it's also sort of not as surprising, we procrastinate about writing in a way that we don't procrastinate about almost anything else.

09:42 Michael: Yeah, I think it takes a lot of practice to write well and you almost have to make it a habit.

09:47 Jesse: Yeah, that's true, and maybe also to not treat it as certain to be perfect and not as intimate as it feels, we need to do it a little more like code, like do your best read it over, do your best to make something that is correct and compelling and then just publish it, in the same way that we treat our code where we know that it will never be bug free or lightning fast but we publish anyway because it's better than not.

10:24 Michael: Yeah, it's better than not doing anything. That's true with code, I think it's true with blogging, I mean it's true with podcasting, it pains me to go back and listen to our original interview not because anything we talked about but just you know, the experience that I have these days versus then, I felt really little unsure of myself and so on, and the way you get better is by doing it, right, so like writing code, blogging as well. So you also write a little for the PSF blog, is that true?

10:53 Jesse: Yes, there was this unfortunate moment last year where the PSF's main blogger Mary Ann Sushinsky had I think she fell off her bike and she hurt her wrist, so she was one handed, and then wonderfully, then a clerk who heads the PSF had a baby but that effectively made her one handed as well, because she was holding her baby in one arm and typing with the other, so unfortunately two people with one arm each don't write as well as one person with two arms, so Diana asked me if I could step in and write some articles for the PSF, and I've been doing that since, and the main thing that I do is I write profiles of people who have won PSF community service awards. And that's been super exciting because I can make contact with people who are prominent in our community, interview them about what they are most passionate about, about what makes their work stand out and then communicate that to all of the PSF members and readers.

12:08 Michael: Yeah, that's a great service. And a great opportunity for you, right? I think one of the things that is interesting, that sort of comes out of that is writing and blogging and these types of things, they open up opportunities that you otherwise might not have had, that you might not have expected to have come out, but there they are, right?

12:28 Jesse: Yeah, that's right and I really feel that difference when I went to PyCon in Portland this year, compared to last year, because this year I had already had long phone calls with the two community service award winners Jackie Kazil and Damien George and various people that they knew who may talk to about their achievements. So I had this built in community and these conversations that I had already started having and it made really easy to continue to be connected with people when I met them in person in Portland.

13:11 Michael: Yeah, that's excellent. So, speaking of Portland, PyCon, it was a great conference, let's talk about your session that you did there, you did one, it was entitled "Writing an Excellent Programming blog" right?

13:24 Jesse: Yeah, that's right.

13:24 Michael: So was this sort of motivated by your experience with working with all the developers at MongoDb and trying to synchronize them into a coherent set of articles and machines that would create all these great stories from MongoDb in your blog, where did they come from?

13:42 Jesse: Yeah, that's right, it came from both my personal experience of how much writing had benefited me, and also my experience of a community coming together and talking to itself and communicating its values to other people by writing. So I had the sense that people come to PyCon one, to contribute code to each other and they admire people who write great code but that they were often unaware of what huge value we can achieve for ourselves and each other by publishing our writing. And I also felt like people who wanted to write didn't quite have the professional approach to it that they do to their coding and so they weren't being very productive when they did decide to write.

14:38 Michael: Yeah, I feel like a lot of people blog with guilt. You know, they are like oh I know I should have a blog so I will create a blog and they will write for a while and then they will kind of let it drop and then you know, it's not good when you see a post that says I am planning on writing some more, so you know, it's like 5, 6 months old. But, it is hard, and so I think one of the interesting things that your talk does, and of course I'll link to the video so people can watch it and I recommend they do, is you kind of broke it out into almost like a set of design patterns for successful developer blogs and you contrasted what it means for a developer to blog versus what it means to be like a tech crunch writer versus what it means to be a buzzfeed article, top ten lists writer, right, you have different goals, different timelines and so on.

15:33 Jesse: That's right, I think people think of a blog as something that needs to be updated regularly because they are used to the old model where people blog and expect repeat readers and think of a blog as something that makes money from page views. But there is really not very many of those in the world, and they are nothing like what you and I and our listeners write about. So, what open source Python developers will write about is our individual specialties, and we will write infrequently when we are inspired by some new piece of information or new project that we are working on within our extremely narrow specialty. And, we'll probably be speaking to a very small number of fellow specialists who are looking for this kind of deep expert knowledge about our topic, so it's not going to be the news of the day, certainly not going to be anything like tech crunch, we don't do industry reporting, we don't guess whether a company is going to IPO or whether it's going to be more profitable this quarter, we are writing articles of deep significance and lasting value and therefore we don't write very often and I think that that's completely appropriate. But, we really, we need to understand what sort of articles we write that are valuable in order to understand why it's ok that we write them infrequently.

17:06 Michael: Right. But then understand the patterns and the styles that we can sort of fit our ideas into the best match as well. You know, when you were talking I was thinking this sounds a little bit more like an academic person, like a professor writing an academic paper, more than it does you know, a newspaper journalist.

17:28 Jesse: Yeah, that's exactly right, and that's why I encourage people not to think of themselves as writing blog posts, because the things that we publish about open source software development are not posts to web blog, they are articles about topics, and so I think we should start calling what we do articles and essays because that will put us in the right frame of mind to write deeply thought pieces of writing.

17:58 Michael: Yeah, that's excellent. So, you started out going through in your session talking about a couple of things, and one of the things you talked about is, there is a couple of reasons that we start writing, I thought they were interesting, you sort of touched on some of them, share your experience and expertise, meet your fellow experts, kind of like you did with going to PyCon, you had exposure to these folks, and it was really great, but another one that I found resonate with me is you said writing is thinking super powered, can you expand on that?

18:30 Jesse: Yeah, I think that explaining a topic we know this that it's only when you try to explain something to somebody else that you are really certain about how deeply you understand it and I think it's even more so when you are writing it down and rereading what you've written, reinforcing your understanding and looking up things where you realize that you have gaps, one case where I did this, I very often do this when I start working on a bug as I start writing the story of how I diagnosed and fixed the bug, and I start writing the story before the story is complete. So a few years ago I was diagnosing this bug it had come up via a Py Mongo bug report, and what it looked like to me was that assigning to a thread local is not thread safe in Python 2.6 that you need to lock around that assignment. And that is if true, obviously a bug in Python and so intricate and deep and mind blowing that I really didn't think that I would be smart enough to diagnose it.

19:48 Michael: Yeah, threading is hard, and there if there is a bug down in CPython itself around it, like ok this is intense, right, so I find it really interesting that you started writing before you actually had the answer, it was like an exploration almost, right?

20:03 Jesse: Yeah, and writing down the story of how I diagnosed the bug, was how I diagnosed the bug. So I wrote down at each stage, this is how far I got this is what I was thinking, and by then reading that back to myself I could really entrench my understanding and also test it, I would see if I were somebody reading this, would this make sense to me, what would I think the author had missed, what haven't I thought of yet, am I certain of my conclusions so far. And that allowed me to proceed step by step and diagnose a previously unreported bug in Python 2.6 threading implementation which to this day is I think sort of astonishing.

20:57 Michael: And that really is amazing, considering how much usage that version got, can you just sum up what the bug was in like a sentence or two?

21:05 Jesse: Yeah, there is a way that one thread could interrupt another in the midst of updating thread local state that would leave something that had been in a thread local storage, unreferenced and leaked. And, this caused a socket leak in Py Mongo that would eventually lead to another file descriptors.

21:28 Michael: Yeah, that's not good.

21:31 Jesse: No, it's catastrophic.

21:32 Michael: But it's extremely hard to find and it takes a long time for it to actually crush, right, so not good. Yeah, that's really cool.

21:32 [music]

21:32 Snap CI is a continuous delivery tool from Thought works that lets you reliably test and deploy your code through multi stage pipelines in the cloud, without the hustle of managing hardware. Automate and visualize your deployments with ease, and make pushing to production and effortless item on your to do list.

21:32 Snap also supports Docker and in browser debugging and hey integrate with AWS and Heroku.

21:32 Thank Snap CI for sponsoring this episode by trying them with no obligation for 30 days by going to snap.ci/talkpython

21:32 [music]

22:34 Michael: So the next thing you talked about was almost like a design pattern, set of designed patterns that you see over and over and these technical writings that you talked about that are not academic papers, not buzzfeed articles but sort of this middle ground where we as developers often operate. Can you maybe talk about those a little?

22:53 Jesse: yeah, among the stories that I really admired and found most valuable it seemed like they were five-ish structures which are stories, opinions, how to guides, explanations of how something works and then reviews. And, the structure of each of these is very simple and you can reuse it like a template, so a story just tells a sequence of events and it's always got some moral like a fable, you learn something, or you learned not to do something, or you discovered some fact that you wouldn't have otherwise.

23:36 Michael: One of the things I liked about it, when you talked about these is each one of these sort of patterns if you will is accompanied with a concrete article from someone often in our community, right, so for example you told the story of I think it was called unyielding by Glyph and a problem around threading, that has to do with the story, is that right?

23:58 Jesse: Yeah, that's right, Glyph's article titled Unyielding about a bug that he had in multithreaded Java and how he fixed it by re-implementing his entire stack in asynchronous twisted Python code, it's a great story, it's funny, it's about this text adventure game he had where due to a threading bug a brass cockroach item in the game would multiply indefinitely and fill the entire world and make it unplayable, so it's hilarious, and it makes really memorable his underlying point, the lesson of the story which is that async code is less prone to risk conditions than multithreaded code is.

24:45 Michael: Yeah. Very cool. And then, I interrupted you on the next one which is opinions.

24:49 Jesse: So, opinions, the structure is what we learned in high school, you state a thesis, you back it up with three points of evidence or more, and you anticipate and respond to the readers' likely objections and then you just conclude by restating your thesis. And, the example of that, is an article by Julia Evans where she argues that we shouldn't feel guilty about not contributing to open source, and her argument there is super interesting because she says that we often feel obliged to be always submitting pull requests but sometimes open source software just works for you the way it is there isn't a missing feature or a bug that's getting in your way. And, if you make guilt contributions in that state, they won't actually be the right thing, because they are not scratching around itch, they won't actually be that beneficial to the project. So, when you are in that phase where you are just working with open source and it works for you like it is, it's ok now to contribute and you shouldn't feel guilty. So, she is not attacking anybody there, and that's really important, I think that in the software community especially open source, there is a lot of thoughtless and damaging aggression, and you should stop saying oh that thing sucks, that thing is a piece of trash, that's not a useful opinion; a useful opinion is insightful and an interesting and-

26:33 Michael: No, it's definitely not useful.

26:34 Jesse: Goes out of its way to be constructive.

26:36 Michael: All right, Jesse, so the next one is how to?

26:39 Jesse: Yeah, that's right, so how to is probably mostly what we all write, where you just explain how to do something, and it always begins by motivating it, it says, if you want to accomplish a given thing, you'll need to know how to do x and that lets the reader decide whether to read the article and also makes a promise of what the value of the article will be if they do finish it.

27:09 Michael: Right, there is usually some kind of constraint like under these circumstances, or under these conditions it makes sense for you to use object data model mapper for Mongo versus straight py Mongo, who knows, right? But something like this.

27:23 Jesse: Exactly. And, the example that I really enjoy for that is an article by Kenneth Reitz about Growing Open Source Seeds, it's where he Kenneth Reitz is the maintainer and inventor of Requests which is one of the most successful Python packages, and so he's got a lot of expertise about creating a package that is very popular and then maintaining it without burning out, and that's what his Growing Open Source Seeds article is about, but he begins by motivating you with a counter example of a library that Facebook open sourced and then abandoned which made everybody mad at them; so he promises if you don't want to end up like they did, like that project did, then you should read how to do my thing. And therefore, if that is not a priority for you right now, you can skip it, but if that does seem like a fate that you are in danger of and you want to learn how to avoid it, then you should read Kenneth's article.

28:29 Michael: Yeah, that's excellent, I think we end up writing a lot of how tos, right, and I think that sort of the engineering side of us saying ok, I need to understand all of the steps and the building blocks, the Lego pieces of programming or the Lego pieces of community building, but there is also sort of the just understanding the concepts, you know, how does something work, kind of like a scientist cares you know, why atoms bond together not just what do I do to make them come apart.

29:01 Jesse: Yeah, that's exactly right, I think we all have those two sides to us in some proportion. So we also want to write how things work type articles, where the motivation is not about actually doing anything, but simply understanding something. And, the article that I site for that is by Allison Kaptur who has for a long time been a facilitator at the Recurse center, and she wrote an article about syntax warnings so it turns out that if you do from module import star, if you write that line within a function definition, in Python you'll get a exception called the syntax warning which most of us have never seen because we didn't make that particular mistake when we were just starting out, and one of Allison's students though tried that out and hit that error. So, there is no need to wrote how to avoid that, you simply move that form module import star statement to the top of the file and you are good, but Allison was really interested in where that syntax warning came from and why that statement when it’s not allowed.

30:19 Michael: It might be a reasonable thing to do, as a beginner, because you can do those local imports if you preserve the name space, right, like import OS would be ok, right?

30:30 Jesse: yeah, that's exactly right, so it may not be very useful to know why that doesn't work, but it's awfully interesting, so she dove in and she found out a lot about how the Python compiler works and its symbol table and wrote an article about it that is fascinating purely for the curious scientists within us.

30:53 Michael: Yeah, that's awesome. And then, so that was the fourth one, the last one you said that, and maybe this is the easiest, I think either the how to, or this one, the review might be the easiest if you just want to kind of write another article, you've got something like I kind of take this Saturday morning and write something, a review can be a good choice, right?

31:13 Jesse: That's right, because it can be any length and there is always something new to review, you've always seen a movie or finished a book or tried out an open source project and if you just want to keep your blog alive, or keep your writing muscles toned, write a review. But, the main thing to keep in mind is that simply rating things saying whether the movie, or a book or software project is good or bad, is not very useful to your audience. It's not very good as writing practice either, it's much more important to describe what that thing is and what it's good for, so this movies is good for relaxing on a summer matinee, or this project is useful if you want an easy to use debugger that doesn't have all the bells and whistles. And, by writing your review that way, that makes the most valuable description of that thing, for your reader.

32:22 Michael: Yeah, that's excellent. So, these five things come together as these almost design patterns for our technical articles, if you will, and I think they are really helpful. So how do you see them helping with writer's block?

32:35 Jesse: So you can use it in two ways, and this is what I do: is that, if I've got a topic that I want to write about, but I can't seem to get started I don't know what the structure will be and so I don't know how to begin, how to write the first paragraph, a great way to start is to ask myself am I writing a story about this topic or do I have an opinion that I want to argue for? Or any of the other of the five structures, and that narrows my scope, I can choose one, and then I just plug in the blanks in the template. And, by the time that I have chosen the structure and filled in the blanks, I am already half way done through the first draft. The other way that I can use this is if I don't know what to write about next at all, I can ask myself whether I have one of these five kinds of stories, do I have a story to tell, an opinion to share, do I want to explain how to do something or how something works, or is there something I have experienced recently that I want to review. And that can help me to generate ideas and realize that I have thoughts that I want to write about that I hadn't been noticing before.

33:56 Michael: Yeah. That's really cool, I think that's super helpful and I can certainly see myself going down this checklist if I've got just a blank wordpress new post what's the title and just an empty field for the content, right, like what am I going to do now, I think this is excellent. So, when you think about the target audience, one of the things people really care about is getting their blog to be popular, and you said you kind of discouraged people from being too overly focused on things like SEO and content marketing and so on, for your personal blog at least, what is your thinking there?

34:34 Jesse: SEO is a set of techniques for competing for mass audience with other authors who are writing about the same topic. And that is the total opposite of the kind of writing that we are talking about now. We are writing about specialties and we are virtually the only people writing about them. That means that our fellow specialists want to read about our topics, they will be searching for keywords that only we are using, so our fellow specialists will find us and we really don't need to worry about it, and we are not targeting a mass audience because we are not getting paid for page views, all we are doing is communicating with people who are into the same stuff that we are. So the number of page views and the number of clicks, it just doesn't matter.

35:24 Michael: Right. It's about making the connections and building the catalogue of ideas and so on, right?

35:32 Jesse: Yes, and making sure that your fellow specialists know that you are one of the people whom they should talk to about these ideas. Now, these specialists communities do have ways of sharing blog posts with each others, there is planet Python which thousands and thousands of Python programmers read, and it has a list of feeds that it aggregates on github so you just go there and submit a pull request and pretty quickly one of the administrators will add you. And if you are mainly interested in connecting with other Python programmers that's good enough, you're done. If you are also reading the other topics there are planets and aggregators for them, and then there are also a number of these weekly emails like Py Coders weekly and Python weekly. Their editors have big ears and they generally hear about anything that they want to republish without you having to make any effort, but if you do want to make sure you can always write to their editors and mention whenever you write something that you think that they would be interested in. And, that's really good enough, Google is designed to bring people who are interested in your topic to your site.

36:50 Michael: Yeah, I agree with you on that, I certainly think communicating with the guys who write the weekly newsletters there is Python weekly, Py Coders weekly, import Python, those three seem like the big ones to me, I am probably missing some and if I am sorry, but you know, you can get in contact with those guys pretty easily and I find it makes a big difference, if something gets featured there people usually talk about it.

37:17 Jesse: Yeah. That's right.

37:18 Michael: Yeah, cool. Also maybe a little bit of social media, I find Twitter is a really good place for sharing your new ideas, because unlike a lot of social media you sort of follow people because of their common interest and common ideas, so maybe throw that one in there as well.

37:18 [music]

37:18 We all love Python for its tremendous productivity benefits. But getting the best performance takes some work. What if you could get out of the box, easy access to high performance Python? Intel distribution for Python developers delivers just that. Get close to 100 times better performance for certain functions when using Numpy, Scipy, Scikit learn linked with the optimized native libraries like Intel math kernel library. Access efficient multithreading and Python projects like Numba and Cython.

37:18 Try the Intel distribution for Python and experience performance today at talkpython.fm/intel. And profile your Python and native C, C++ applications for performance hot spots with Intel VTune amplifier. With Intel, it's all about performance.

37:18 [music]

38:50 Michael: You did talk a little bit about how to get started if you are not a good writer, maybe you just don't have very much experience, and you had some advice for those folks, that was good.

39:00 Jesse: So the main thing that makes us better writers is to read, and read a lot, and I think that a lot of community minded, open source developers do read a ton of blogs but we want to read them as writers, and most importantly that means reading articles to the end. I would love to see a chart of this, or maybe I would hate to see a chart of this, but I think that the first few sentences of most articles are probably read a hundred times as often as the last few sentences are; people generally give up or skim. Reading as a writer means actually reading the entire article and not just skimming it but reading all the way to the end and then asking ourselves did this article communicate well, or not and regardless of whether it was effective or not, how would we improve it if this were our article. And that's the best way to improve, is to read critically like this. The other thing I would suggest is to get an editor, and that can just be a programmer friend of yours or a non programmer friend who is a good writer. Find out who gives good useful critical feedback on early drafts and then you'll start to lean on those friends, and you can swap drafts with them and help each other improve that way.

40:40 Michael: Yeah, that's good advice, how do you feel about having like a writing group like 3 or 4 people who are into blogging and maybe meet on skype once a month to exchange ideas and share articles and what not.

40:54 Jesse: I think that sounds wonderful, I want to you invite me.

40:56 Michael: Yeah, absolutely. I think it sounds wonderful too. All right, if you don't have a lot of experience, I think this idea of reading articles with this critical eye is really powerful and the world is working against us on this, with things like Flipboard and zaid and apps that are encouraging you to read the first paragraph and then flip on to the next. It means, we do this less and I think we get into the habit of doing less but I think it's almost like learning to code while reading an open source software that is well respected. This is the writer version of it, right?

41:35 Jesse: Yeah, that's right.

41:36 Michael: Cool. So, that's the getting some experience story, but if maybe I am a fine writer but I am just really busy, I have no time, you also have some advice for those guys?

41:45 Jesse: Yeah, the first is just to remember that it's ok to write infrequently, if you are occasionally inspired by a really powerful idea that you are so excited about that you can't do anything until you have communicated it then that's the time to write and the rest of the time maybe not, but if you do just want to practice your muscle a little more, I think that writing reviews and setting yourself a time limit is a really good way to just stay in shape, so promise yourself after every book you finish or after every movie you see to set a timer for an hour, write three paragraphs, describe the thing and you're out. And with that muscle kept in shape this way, writing more frequently and writing longer and more valuable articles will come more naturally.

42:45 Michael: Right, definitely. You hear about lots of the really prolific authors they had, they didn't spend that much time writing, they would get up at like eight and write till noon daily, or they would sit down every day and they would write three pages a day and that's it, they have written hundreds of books, just by going like that so this do a little bit actually adds up really quickly I think. So, what is the takeaway from this talk that you gave?

43:13 Jesse: The takeaway is to write together, if you have the opportunity, so if your company has a tech blog then submitting articles to it is the best way to make yourself visible both to your company and to your larger community, and if your company does not yet have a tech blog and you are somebody who is passionate about writing, then this is a huge professional opportunity for you, you should be the one who starts your company's tech blog and helps your company communicate about its engineering culture to the wider world. And, besides companies, there are lots of open source projects and foundations that need to get the word out to their community but don't have anybody writing for them right now so blogging for and about these kinds of projects is a way to make a connection and create something of lasting value. Besides this, just remember that even though you may feel like if you are not coding you are not producing anything worthwhile, it's not true, writing is one of the most generous things you can do for yourself and for me because I want to read about your specialty and for your community at large, so use these five structures to overcome writer's block, get yourself inspired by whatever it is that you are working on right now and publish your thoughts.

44:57 Michael: Yeah. Great advice. You talked about writing together, and you also talked about in some sense if you write it they will come, right, if you write enough specific important articles people will come but if you are just getting started you really have nobody, you are brand new blog, nobody subscribes, nobody cares, that can be challenging and it can be discouraging, getting feedback is valuable, so what do you think about guest posting, like if you want to write an article you think it fits with someone else's blog, does it make sense to reach out to them and say hey I'd write a post for you if you are open to that sort of thing.

45:31 Jesse: I think it would, it's not very prevalent in the open source community, we tend to stand up our saiload blogs and occasionally link to each other, but it can be a good way to get the word out and big sites like dzone.com and similar large sites that have lots of bloggers. Reach out to them and ask them if they would like to republish you. I found that to be very effective for me where an article that I published on my own site might get a few hundred hits but if it's something that DZone likes and they republish it, it will get thousands of hits instead. When you do that, if you do care about bringing people back to your own blog, then arrange to have many links to related articles that you have already written on your own blog, in the article that you have guest posted on somebody else's blog so that you can connect with your readers over the long haul.

46:36 Michael: Yeah, that's good advice and DZone has the most valuable blogger program where you can get sort of reviewed by them and approved and once you are in, they will sort of pull and review and possibly repost your articles, automatically. So, if that sounds cool, then you know, check that out. So wrote all this up, and sort of links and examples and everything at bi.ly/excellent-blog, right?

47:03 Jesse: Yeah, that's right, excellent-blog is super meta because it's a article based on the talk about writing about programming, and now we are discussing it on the podcast-

47:18 Michael: [laugh] It' maybe meta meta, couple levels.

47:24 Jesse: But if you can stand the sense of vertigo, reading it is helpful because it's a written up version of my PyCon talk and it has links out to all of my favorite articles as well as lots of other resources that will help you to improve your writing and also to get the word out and get reach an audience for your writing.

47:46 Michael: Yeah, cool. That's a very good resource and I'll be sure to link to it. Another thing that you did recently that I found to be pretty awesome was you wrote a chapter, I call it a chapter, I guess it's a chapter for a book that got published called 500 Lines or Less. And you coauthored that with Guido Van Rossum, right?

48:04 Jesse: Yeah, that's right, it's within the architecture of open source applications book series, and the 500 Lines Or Less book has articles where programmers solve very advanced scary sounding problems with very short code examples, so Allison Kaptur wrote a Python Interpreter, and Ned Batchelder wrote a Template Engine and there is also various topics in there. Guido and I wrote a essentially a version of async io with a web crawler and asynchronous coroutines that fits within 500 lines, and then used it to write an explanation of how async io works how coroutines work how the yield from statement works and also how you can use queues and other thread like structures within and async program to make your async io code manage its control flow.

49:12 Michael: Yeah, and I thought that was a very nice piece writing, it was about 25 pages or so and you start from let's just write this the most naive straight forward way, well, you know, maybe the natural way to make this do more once is to throw threads on it but there is all these problems and you slowly build up to this final kind of understanding of async io.

49:37 Jesse: It's really amazing if you work at it how simply some of these ideas can be expressed, especially in Python, but any time that you throw away error handling and throw away all the historical baggage and just really focus on the technique that she want to express, just a little bit of code can often do it, and if you read this book you'll find the things with really scary names, are often quite approachable if you read one of these really focused implementations of it.

50:11 Michael: Yeah, that's cool, it's not all Python is it, it's a mix but it seems to have a lot of Python in it. Is that right?

50:17 Jesse: Yeah, that's right, it maybe that if you want to get something done in 500 lines you are likely to choose Python, but there are a lot of other programming languages represented there too.

50:26 Michael: Ok, excellent, yeah, I definitely recommend people check out that book, I found it to be pretty fascinating. Originally, when I had you on show #2 we were talking about Python and Mongo Db, you are still at Mongo Db, we talked about kind of what you were up to there, but you know, what's the latest news form Mongo, in the last year?

50:42 Jesse: Yeah, so at Mondo Db, well last month annual conference we announced a bunch of exciting new features, the rightly headline grabbing one was Atlas which is Mongo Db as a service. You just tell us how much Mongo you want and what kind of Mongo you want and we set it all up for you, currently in IC tube we are going to add new cloud providers in the future and it's this extremely focused UI that will just get you from zero to a distributed fault tolerant backed up cluster of Mongo Db in as few steps as possible.

51:26 Michael: That sounds really exciting, I am sure that will help especially new comers but it will help everybody, that's cool.

51:32 Jesse: We've also got a lot of great news for Python developers specifically coming up; one of them is that Motor, which is my async Mongo Db driver for Python, it supports Tornado and async io already, and I am going to be developing finally Motor 1.0 this fall, which will use the latest version of Py Mongo under the hood, that means among other things that it will perform much better especially when it connects to very large replica sets with large number of servers in them, and that it's going to be stable and give you an API that you can rely on for years to come.

52:14 Michael: That's awesome, congratulations.

52:16 Jesse: Thank you. The other big news is that Anna Herlihy and I are working on a Numpy Bson codec, so this is going to go directly from Numpy which is what Python statisticians use for large data sets, and it will translate directly to and from Bson which is the binary Json data format that Mongo Db uses internally. So, in the past whenever you wanted to move data back and forth you had to have some intermediate structure, usually Python dictionary and that slowed down that transcoding to a crawl. But now if you want to load up a bunch of numbers into Mongo Db use Mongo DB to store it or query it and then load it back into Numpy arrays in order to do statistics on it, that pipeline is now going to be very streamlined and extremely high throughput.

53:14 Michael: Oh that's awesome. How much of your C work contributed to that, any?

53:20 Jesse: This is really only possible now because I know C well enough and so does Anna, that we can tackle it, because it's essentially a C project and that's why it's going to be fast.

53:29 Michael: Right, that's awesome. Ok, well, that's really good news to hear, what you guys are up to, it continues to be exciting over there. So Jesse, we are getting close to the end of the show, I always ask people when they are writing Python code what is their favorite editor?

53:46 Jesse: My favorite editor is PyCharm, I feel very strongly that people hovel themselves when they use Vim or Emacs, they need a real debugger and editor that understands the structure of their project and it has a built in profiler it's got also some amazing features and it's really worth the time investment to learn it.

54:10 Michael: Awesome, ok, what's your favorite PyP package?

54:13 Jesse: Right now I am really enjoying Lektor which is Armin Ronacher's project, it's a static site generator, it's written in Python, and it's what I use now to generate my onblog and then I upload it to a hosting service called netlify but Lektor can publish to a lots of different places including github pages. David Baumgold now has joined the project and is one of the chief maintainers along with the Armin, it's very flexible fun project, it's new, it's got an active community and if you want to static site generator that is written in Python you can get in there and hack it up a little bit, Lektor is treating me very well.

54:59 Michael: Ok, that's cool, I haven't played with Lektor I'll definitely check it out. All right Jesse, any final call to action, for our listeners out there, maybe thinking about blogging or have a blog but it has updates in the last decade?

55:13 Jesse: Yeah get out there and get writing. Don't worry about what platform you are going to use, don't mess around with your visual design for too long, just write down what you are really excited about so that I can read it.

55:29 Micheal: I want to second that thought as well. Jesse, thanks for coming on the show, it's great to share these blogging ideas and everything else you are up to.

55:35 Jesse: Thanks a lot.

55:36 Michael: Yes, see you later.

55:36 This has been another episode of Talk Python To Me. Today's guest has been A. Jesse Davis, and this episode has been sponsored by Snap CI and Intel. Thank you both for supporting the show.

55:36 Snap CI is modern continuous integration and delivery. Build, test, and deploy your code directly from github, all in your browser with debugging, docker, and parallelism included. Try them for free at snap.ci/talkpython

55:36 The Intel distribution for Python delivers the high performance Intel C libraries built right into Python. Get close to 100 times better preformance for certain functions when using Numpy, Scipy and Scikit learn, check them out at talkpython.fm/Intel.

55:36 I'm so excited to finally be able to unveil my Python for Entrepreneurs course that I told you about at the top of the show. If you want to learn Python web development and launch an online business, you owe it to yourself to check out the kickstarter at talkpython.fm/launch. I hope we can build something amazing together.

55:36 You can find the links from the show at talkpython.fm/episodes/show/69

55:36 Be sure to subscribe to the show. Open your favorite podcatcher and search for Python. We should be right at the top. You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm.

55:36 Our theme music is Developers Developers Developers by Cory Smith, who goes by Smixx. You can hear the entire song at talkpython.fm/music. You can browse his track cs for sale on iTunes and listen to the full length version of the theme song.

55:36 This is your host, Michael Kennedy. Thanks for listening!

55:36 Smixx, take us out of here.

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon