Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 36, recorded July 26, 2017. I'm Michael Kennedy.
And I'm Brian Okken.
And we got some great stuff lined up for you. Very cool news in the Python space.
Before we get to it, just want to say Rollbar is sponsoring this episode.
They've got a really great offer for you at pythonbytes.fm/rollbar.
I'll tell you more about that later. Right now, Brian, I would like you to tell me some poetry.
Read me something beautiful.
So it's poetry hour at Python Bytes. No.
I started at a community college and then I switched to a university of Oregon to start the computer science program.
And one of the first classes I was in, before we got into like actually the technical stuff,
my professor said, you need to think about your code like poetry.
It should be pretty to look at.
And it's kind of stuck with me.
I like that lesson.
This article, there's an article by Trey Hunter.
And it's called Craft Your Python Like Poetry.
Just some decent advice.
Your code shouldn't really look like prose from a novel.
It should look more like poetry.
And it's not just pretty for pretty's sake.
It's more readable when it's visually appealing, I think.
And he brings up line length is important.
Although shorter is more readable.
But man, he recommends 55 character line lengths.
And that's pretty short.
I think there's a real tension in this one.
Although I do agree that line length matters.
And I prefer to have shorter is better in some ways.
However, one of the real tensions I find here is another good practice is to have descriptive variable names.
And sometimes that means longer than X, Y, and Z for your variable names.
And if you start doing expressions involving those like this times that past this, that can get them huge really quickly just by virtue of putting long function names alongside long variable names.
Yeah.
There is some tension there.
And also, in working with data and tables and stuff, I do find tables that look like tables instead of looking crammed all the way to the left-hand side are more visually readable.
Anyway, getting over the line length thing, he does have a lot of good comments about when you do have to continue a line to make it shorter, like do a line break, where you do it makes a big difference.
And he has some examples to make.
Making line break or broken comprehensions and more readable and function call parameters.
And then one of the things, maybe this is a functional programming thing, but chained function calls, I probably just don't do that very much.
But the dot alignment, he noted, looks pretty nice.
The last one that I saw, which I kind of do anyway, I didn't realize that some people don't do this, is dictionary literals.
So if you set up a dictionary that's kind of like an enum list, it's basically just a predefined dictionary literal.
Having one element per line makes it a lot more readable.
But then there's, you know, there's always trade-offs.
There's a, if you've got a really large one, there's vertical.
Vertical length is important as well.
And having a super long program might not be as easy to read as a shorter one.
I don't know.
Yeah, I'm with you on that.
Let me throw in one more that I don't think is covered in here.
Maybe I just missed it.
Is function length, right?
Just the idea of breaking your program into little tiny bits.
Little small, reasonable, easily understandable pieces.
You know, kind of like a haiku, I guess, rather than a long, flowing poem.
Right.
And also, I guess on that, it doesn't talk about white space too much.
But there's a white space, even within a function, breaking up the different parts of when you're working with setting up the data versus other things to break it up by white space.
Similar to how long poems are broken into little stanzas or something.
Yeah.
You know, thinking about this, one of the things that strikes me is the way that your code looks and breaking it down like this and kind of thinking about it this way.
It's a big sign of sort of professional developer versus somebody just learning, somebody just poking around who's not really a developer.
Like professional developer's code looks like these types of things.
It's clearly structured beyond just what the language requires.
And a lot of times people are new.
They just kind of mush it all together.
So if you're looking to come across better with your code, I guess, think about that as well.
Yeah.
Okay.
Yeah.
So I want to bring everyone's attention to this thing called Fedora Python Classroom Lab.
Okay.
So the idea is Fedora, it's a Linux distribution, really nice one.
And what they've built is basically Python and data science, Python-based data science in a box.
So, or rather in an ISO.
What you can do is you can get just the ISO DVD image of this Fedora Python Classroom.
You can mount it and literally just boot straight to this thing.
It fires up Fedora and you can log in without even installing it.
Log in.
You have access to NumPy, SciPy, IPython, Matplotlib, requests, all the various most common packages.
And it's just up and ready to go.
So that's really sweet.
You have the GUI, GNOME-based version or you have a Docker or Vagrant, no UI variant.
So all sorts of stuff is just set up and ready to go.
So if you're going to teach Python and you're thinking of maybe using Linux to do it anyway,
here's a really nice thing you can hand out to the students and just say,
boot from this DVD or this image or create a virtual machine based off of it and you're ready to roll.
Oh, that's cool.
Yeah.
I originally thought this was a thing I downloaded inside Fedora and logged into Fedora.
I'm like, wait, where's all this stuff?
Oh, it's actually its own copy of Fedora.
So this is its own Linux plus pre-configured Python stuff.
Wow.
Yeah, that's pretty cool, right?
Yeah, everything.
Yeah.
Including talks in there.
Nice.
Yeah.
It's already rolled.
Multiple versions of Python, everything.
So you have some less than amazing news for what's up next.
So we previously talked about this really cool concept called Kite, which it would take your code
and it would take a lot of stuff you would do as a developer on your system and it would
add smart, right?
It would add auto-completion even where there wasn't and these types of things.
But it turns out there was a few drawbacks just conceptually around it.
But there's also a bit of a toss-up about actually their behavior.
What's up with this?
Yeah.
So I was, especially because we had covered it, my reluctance to this product to start
with was that they would, it's all cloud-based stuff.
So they would send your code in order to give you hints and stuff.
It would send your code to their company.
And then, and you just kind of have to trust that they're not going to do anything evil
with it.
Yeah.
I was a little reluctant at that as well.
Like if, when I was playing with it, I put it on a section and you can say this subset
of your hard drive, it can like interact with.
And I gave it a section where I didn't have like things that had, you know, API keys and
stuff.
It was just like me playing around, but still it is a bit of a hesitation, but that's not
really what we're talking about, is it?
No.
What we're talking about, there's a article that came out on, I'd never seen this site before
the outline.com, which is a article called how a VC funded company is undermining the open
source community.
And it's, it's about some underhanded or at least some accusations of underhanded tactics
by kite.
So here's the story is it's about two add ons to Adam, the text editor, Adam.
And one of them is a mini map, which is I'm supposedly downloaded over three and a half million
times.
So it's well used and it's developed by one person.
And I'm guessing mini map is similar to the, like the map feature and sublime or something.
But the one developer, Abe 33 was hired by kite.
And then after being hired by kite inserted a, or updated the plugin with, with a kite promotion
feature.
That was actually the get law, the get commit log was added kite promotion
feature or something like this, right?
Yeah.
And the feature was to insert web links or links back to articles on the kite website related
to the content of a user's code.
So read the code, figure out which article would be relevant and put links.
I'm guessing the links go in the mini map and not actually inserted in your code, hopefully.
But the users were rightfully kind of ticked about this and said, this isn't a feature.
This is just blatant advertising.
Well, I think there's two levels here.
On one hand, the person who added that feature was the creator of the product, right?
So that's not great.
If, if some other random person had come along and inserted this promo stuff into someone else's
open source project, that would have been flat out terrible.
This is, let's say a little shady, I would say in, in the spectrum, in my mind, this is
like, it's not, there's, there's no point.
Well, there's very small points where this is actually going to benefit the users other
than the one user who is kite.
Yeah.
Now, if it was possibly suggesting like lots of different articles from different, like
different websites, it still would be weird.
It's a, it's a completely unrelated thing feature of it.
I don't know.
Yeah.
The, the next one is a, it's, I had to look it up, but it's another Adam add-on,
which is a autocomplete Python.
So that definitely relates to Python, but it, it didn't insert advertising, but what
it did do was it had the autocomplete was done using a local engine on the user's computer
called Jedi.
And it got switched at one point to default to the kite engine, which is a cloud-based
engine.
So it would send all your code to kite.
Kind of, if somebody updated that plugin, wouldn't they would, I don't think they would
know that that was going on.
Yeah.
How would you even know?
Right.
I mean, look, the autocomplete still working.
Oh, wait.
It's because my code's no longer on my machine.
How strange.
And apparently this wasn't done by, I'm not sure who put that feature in, but the article
suggests that instead of a purchase of the, or a hire by kite, it was just a bunch of kite
people were working on the plugin also and added this.
Again, users aren't, a lot of users weren't exactly supportive of that change.
And it is a bit weird.
And basically that's, I think the point of this article is to point out that we've got
a lot of, a lot of open source projects that are used by a lot of people, like a whole lot
of people.
And it only takes maybe one person, a core person to be corrupted or influenced to basically
make the package benefit a single company instead of the rest of the world, which yeah, it's
problematic and interesting.
Yeah, it's definitely raises some interesting moral issues around open source.
And what does it mean to make these types of changes when there's 3 million people already
using your product, especially if those changes are invisible, if that means like privacy changes,
like your code is now going and being analyzed outside of your control rather than when you thought
it wasn't, things like that.
Yeah, like that autocomplete thing.
What I guess I would have expected as an open source user is I don't care really if
a company has a, has a open source projects that, that they're maintaining that benefit their
company.
We're kind of used to that and, and that's not terrible, but it's very out in the open.
So I would kind of would have expected them to like fork that project and have a different
autocomplete project that would go to the kite instead of using Jedi.
That would have made more sense to me.
Right.
Then you opt in.
Yeah.
If you opt into it, you get better autocomplete.
You might make that trade off.
Right.
Yeah.
But anyway.
Yeah.
Anyway.
All right.
Well, there it is.
Everyone else, everyone can read it for themselves.
It's a pretty interesting article there.
So something I am much more comfortable with using on my projects is rollbar.
So you guys probably heard us talk about rollbar before.
It's super easy to integrate into your system.
You just pip install rollbar and plug in your account key and you're basically ready to go.
The idea is it will look at your code, especially your web apps while it's running.
And if there are any errors, it will capture all the details about the errors, send it up
to the cloud, send you notifications like the Slack, or you can get like emails and things
like that.
And usually don't even have to debug your code.
You can just log in, see all the variables passed, the whole call, you know, call stack,
things like that, and just go and fix it.
So half the time, it's really important to be notified right away when an error is happening
rather than letting it go on for hours.
And finally, somebody will vaguely send you a message like this button doesn't work anymore.
What do you mean it doesn't work?
So pip install rollbar and you'll be ready to roll.
Check them out at pythonbytes.fm/rollbar and use it on pythonbytes.fm and other sites.
It's great.
So thanks, rollbar.
Thank you, rollbar.
You know, the news has been, journalism in general has been more interesting in the last,
six months, I would say, than it traditionally has.
Yes.
And the thing that I want to talk about is like, let's say it may be a specialized screen
scraping type of library called newspaper.
So this is a Python package, pip install newspaper type of thing.
And the idea is you can point this at a URL for say like CNN or MSNBC or New York Times or something
like that.
And it will give you very detailed information that you might care about for news articles.
Have you heard about this, Brian?
I haven't.
Yeah, this is really slick.
So you create, I'll just give you like a little sense of the code because there's just a few
steps.
You're like, wow, that's sweet.
So you create this article object and you pass it, the URL to like some news item.
You can download it and it'll just give you the content.
You can parse it.
And then you can ask it things like, who were the authors?
And it will just give you a list that are just the names of the authors that already discovered.
You can ask it when it was published.
You can do NLP, natural language processing on it.
Just that's a function.
Call that.
And then you can ask, what are the keywords?
Give me the summary of this article.
What is the cover image of this article?
All sorts of stuff like that.
This is really cool if you work with like a news type data.
Yeah, this is great.
Isn't that cool?
I mean, if you, yeah, especially if you, I guess you tie it to other ways, you're going
to get different news articles to be able to parse some of this as a kind of little service.
It'd be cool.
Yeah.
And I don't remember where you pointed to to get started, but you can also say, what are
all of the articles on this new site?
And then go ask these questions about each article and things like that.
So it's, it's, it's pretty slick.
I like it.
Yeah.
It's a little bit of that import anti-gravity type thing.
That's right.
Definitely.
I typed a few lines and it's rolling.
And speaking of that, that might be.
But before we move on, the code example you talked about, you, you put it
up on our show notes and it really is just like 17 lines of code.
It's pretty short.
So.
Yeah.
And like half of that is like showing you what's printed out.
Yeah.
Maybe not half, but some of that.
So this sort of really, this, this ability to grab these packages and do amazing stuff
in a few lines of code.
Maybe that's why Python's popular.
What do you think?
Yeah.
I think so.
And, we've gotten, there's an article from I triple E spectrum called the top programming
languages of 2017.
And big surprise.
We're number one.
Yay.
We're number one.
Woo.
Yeah.
It's, it's really cool.
And it's number one in a lot of interesting ways.
There's actually five measures for which mean anything to me.
One, one measure is the I triple E spectrum rate, ranking.
One is trending.
One is jobs and one is open.
And so it's kind of, you can go over to this like an interactive thing.
The I triple E spectrum rating is all around.
Trending is languages that are growing rapidly.
Jobs are languages that are in demand by employers and open is popular on open source hubs.
Yeah.
You can also dig into it by embedded devices and things like that.
And it even, this is an interactive thing.
You can even like customize your ranking if to, for what's important for you, which is kind
of fun.
Right.
Like I care about enterprise development and jobs or something like this.
And you can like narrow that down.
It's definitely interactive.
So let me give you the, let me give you the numbers, Brian.
So for trending, number one is Python close behind a C and C++ and then Java.
So, and Swift is there as well.
And then for jobs, actually Python is number three, but just like by 0.7%.
So it goes Java C and then Python.
And then for openness, Python is way back on top and then custom that, whatever that means.
You gotta let's make your own.
Yeah.
And I, my comment, I think that the reason why there's more Java jobs is because there's
a whole bunch of Java programmers shifting to Python.
Right.
Like there used to be a lot of COBOL jobs, but not COBOL's growing.
It's because people got to keep that stuff going.
It's COBOL's still on the list.
Wow.
It's 24th in jobs.
Yeah, man.
That puppy's hanging in there.
Oh, poor people.
Yeah.
But assembly is like 11th.
Wow.
Okay.
Anyway.
Interesting.
Yeah.
So there's all these different, all these different measures and rankings and they all
take different things into account.
So you got to take that with a bit of a grain of salt.
But the one trend that seems to appear across all of these is Python is very high on the list
and is growing more popular or higher up on the list.
So that's a great thing for betting your career, your next bit of career and your energy on focusing
on Python, I think.
Yep.
And also, I, I, I, E is respected by a lot of people, but they also right here open,
openly show you what, what they used for their methodology of how they rank things.
And, and it's a, it's not nothing surprising combination of Stack Overflow and trans and
Twitter and, and including articles in their IEEE explore digital library.
So that's a nice, not surprising, but it's cool that they just show you what all those
are.
Right.
So when they say it's popular in jobs, that means cause they're crawling Stack Overflow
jobs, probably career builder dice, those types.
Yeah.
I didn't know dice was still around, but no offense to all the dice.
My space is still around.
My space.
AOL is still around.
Okay.
So last thing I want to share with you guys is recently the SciPy 2017 conference happened
in Seattle here in the U S and like many of these conferences, the videos and tutorials were
recorded, put on YouTube and you can go check them out.
So there's a ton of tutorials.
If you want to get into data science, the keynote was something I haven't had a chance to watch
it yet, but it sounds really interesting.
Coding for science and innovation.
Like who wouldn't want to do that?
That sounds awesome.
Yeah.
Then we've got dash, which we've talked about.
You've talked about before a new framework for building yours, a user interface and technical
computing stuff.
And then a similar spelling, totally different thing is DASC for like parallelized processing
data pipelines.
We've got scientific analysis at scale, a comparison of five systems with Jake Vanderplass and academic
open source, which I think is pretty cool for groups, people in that area.
So tons and tons of videos.
These are just a few I grabbed to give you guys a flavor of what's out there.
Yeah.
That was in Seattle.
Yeah.
I wish I would have gone.
Yeah.
I know I was planning on going, but I couldn't quite make it.
Yeah.
I'm glad that you hectic at the time.
I'm glad the videos are out there.
I'll have to check some of those out.
Yep.
And I think I just got a notice that PyCon Canada call for proposals opened today or yesterday.
So speaking of conferences, if you want to speak at the other major, major Python conference
in North America, it's time to submit the proposals.
Do you know which Canada it is?
The left Canada or the right Canada?
I think it's the right Canada.
It's in Montreal.
Okay.
Yeah.
All right.
Well, that's it for our news, Brian.
Anything else you want to share with everyone?
I am closingly done, almost done with the book.
I wanted to try to get it done last night at midnight, but I've got a few hours left, but
I'm super excited to get the Python testing book out to everybody.
Yeah.
And that's been a big success.
People are responding well to it.
So congratulations.
Thanks.
Yeah.
How about you?
Nothing too new.
Just cranking along.
Yeah.
Bunch of stuff's going on.
Enjoying summer.
Enjoying working on Python stuff, but nothing specific.
Speaking of summer, you've got a vacation coming up.
I do.
I have a semi-work travel vacation, more vacation-ish stuff.
So I'm going to be out for four weeks, probably not next week, but the week after.
So we're going to see what we can do about lining up some guest co-hosts.
Keep the show rolling.
No concrete details there, but there may be.
Yeah.
At the very least, we'll have one more episode and there may be a gap, but we're going to
try to not have a gap.
We're going to try not to have a gap.
That's right.
We'll see what we can do about recording either on the road or wrangling some people
into being a co-host.
So we'll see.
We'll keep it rolling as best we can.
All right.
Well, thanks, Brian.
Thank you.
Thanks, everyone, for listening.
Yep.
Bye.
Thank you for listening to Python Bytes.
Follow the show on Twitter via at Python Bytes.
That's Python Bytes as in B-Y-T-E-S.
And get the full show notes at pythonbytes.fm.
If you have a news item you want featured, just visit pythonbytes.fm and send it our way.
We're always on the lookout for sharing something cool.
On behalf of myself and Brian Okken, this is Michael Kennedy.
Thank you for listening and sharing this podcast with your friends and colleagues.