PyCharm - first impressions

This is a post copied from my blog at http://weholt.blogspot.com/2011/05/pycharm-first-impressions.html, reposted here at the request of the lead developer of PyCharm. Thanks to yole for his interest and wanting to answer directly to my "review". Mind you, this review is based on very early impressions and I've had little time to use PyCharm. Here we go:

I've been using PyCharm for my django development after I recieved a free open source licence for it based on my work on DSE. I've used free software based editors like Editra so far, but I wanted a visual debugger and the option of running syncdb, the django devserver, and unittests from inside an IDE, spending less time in the shell, more time in the editor. That's what drove me to PyCharm. I've also used several of JetBrains products in my daytime job, like ReSharper, dotTrace and TeamCity, all very good products for C#/.NET development.

A very brief report on my experience with PyCharm so far:

  • It feels like a big IDE in many ways; It takes some time to load. It feels heavy. It scans your source code to provide intellisense, but it should be able to cache stuff. When started it looks as if it scans all your python code, even the standard lib and all installed modules all over. Sometimes the intellisense works great, other times it's providing you with some weird match for a module installed by Ubuntu for instance, far far into your lib-folder, not even remotely related to what you're working on. I did like that when I wrote HttpResponse in my views.py and didn't have the correct import statement in my file it imported the correct module from Django when I pressed Alt+Enter, like shown in the image above. Very ReSharper-like.
  • It must be configured to be useful and there are lots configuration options. Some of the options makes more sense than other, for instance the "Intentions" section makes suggestions for improvements for your code and it wanted me to change list comprehensions into for loops. Why? Isn't list comprehensions a better choices than loops?
  • Getting PyCharm to work with existing Mercurial repositories was hard. This was pointed out by Guido in his review of PyCharm as well. I like that I can run the devserver, syncdb etc inside the IDE, but I didn't get the visual debugger to work and that's one of my main goals. I'll spend some more time looking into this. It would be just great to add breakpoints and debug my source like I'm used to in Visual Studio. Using pdb/set_trace() is doable, but it feels old.
  • In the source tree for my project there's a tree item called "External libraries" containing all the available modules, both standard lib and third party. It makes it very easy to dive into the source of a module. Very handy indeed. Some of the refactor methods just doesn't do anything. If it doesn't make sense to refactor something, disable the refactor menu item. Other times the refactoring works like expected.  Intellisense for methods defined in your current source file works fine, auto-completion is snappy for the most part and hints about parameters works fine as well.
  • I tried to let PyCharm optimize my imports. Removing unused imports are great, but sometimes PyCharm suggested to remove imports needed because of monkey patching. Still, it work ok in most cases.
  • "Inspect code..." gives you a list of errors found in your code. It found unused variables, unresolved references etc. Handy, but I missed having something like PEP8-checker directly integrated. Is it in there? I didn't see anything.
  • Tag-completion worked fine in html and there are support for django templates, tags etc, but I didn't test this very much. Based on information here it looks great.
  • It also provided easy to use support for unittesting, like shown here, but when I tried to debug my django unittests it failed because of some problems with the configuration. It's clearly my fault, but like I said earlier there are lots of configuration options and I probably messed up somewhere.

All in all I found lots of the stuff in PyCharm to be nice and familiar having a background in IDEs like Visual Studio, but it's also very clear that you have to learn a lot of keyboard shortcuts to be enjoy all that PyCharm has to offer. The thing I like best about programming in python is that in most cases I manage to keep my projects small, easy to navigate and also easy to debug. Working with bigger projects probably justifies buying a piece of software like PyCharm, where the need for code navigation, refactoring etc makes more sense. Getting the visual debugger to work is still high on my wishlist so I'll spend more time looking at that.

One thing I didn't like is that when running on Ubuntu and using OpenJDK it kinda looked a bit like crap, like something written in ...eh ... Java. It clearly warns me when I start PyCharm that OpenJDK is not supported due to some bugs in graphics etc, so I 'll try to get the Sun jre-version running to see if that helps. I still baffles me that applications written in Java still have that Java-feel to them; they very seldom look truly native to the platform they're running on.
Being a big supporter of free software using a closed source solution like PyCharm was actually a bit of a challenge for me. It still is, but I like that JetBrains makes it possible to apply for a licence for open source projects like DSE. I don't know if they pass out licences to all open source projects that comes along, but it makes sense to reward good open source projects with a free licence. I like that more and more people make money using python, but all my projects are non-profit, purely free software so if I have to choose between two products with similar features, one free and the other closed source, my choice would always be the free one - and it doesn't have anything to do with the price of software. I'd pay for free software, if it was better than a closed source alternative. But so far PyCharm seems to be a in front when it comes to integrating django development into an IDE. A bit buggy, but the best I've seen so far.
Ok, to wrap it up; did I like PyCharm? Yes. Would I pay for it? If I get the visual debugger to work and the integration with mercurial/bitbucket was improved - Yes indeed. Is this a step in the right direction for django development? For people like me, fond of IDEs yes - allthough I would still use a more lightweight editor from time to time.

2 comments

Hello Thomas,

Thanks for reposting this here! Please find my answers below.

  • It must be configured to be useful and there are lots configuration

options.

In fact our intention was to make PyCharm as much configuration-free as possible.

It's true that many options are available, but to get started, all that you

need to do is select "Open Directory" and point to your project. PyCharm

figures as much as it can automatically.

What specific options did you need to change to make PyCharm useful?

Some of the options makes more sense than other, for instance

the "Intentions" section makes suggestions for improvements for your

code and it wanted me to change list comprehensions into for loops.

Why? Isn't list comprehensions a better choices than loops?

In fact Intentions are not suggestions for improvements, but rather local

refactorings that trigger on specific code constructs. Sometimes you have

a comprehension and need to extend the code in such a way that doesn't neatly

fit into a comprehension any more - that's when you use the intention.

Inspections are indeed suggstions for improvement in the code.

  • Getting PyCharm to work with existing Mercurial repositories was

hard. This was pointed out by Guido in his review of PyCharm as well.

What exactly was hard? PyCharm should have been able to detect automatically

that your project uses Mercurial, by the presense of the .hg directory.

I like that I can run the devserver, syncdb etc inside the IDE, but I

didn't get the visual debugger to work and that's one of my main

goals. I'll spend some more time looking into this. It would be just

great to add breakpoints and debug my source like I'm used to in

Visual Studio. Using pdb/set_trace() is doable, but it feels old.

What kind of projects are you trying to debug? What happens when you press

the "Debug" button?

Some of the refactor methods

just doesn't do anything. If it doesn't make sense to refactor

something, disable the refactor menu item.

Examples? Sometimes it's not feasible to check whether a refactoring is possible

during the update of a menu item - in this case PyCharm should show a popup

explaining why a refactoring was not performed after you invoke the action.

  • "Inspect code..." gives you a list of errors found in your code. It

found unused variables, unresolved references etc. Handy, but I missed

having something like PEP8-checker directly integrated. Is it in

there? I didn't see anything.

The PEP8 checker is not available at the moment, but it has been suggested

by users and it's likely that it will appear in a future version. In the

current version, you can configure pep8.py as an external tool in Settings

| External Tools.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Regarding PEP8, I found the following description really helpful, including the comments:

http://www.in-nomine.org/2010/12/14/pycharm-and-external-lint-tools/

In my opinion, the above solution feels 'internal' enough. One drawback with PEP8: It currently cannot handle @property correctly if setters are defined.

Including the functionality of PEP8 into the inspection mechanism of PyCharm would be nice to have. But to be honest, I prefer almost any bugfixing to the inclusion of PEP8.

0

Please sign in to leave a comment.