As a software developer, what's the most important application on your computer?
If your answer is Microsoft Outlook, my heart goes out to you. Stay strong. But for most of us,
it's probably a toss-up between our web browser and code editors. And for editors, there's basically
two camps. There's the lightweight, smart text editors such as Vim, Emacs, and Sublime Text,
and heavyweight but highly functional IDEs such as PyDev and PyCharm. This week, you'll meet
Dmitry Trophimov, who's one of the main developers behind one of my favorite editors, PyCharm.
This is episode number 36 of Talk Python to Me, recorded November 11, 2015.
Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the
ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter,
where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm,
and follow the show on Twitter via at talkpython. This episode is brought to you by Hired and OpBeat.
Thank them for supporting the show on Twitter via at Hired underscore HQ and at OpBeat.
Hi, everyone. Thanks for listening to this episode. I have a few quick comments before we get to the
interview. Some of the features we talk about are better understood visually rather than described
in audio. And for that reason and others, I decided to write a blog post visually highlighting
some of these concepts. This post is called Nine Reasons You Should Be Using PyCharm. If you're
interested, check it out at bit.ly slash whypycharm. Last but not least, the PyCharm team at JetBrains
offered to give away three annual subscriptions to PyCharm Professional. I'll do the drawing Monday,
December 7th. That's a week from the release date of this podcast. All you have to do to be eligible is
become a friend of the show. Visit talkpython.fm and click Friends of the Show in the navigation
bar and sign up. Now let's get on to the show. Let me introduce Dmitry. Dmitry Tarfimov currently
leads the development of PyCharm, a popular Python IDE by JetBrains. Dmitry is passionate about
automation and software tooling. Before PyCharm, he implemented many different tools for a variety
of companies, including a visual site scraper generator, a model to code mapper, and even a
generator for hardware used in submarines. In his spare time, he's a committed running enthusiast
and triathlete. Dmitry lives in Munich, Germany. Dmitry, welcome to the show.
Hi, Mike.
Hi. I'm really excited to talk about PyCharm and JetBrains and editors and tooling for Python
with you today. It's going to be great.
Yeah, sure. Thanks for inviting me.
Yeah. So before we dig into all that, let's start at the beginning. How'd you get into
programming in Python? What's your story?
That was long ago, actually. My first programming experience was when I was something about seven
years old. Back then, I had a ZX Spectrum computer and it was possible to program it with Sinclair
BASIC. So I read a book about programming in BASIC and found some source program inside the book.
And this program is supposed to do something cool. So I sit down and typed all the program into the
computer, actually without full understanding how does it work. I was seven and I typed quite slow.
So it took like, I don't know, like an hour or something to type that program in. And after I
finished, I felt relief. But then when I tried to run it, it just failed. You know, so it didn't start.
And I had no clue why. The error message was totally unclear for me. And it was very frustrating. Nobody
could help me because I was at home alone. And I felt like I was betrayed by the book, which I trusted.
So yeah, maybe if I have started to learn programming today with Python and PyCharm, for example, I would have
much more pleasant experience. At least Python is a much, much better language. And PyCharm would hint
me about which error I had and which is more important to where it was. So yeah, maybe. But my programming
story didn't end there, obviously. Several years after I went into a computer class where I learned how to
program Pascal, there was a brilliant teacher and Turbo Pascal IDE. And I learned step by step. And
at some point, I realized that I can do computer programming in Pascal. Maybe that's why I'm a fan
of IDEs because of Turbo Pascal. I don't know. Maybe that could be an imprint for me.
Was it a young, impressionable programmer?
Yeah. Awesome. So how'd you go from Pascal to Python?
Actually, from Pascal, I converted to Java directly. So it was C and Assembler in the middle somewhere.
And then I've been doing a lot of Java. And at some point, I realized that I need to have a scripting
language in my toolbox. But I couldn't choose which one. And I wrote one small project in several
languages just to be able to compare them. I took Groovy, Ruby, Python, and Perl. Perl was a total disaster.
But others were more or less equal. But I remember my impression from Python. That felt pretty much like
all other languages. But at the same time, very different from them. And everything felt
reasonable and easy there. And I did like that. So since that, I used Python from time to time.
And then I joined JetBrains to make a new IDE for Python called PyCharm. It was in early beta. And so I'm
working on it till now. It was five and a half years ago.
That's really excellent. And I've never heard people choosing a language the way you just described
it. But it's such a good idea to say, look, I'm interested in learning this type of language. And it
looks like there's these choices, four or five or six or whatever. And the idea of writing a simple
program in each and then comparing the experience, that's really cool. I think more people should adopt that.
Yeah, I gained a lot of experience doing that. And it was fun.
Yeah, I always kind of just gone with, you know, do the research, see what's popular, what are the capabilities,
what are the pluses and minuses, and then I'll just dive into one and just try to learn it. I never did sit down and like,
do a bunch together and compare and contrast. That's cool. PyCharm. Before we get into PyCharm,
maybe, you know, when I think about the company that makes PyCharm, JetBrains, where you work,
I see you guys as one of the premier, if not the premier, developer tool companies out there.
Can you maybe just talk a little bit about what is JetBrains, what type of apps and products you build?
Yeah, sure. JetBrains is a company that makes tools for software developers, as you said. And
currently, there are more than 500 people working there. And we have offices in St. Petersburg,
Munich, Prague, and Boston. So the two biggest development spots are in St. Petersburg and Munich.
And yeah, we make tools for software developers. And actually being ourselves software developers,
this allows us to make really good tools. You know, there is a culture in JetBrains that everybody
writes a code. Even our sales, they do program a lot, actually. So the company grows, but this is very,
this is amazing that this culture stays. And talking about our products, of course, we have
many ideas like PyCharm, IntelJ IDEA, RubyMine, PHPStorm, WebStorm, CLion, AppCode. So for
basically for most major and popular languages, even if there is no IDE for a language, there should be a
plugin that is maintained by JetBrains or third parties. So the IntelJ platform is quite, quite
diverse and solid. Yeah, that's, that seems to be kind of the foundation of most of your IDEs. I kind of see
you guys as the company that looks at what other software development systems are doing or build
that and fixing the problems. Like, you know, Microsoft makes Visual Studio and it has, it's not bad, but it
has these issues. And so you guys make ReSharper. Yeah, exactly. Exactly. And then, you know, Apple makes,
Apple makes Xcode, but you're like, oh, this is not so great.
Yeah.
If they're willing to have the time and energy and interest to actually learn the tools.
Tools are very important.
I wanted also to add that many people know about our ideas, but less people know that also we create other tools for software development.
So we have a range of server-side tools.
It is continuous integration called TeamCity.
There is a bug tracker called Utrek.
And there is a code review tool called AppSource.
And we even make our own GVM programming language called Kotlin.
So every area of software development, we try to make a product in this area.
And actually, we use this product.
And this allows us to make it good.
Yeah, if you don't use the thing you're building, then you just...
Yeah.
It's just not good, right?
You have to use the thing that you're building to make it truly excellent.
Sure.
All right.
So like I said, I think most people know PyCharm.
But maybe give us the 30-second elevator pitch.
What is it?
PyCharm is an IDE for Python.
There are two editions of PyCharm.
The first is PyCharm Community Edition that is free and open source.
And it provides all basic functionality without any limitations.
And there is a professional edition.
It's not free, but it has many features, especially for professional development, like support for web technologies.
There's many languages, like HTML, CSS, JavaScript, different JavaScript frameworks, Python web frameworks, like Django, Flask, Pyramid, Web2Py.
And a lot of functionality, like working with databases and working with code on remote environments and profiling code coverage.
So this is all in professional edition.
Yeah.
And you also have some cool database integration that I think we'll come back to in a little bit because it kind of blew my mind when I saw it.
So I'm interested to ask you about it.
One of the things that's cool about PyCharm, I think, is that it's really cross-platform.
Yeah, that's true.
PyCharm, as well as IntelliJ platform, is implemented in Java.
So it basically runs everywhere where GVM can run.
There are some parts that are native, but they are not essential for the main functionality, actually.
And there are three operational systems that are officially supported.
It is macOS X, Linux, and Windows.
But actually, I know that our users even managed to run PyCharm on some environments like Raspberry Pi.
And, you know, it's funny because we have issues in our tracker that sound like it's great that I could run PyCharm on Raspberry Pi.
But unfortunately, embedded terminal is not working.
So, yeah.
So in that case, we just answer, okay, sorry for that.
But embedded terminal is also open source.
So you can port it to Raspberry Pi, send us a pull request, and something like that.
Yeah, that's really funny.
The fact that it runs on Raspberry Pi at all is pretty awesome.
People are saying, oh, this part doesn't work.
It's like, did you really expect it all to work?
But yeah, that's cool.
That's cool.
I've seen somewhere, I think I even sent it on Twitter not too long ago, somebody had it running inside of a Docker container.
Yeah, that's crazy.
That's crazy.
We just added support for Docker in the latest version.
And so it was also a response like, oh, that's great.
But what I want is to run PyCharm in Docker and then run containers from PyCharm.
Yeah, it was, it's very nice.
Actually, I don't understand this scenario yet, but I think I will try it myself.
Yeah, it's probably just because you can, right?
But when you guys announced support for Docker, that's like, you can create Docker containers that run your apps,
not you can run PyCharm within Docker containers.
But, you know, I guess someone got that working, which is cool.
Yeah.
So you said there's like 500 people at JetBrains.
Yeah.
Yeah, how many people are actually part of the PyCharm initiative?
There are 14 people working directly on PyCharm.
PyCharm is built upon Intel J Platform.
So if we count those people, so it adds like from 50 to 60 people more that are contributing directly to Platform.
But actually, that is not very easy to count because there are a lot of people who work on different IDs.
For example, WebStorm.
All functionality of WebStorm comes with PyCharm Professional Edition.
So do we count as an Intel J Platform or not?
So that's difficult to measure.
Yeah, there's a lot of intersection between the different IDE teams like AppCode and WebStorm.
So, yeah, I can see that that's tricky.
Okay.
So it's a pretty large team, full-time team working on PyCharm, yeah?
Yeah.
By the way, we're proud that we have a proportion of girls and guys like 50-50 almost in our team.
That is really excellent.
Cheers to you guys.
That's great.
So when I run PyCharm, you know, as Sid, it's built on Intel J.
Like how much of the thing that is running that I'm working with is PyCharm and how much of that is just Intel J with like a little understanding layer back into Python?
Actually, all the Intel J Platform is built that way that it is a language agnostic.
So it's like a framework upon which you can write a parser and inspections.
But there is actually no that strict separation.
When you're getting started, there's different ways to get started in Python, right?
One way is to just type Python in your terminal or command prompt and then start entering stuff into the REPL.
That's probably the least productive thing you can do, although it's the easiest to get started, right?
Like you can create variables and import modules and things like that, right?
And then as you go up, you know, there's stuff like editors like Vim and Emacs and Sublime Text where, you know, they're really nice editors,
but they don't necessarily help you understand the standard library and things like that necessarily.
And then you've got PyCharm, which can help you with the language.
Where do you think people should start?
What are your thoughts?
Is there a lot of value in starting sort of with no support?
Or do you think it's more helpful to have like a really helpful environment, even if you don't necessarily learn some of the details right away?
I think that the supportive environment is beneficial, actually.
It even can help you to learn the language and it assists you.
So I would prefer to start with an IDE.
You know, we're both sort of self-selecting in that sense as well.
But I kind of agree with you that, you know, it's great to memorize the API for things like requests or the string library.
But, you know, if I can just hit dot and type T and it shows me all the other options that maybe I'll have on strings, you know, that's really helpful, right?
As a new person.
Yeah, sure.
And you do memorize them, actually.
Because it just takes less time when you see it in code completion, not in Google, for example, or documentation.
So you get information faster and you do memorize it.
There's some cool plugins that I want to come back to later to talk about that as well.
But another thing that's really challenging can be creating new types of projects.
So if I want a new Flask website based on Bootstrap or I want a Pyramid website based on the starter template or something like that.
Can you talk about, like, sort of what the types of projects you can create in PyCharm as, like, starter projects?
Yeah, sure.
It's mostly all type of Python web framework.
So it is Django, Flask, Pyramid, Web2Py, and also all kinds of pure web projects.
Actually, the main project that you can create in PyCharm is pure Python projects.
So you can just start with that, for example, and then you can add everything that you want.
If you know that you are going to develop Django projects, then it's better to start with Django projects from the start.
Because everything will be configured and you will have a template.
Yeah, I think one of the things that people struggle with, and as you get experience, you forget that it's actually really hard.
You're just like, oh, that's a little bit of extra work.
But in the beginning, it can be really hard.
So, you know, suppose I want to get started with Pyramid.
Right?
Well, to get started with Pyramid, I can't just, like, create a file and start typing, you know, create my WSGI app and here's my handler configurations and so on.
I have to pip install Pyramid and the various dependencies.
And then I've got to know to use, like, pcreate, the thing that will generate the template starter code or, of course, write it from scratch, which is a lot of work.
And that will generate a whole bunch of stuff, a whole project structure.
And then I've got to run, you know, the setup configuration stuff because it's all treated like packages and so on.
And I think people that are experienced with Python sort of forget how non-obvious that part is, right?
But having it just as a thing you click, I'd like a new Pyramid app, and all that stuff happens.
You know, that's really cool.
I think that's one of the things that's nice about, like, creating new projects with PyCharm is a lot of that configuration stuff and dependency stuff is handled all in one shot.
This episode is brought to you by Hired.
Hired is a two-sided, curated marketplace that connects the world's knowledge workers to the best opportunities.
Each offer you receive has salary and equity presented right up front, and you can view the offers to accept or reject them before you even talk to the company.
Typically, candidates receive five or more offers in just the first week, and there are no obligations ever.
Sounds pretty awesome, doesn't it?
Well, did I mention there's a signing bonus?
Everyone who accepts a job from Hired gets a $2,000 signing bonus.
And as Talk Python listeners, it gets way sweeter.
Use the link Hired.com slash Talk Python To Me, and Hired will double the signing bonus to $4,000.
Opportunity's knocking.
Visit Hired.com slash Talk Python To Me and answer the call.
True.
But also, you can start, you're going to go step-by-step with PyCharm.
So you can just create pure Python project, or you can just open a directory and create file there, and then start typing something.
And when you have a user's name, PyCharm will offer you to install this package from PyPI, so you can do that.
And it's not that strict that if you develop a pyramid, you need to start from a pyramid project and generate everything.
Right.
That's true.
So it's possible that it's helpful for you, but if you already have a pyramid website, you can just grab the directory.
Yeah, yeah.
Sure.
Throw it on PyCharm, then it'll sort of be as if you had created it, right?
Yeah.
PyCharm will understand the structure of your project so that it is actually a pyramid project and will configure pretty much of everything.
I don't really want to necessarily just go through all the features of PyCharm, but maybe you could talk about a couple favorites.
Like, for example, I think my two favorite features in PyCharm are the sort of smart IntelliSense, right?
So I get code completion across all the files in my project, as well as all the packages that I've installed in my environment and the standard library and so on.
So that sort of IntelliSense is really cool.
And then the sort of navigation stuff, right?
So I can say, oh, here's the function being called on some object.
Take me to its implementation.
What are your favorites?
Actually, I also like IntelliSense and navigation, but my favorite is definitely the debugger.
I don't know, maybe since those days when I wrote Pascal and Turbo Pascal at DEI, I always like the ability to dive into a running program and see what is actually happening there.
Yeah.
So, and I'm proud that PyCharm has a very solid debugger and we even have some almost unique features like debugging of sub-processes and debugging of applications on remote environments.
I like this part most.
Actually, we have quite good version control support, JIT support, for example.
So it's not bad.
I would even say amazing, but it could be considered a bit immodest for a JIT brain person.
But yes, I like our JIT integration.
And my favorite feature there is ability to compare different branches in JIT log.
Okay.
Yeah, that's pretty awesome.
Local history.
I'm sorry.
So for interrupting, local history is amazing also.
Yeah, I was definitely going to say, if you're talking about version control, this idea of local history is cool.
Let's take a step back for a minute and dig into the other ones just for a moment.
And then I want to talk about local history because that's really awesome.
So how do you guys do IntelliSense for Python?
Like how does that work in a dynamic language?
How does it work?
IntelliSense in PyCharm works that way that when you write your code in PyCharm, it's parsed in real time.
And analyzed this way that PyCharm tries to understand what is your goal and how to help you the best way.
So it offers you code completion.
It reformats your code.
It inserts correct indentation, for example.
So it highlights, of course it highlights syntax errors.
But beyond that, it also tries to warn you about some errors that are not so obvious.
So if, for example, you reuse a variable that you iterate through in a cycle or if value could be undefined, how is it implemented?
Well, more what I'm thinking is, you know, when I write Python code, I don't ever declare a type.
I don't say, you know, int x equals 7.
I just say x equals 7.
And, you know, sometimes it's really obvious, right, when you declare it just like that.
But sometimes, you know, there's a long chain of events that leads to data being passed from one stage to another, to another, to another, to another, to finally being assigned to a variable.
And it seems like you guys do a really good job of actually knowing what that's supposed to be.
Yeah, we try to infer types for variables.
And we do it quite, quite good.
So it's called data flow analysis.
When you write your code inside a function or a method, we trace the types of all the variables.
Yeah, I think that's really awesome.
And I think that's one of the benefits over things like Sublime Text, where if it sees you use some function or property of something that looks like an object above,
it'll sort of then suggest it later as IntelliSense, but it doesn't really understand, like, the way the whole program fits together.
It's missing a lot of the cool stuff that you guys have there.
I know you just announced support for Python 3.5.
True.
And that includes this thing called Python Type Hints.
Yeah, actually, PyCharm team participated, was involved, actually, in the process of elaboration of this proposal.
That's really cool.
Maybe before I ask you a question about it, maybe you could tell everyone what those are.
There is a PEP 484, so-called, this is initiative adding a declaration of typing into Python.
So before there was no standard way to annotate types.
It was something starting from Python 3, but it was very limited and couldn't be used extensive.
In Python 3.5, Gubito Warren Rossum came up with a proposal of elaboration of standard notation for annotating types for arguments and variables.
Yeah, so maybe an example would be I've got a function, sayHello, right?
Maybe the function is called sayHello, and you give it a name and a time of day.
How would I use type hints to maybe indicate that the name is always supposed to be some kind of string,
and the time of day is an integer or something like this?
You write for a date, you write a semicolon and then a date type.
And to annotate the return value, you write an arrow, so it's minus, greater, and you write a return type.
And actually, the main thing here is that those types don't influence the runtime.
So they are only for tools like PyCharm and for checkers, for different linters, to validate your code, to find errors.
Right, of course.
Yeah, so the type hints don't really change anything about how Python works as a language or an execution environment.
But, you know, the reason I think they're interesting is for people like you and other refactoring tools and, like you said, linters.
What do you guys think about type hints in Python?
You're a fan of it?
Actually, I see it a bit controversial because, in some sense, it kills the spirit of Python.
But I would not prefer that all the Python sources become full of type annotations because it would be not Python.
It would be something different.
But still, that is obvious that there is a need to annotate standard libraries.
And in this PEP 484 proposal, there is a way to annotate types not in your source but in separate header files.
And I think that would be beneficial if every developer of a popular library would, other than writing code,
would make this type annotations for users of his library because it will leverage the usage
because people would be able to use tools with code completion.
And it would be much, much easier for them to learn the library.
So I think this is the way to go, but it should be taken with care.
Okay, I think that's a really good recommendation.
Like, maybe when I go to write code, if I'm just writing an app for myself,
maybe I don't bother to do any of these type hints.
But maybe the libraries that I'm consuming, especially the standard library,
if it had those annotations, then that makes it much easier for me to kind of know what to do,
for linters to say, oh, it looks like you're passing a double, it expects an integer,
or something like this, right?
Yeah.
The greatest accomplishment of PEP 484 and Python 3.5,
in the long run, there is a standard notation.
So it's fixed now, and it's quite advanced to express pretty much everything about types.
Yeah, I think you're right that this is going to be a controversial feature of the language.
But it's going to be interesting to see what happens over time, you know?
Yeah.
Because before, why it's important to have this standard notation,
in PyCharm we had our own notation, actually,
because we're dealing with the type inference,
we had to annotate some parts of standard library on different libraries
that could not be inferred.
So we had to annotate them,
and we came up with our own notation,
and it was not very good to invent your own will.
So the PyCharm team actually has,
before the type hints came along,
you had done something else that is kind of like type hints
for the standard library,
just so that PyCharm could work correctly.
Is this true?
Yeah, that's true.
We had to do that to be able to annotate standard library
to provide type inference in PyCharm.
And as far as I know,
Google had their own notation and set of type annotations.
So now it's great that we can merge our efforts,
create a common repository of type annotations.
Like there is one for TypeScript, as far as I know.
So I think that that's a move in the right direction.
Yeah, that's definitely a move in the right direction.
Okay.
So yeah, it's going to be interesting to see what happens
with this whole type hints thing,
because in my mind,
it's really for people like you that are building tools to help us.
And maybe when we're writing code,
maybe type hints are just a thing
that make our life a little bit better
because our tools are better.
Yeah.
Maybe that's how that works.
Sure.
In PyCharm, you can run both Python 2 and Python 3.
You also have really good support for virtual environments
and virtual hints and things like that, right?
You can actually, within the tool,
say I'm going to create a new project.
And as part of creating this project,
set up a virtual environment
based on either Python 2 or Python 3 or whatever.
What other implementations do you guys support?
Like do you support PyPy?
Sure, yeah.
We do support PyPy and we support Jython and IronPython.
Interesting.
I didn't realize you supported IronPython.
I guess that would be a Windows-only feature, wouldn't it?
Yes, true.
Yeah, since .NET, at least in that variation of it,
only works on Windows.
This episode is brought to you by OpBeat.
OpBeat is application monitoring for developers.
It's performance monitoring, error logging, release tracking, and workflow in one simple product.
OpBeat is integrated with your code base
and makes monitoring and debugging of your production apps much faster and your code better.
OpBeat is free for an unlimited number of users.
And starting today, December 1st,
OpBeat is announcing that their Flask support is graduating from beta to a full commercial product.
Visit opbeat.com slash Flask to get started today.
So another thing that I think is cool is I can go to my project and go to my project settings in PyCharm,
and it will show me, regardless of whether I'm using like a system-level Python
or I'm using like a virtual environment that was created,
it will show me all the packages that have been installed from pip and their versions
and whether they're upgrades that I could potentially install and things like that, right?
Yeah, true.
That's right.
I remember when I was new to Python, I found that really helpful
because you could go there and it's got like a little search dialogue
and you can say, find me my package and then click to install it.
And it'll kind of automate a lot of that stuff for you.
Yeah, and you even can install it from your editor.
If you have any Resolve import, you can just press Alt-Enter, for example,
and PyCharm will install this package to your active Python app.
Yeah, yeah.
So maybe let's talk about Alt-Enter for a little bit
because Alt-Enter is definitely one of the things that makes PyCharm unique in my mind, right?
So when you see problems in code or PEP 8 violations
or maybe an import of a package that lives out on PyPI
but is not actually installed into the environment that you have active,
PyCharm will suggest fixes, right?
Right. In most cases, you just press Alt-Enter and PyCharm will fix it for you.
Yeah. So like, for example, if I say import requests
and then I start typing things and I don't actually have,
say I'm in a virtual environment and I don't have requests installed in there,
it would say, hey, here's a package you're importing
and we know about it.
We know it lives on PyPI, but you don't have it installed.
Hit Alt-Enter and we'll just install it for you.
Yes, that's true.
Or, you know, import the module if you've got it in your environment
but it's not actually, the import keyword is missing or whatever.
Very cool.
Yeah.
Yeah. I just think constant watching of, hey, how can I help you, right?
A lot of times as programmers, we're dealing with lots of details
and we're putting pieces together just so, right?
Like I've got to make sure I've got this package and its dependencies installed
and I've got to have this import keyword up here just so.
And, you know, I think a lot of the mental juggling that we have to do can go away
if you have some kind of editor that says, oh, we've noticed that you didn't connect this piece here.
Hit Alt-Enter and it's connected.
You know, like we realize you may have pip installed some library
but you didn't type import at the top, for example.
Yeah, that's very handy.
I cannot even imagine how to program without it when you get used to it.
So it's difficult.
It totally is difficult.
And, you know, I do a ton of Python programming, of course,
and the other work that I do is typically in C# and Visual Studio.
And I have exactly the same feeling when I'm over there.
Like if I don't have V Sharp or I'm like, oh, this thing is just partly broken.
Yeah.
How can I continue to work in this area?
Yeah, this is barbaric if I have to go to the top of the file and type import or, you know,
using or whatever, depending on the language.
Yeah, that's awesome.
So one of the things that's super important in dynamic languages like Python is, you know,
since there's no real compile step, there can be errors that are just not detected, right?
Maybe even something as simple as a compiler would have detected it.
But because it's not ever compiled, which is, you know, working out really well for Python,
but it means those errors don't get caught.
So typically having some other way to catch them, like unit testing, is really good.
Sure.
Unit testing is a...
Do you guys have built-in support for unit testing?
And like code coverage and stuff like that?
Yeah, sure.
Unit testing, I think, is a basic thing when you deal with dynamic language.
And yes, of course, PySharp has support for unit testing.
And we support actually different test runners, not only unit tests, but nose tests and py tests and AT tests.
What you can do is you can run your tests from PySharp and you will see the results in a nice formatted tree.
And you can navigate directly to source to see stack trace.
And of course, you can debug your tests.
You can profile them.
You can see coverage results.
Almost everything possible, what you're going to mention.
So profiling is interesting.
On show 28, we did a show about profiling Python sort of from the command line.
And about that same time, I saw that you guys actually announced profiling support for PyCharm.
And that's pretty excellent.
I've not had a chance to try it yet.
How does that work?
Can you walk me through what I learn if I do profiling and how I do it in PyCharm?
That's actually pretty simple to use.
You just press the profile button for your run configuration.
And your process is executed with cprofile injected.
And as long as you want to capture a snapshot with your profile data, you just press the button capture snapshot.
And it's shown in PyCharm with statistics of what method, statistics for all functions, how long did it take for them to launch.
And actually, we have a nice visual representation in graph form where the hotspots are colored with red.
And you can just see what is slow in your program.
Yeah.
The whole visual component of it, I think it's really important.
Yeah.
And unfortunately, just after we made the first attempt of making the integration with cprofile,
it appeared that it's too limited and too basic to add features.
And it was like a pity that there were no really good profiling backend for Python
because cprofile doesn't provide you a lot of information.
But hopefully, this summer, PyPy team has announced VM prof profiler.
That seems to be much, much better and more advanced as cprofile.
And we plan to integrate this one in PyCharm as long as it will support macOS X and Windows.
But they have plans to do that and we can collaborate together to make this happen.
Oh, yeah.
That's going to be really excellent because it's already helpful and that'll be even better.
Very nice.
So another thing that you guys have support for is Vagrant.
And I know of Vagrant, but I haven't really done anything with it.
For everybody listening, what's Vagrant?
Vagrant is basically a tool that eases the usage of virtual machines.
So you can just download an image of your virtual machine and start it up and launch your process inside.
What we have done in PyCharm is that in PyCharm, you can work with Python interpreter located inside your Vagrant virtual machine as if it is local interpreter.
For example, your desktop is Windows and you even don't have Python there at all.
You just take Vagrant virtual machine image.
And in PyCharm, you add Python located in this virtual machine as a remote interpreter.
And after that, yeah, you have all the features of the IDE.
You can run your code, debug, run your test profile, and you have code completion.
So everything.
That's really cool.
So say I'm on Windows and I don't have Python set up.
I could have a Vagrant virtual machine running Ubuntu with Python 3 installed.
And I could just fire that up and it will automatically copy, say, my web app files over and then kick off Python on that machine and then attach to it remotely.
Yeah, exactly.
Exactly.
That's really cool.
So you also announced Docker support.
And in my mind, Docker is like a slightly more lightweight, modern take on that same idea.
Can you maybe talk about what you're doing with Docker?
Yeah, true.
It could be seen as the same idea, but people say about it that Docker is virtualization without actual virtualization.
So Docker is the technology of containers.
So it relies on Linux core functionality to isolate processes from each other.
There is a concept of Docker image.
It's some set of configured software and files.
And when you run this image, you get a container.
So a container is a running Docker image.
And if you have several containers, they can run on the same Linux machine, but they don't interfere at all.
Every container has its own file system layer and its own network configuration.
So they don't interfere.
And after this container finishes its work, it's killed and removed.
And you don't need to dispose of nothing.
Yeah, I think Docker is really cool.
And I think it's going to make a big...
Yeah, sorry.
So sorry.
I forgot to say that the main advantage of Docker is speed.
If you, of course, for the same purpose, you can use a virtual machine, for example, Vagrant with VirtualBox.
But to start a virtual machine, it can take minutes sometimes.
And starting a Docker container is just a second or a millisecond.
So it could be really fast.
And I think that's the main selling point.
What we do in PyCharm is we have pretty much the same integration with Docker as with Vagrant.
It's different under the hood, but it looks like the same.
So you just add an interpreter inside your Docker image as a remote interpreter.
And then you just run it or debug it or profile it.
And PyCharm executes your container and takes all the necessary information attached to the process if you want to debug it and so on.
That's cool.
So what do I need to do to get started with Docker and PyCharm?
Like, do I need to go and install Docker on my machine?
Can I do this on OS X?
Does it have to be done on Linux?
What's the story there?
You can do that on Windows and macOS X and Linux.
All you need is to install so-called Docker toolbox.
That is a set of software from Docker.
It will install a Docker machine on your desktop.
And that's pretty much it.
You just take PyCharm Professional Edition and you go to our settings at the remote interpreter and say that it should be Docker remote interpreter.
And then you select Python.
For example, Python 3 Docker image and press OK.
So, and that's it.
You can execute your project just with this image inside the container.
Okay, that's really cool.
I'm going to have to play with that because that's something I've never looked into, but that sounds pretty awesome.
So one of the things that I think is cool that PyCharm has is there's a bunch of community plugins.
Like if I want to do like Markdown in PyCharm, there's probably a plugin I can get so that I can edit Markdown.
Is that correct?
Yeah, true.
There are a lot of plugins and third-party plugins and JetBrains plugins in our plugin repository.
Yeah, that's one of the things I like.
And my favorite one, since I do a lot of training, but I also think is helpful even just if you're exploring parts of the tools that you don't know, is this thing called Presentation Assistant.
Do you know that?
Yeah, this one is nice.
Yeah, it's nice.
So every time you execute some kind of operation, like if I do a refactoring or a navigation or some sort of correct, you know, autocorrect, like pull in a missing import statement or something like this.
Or even if I go to a menu and I click it, it'll always show me, it'll do like a little transparent semi or translucent overlay of what the actual keystroke that I would have had to do to make that happen.
And so when you're learning, like you can use the menus and the buttons and stuff.
But if you just turn on this Presentation Assistant, it'll show you like how to do this all just straight from the keyboard, right?
I think it helped me a lot become more proficient.
But I think it's also helpful if you're doing a training class and you hit some keystroke and something funky happens, right?
Like, well, the students will ask, like, how did you make that happen?
And, you know, with that thing turned on, they'll see it.
So, yeah, that's really cool.
Yeah, true.
So you said there's other editors in there.
What is built in?
Like, so I can obviously edit Python.
You said HTML, JavaScript.
Does it have support for things like Angular or TypeScript or things like that?
Yeah, we do support AngularJS and TypeScript.
And much, much more.
There is a support for many different JavaScript frameworks.
Yeah, cool.
So TypeScript's interesting.
Do you just support, like, the editing of it?
Or do you have some, like, compile step that'll transpile that into JavaScript so I can actually use it?
Or do I have to do that outside of PyCharm?
I'm actually not sure about how this works in detail because I never used TypeScript support myself and never developed it.
But for sure you can compile TypeScript.
But for sure you can compile TypeScript to JavaScript from PyCharm and WebStorm.
This functionality comes into PyCharm from WebStorm.
That's right.
Okay, I see.
That's part of the integration between all the different IDE teams.
Yeah, true.
Yeah, cool.
So one thing you talked about earlier that I thought was pretty cool, and the first time I saw it, I'm like, wow, this really, you know, several times it saved me from, like, messing up something bad.
Is this, you know, obviously of support for Git and subversion and so on.
But this thing you call local history.
Do you want to tell people about local history?
Yeah, local history is a cool feature.
It saved me several times from losing a portion of my work.
It is useful not very often, but when it is, it can save you a ton of time.
What is it basically, it's a versioning of your local changes that even when they are not committed.
For example, when you have your local changes lost due to some broken external tool or some Git misuse, for example, when you accidentally reset everything.
Or even if you don't have version, like, if you're one of those people like, version control, don't need that, right?
Just start editing, right?
I hope that there is not much of those people.
But still, yeah, if somebody doesn't use version control, for example, what PyCharm can offer is to restore or revert your changes to some point in the history.
So you just open local history and you see all changes that happened with your files.
And this is a very detailed view.
It shows differences between files.
And yeah.
Yeah, the way I think of it, it's kind of like Git, but the Git that you didn't set up or think about or bother to interact with, right?
So independent of whatever real source control you're using, there's like a separate automatic autosave type of version control that you can fall back on if you need it.
Yeah, that's really helpful.
Like you said, I probably use that once every two months.
But when I do, I'm like, oh, thank goodness.
Yeah, yeah, yeah.
Maybe even less, but I still really appreciate it when it works.
We're kind of getting towards the end of the show a little bit.
And one of the things I think is probably more interesting than just the details.
I wanted to talk about some of the details because there's just, and we just barely touched on all the cool things that I think PyCharm can do.
I wanted to talk about these so that people out there are like, there's this tool that can help so much.
Even though maybe it starts slower than Vim or Emacs or Sublime Text, you know, if you're willing to wait like two seconds, that's not really that long.
You get this great thing to help you write code and work on, especially large projects.
You know, one of the things I hear a lot, obviously there's a bunch of people that like tools that help them a lot, but there's also people that just want super lightweight.
So if somebody came to you and said, Dimitri, you know, I think what you guys built is cool, but it's just not for me.
I don't really need an IDE.
I work on these big Python projects, but I've never needed an IDE.
I just feel like they're in my way.
Like, what would you say, give PyCharm a chance or think about some kind of IDE that's there to sort of support them?
First of all, I just offer a person to try, but if he has already tried.
And for some reason find that he feels more at home with Vim.
So I don't know.
It's also okay.
I think that everybody choose their own way to develop applications.
I think the right approach is to try different things.
So it's not very effective when you're stuck with something and you don't try different things.
I think even with somebody, programs uses PyCharm extensively.
I think it's okay also to try different editors.
You can find different approaches and you can compare.
So it's just better to try.
So that's my philosophy.
As I said before, I've done that with different languages.
So when I wanted to pick up dynamic language, I just tried different things.
So I think the same thing applies to IDs and editors.
If you look at any of the individual features, I don't think there's a single feature that would convince anybody that, hey, I should try this tool.
If they're kind of like, you know, IDs are not for me, right?
If I told you, hey, this thing has local history, they're like, yeah, I use Git.
No problem.
Oh, this thing has code coverage.
Well, I can use, you know, coverage.py and get that.
And I think it's the bringing it all together.
Like all, no single feature is like, they're great, but they're not that amazing.
But, you know, 20 or 50 or 100 of them all at the same time is when it starts to be really an interesting tool for you when you're working in ID.
So that's kind of my view of the benefits is no single feature is going to really make it worthwhile.
But taken as a whole, they start to really add up.
Yeah, true.
I agree with you.
That's true.
There's always a couple of questions I ask my guests before we sort of wrap up the show.
What's your favorite PyPI package or maybe project out on GitHub or something that is cool, maybe not everyone knows about, that you'd like to point out to the community?
Actually, my favorite is coverage.py.
I like it very much and I contributed to it at some moment unintentionally.
But it's very well-known package, actually.
If to point something to people, I would notice TOX.
I think that's very, very useful when you want to test your Python projects on different environments, in different Pythons, for example.
And yeah, I've heard about such a project called DTOX, which is basically TOX, but executes your TOX tests in parallel.
I never tried it, but I think the idea is cool, so maybe it's worth trying.
Yeah, that's pretty awesome.
So, coverage PY, TOX, T-O-X?
Yes.
And then DTOX.
Yeah, okay.
Very nice.
Well, thanks for recommendations.
And then, I think you might be biased on this one, but I always ask everyone what their favorite editor is.
Are you an Emacs person, a PyCharm person, a Vim, Sublime Text?
Yeah, it is.
It is PyCharm, of course.
Of course.
All right.
That's awesome.
So, before we go, do you have any, like, calls to actions, things you'd like people to do, know about?
Try PyCharm if you did not yet, if you haven't.
And please say us what you think.
So, we do listen to our users.
And the things that our users tell us are very important.
Okay.
Yeah, that's cool.
If we have feedback for you, how do we give it to you?
There are different channels.
You can submit issues and feature requests to our tracker.
Or you can write our support.
There is a forum.
I would prefer to write directly to issue tracker and vote for features because there are a lot of features and feature requests in our tracker already.
And actually, we do look at votes when we consider features for the next version to be included in the roadmap.
Okay.
Excellent.
Well, it's been really fun to talk to you about PyCharm.
It's quite a project you guys put together there.
Thank you.
It was a pleasure to talk with you.
Yeah.
Thanks for being on the show.
See you later.
This has been another episode of Talk Python to Me.
Today's guest was Dmitry Trofimov.
And this episode has been sponsored by Hired and OpBeat.
Thank you guys for supporting the show.
Hired wants to help you find your next big thing.
Visit Hired.com slash Talk Python to Me to get five or more offers with salary and equity presented right up front.
And a special listener signing bonus of $4,000.
OpBeat is mission control for your Python web applications.
Keep an eye on errors, performance, profiling, and more for your Django and Flask web app.
Tell them thanks for supporting the show on Twitter where they are at OpBeat.
Did you know you can personally support the show too?
Just visit Patreon.com slash mkennedy and join over 60 listeners who contribute between $1 and $2 per episode.
You can find the links from the show at talkpython.fm/episodes slash show slash 36.
And 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 and direct RSS feeds in the footer of the website.
Our theme music is Developers, Developers, Developers by Corey Smith who goes by Smix.
You can hear the entire song on talkpython.fm.
This is your host, Michael Kennedy.
Thanks again for listening.
Smix takes it out of here.
Stating with my voice.
There's no norm that I can feel within.
Haven't been sleeping.
I've been using lots of rest.
I'll pass the mic back to who rocked it best.