Tuesday, September 29, 2009

On The Choice of IDE For Python

Everybody has their own preferred environment for writing code. Some prefer Eclipse, others Emacs, and still others just plain old vi or notepad.

For each of us, we find ourselves looking at our tools from time to time, wondering how we can use them more effectively. When I made the switch to Python as my primary choice of programming language, the question came up for me: Is there a better way to write and debug my code?

Taking a look at the choices out there made me less than happy. Eclipse is very heavily Java based and oriented. Every Java developer I've ever spoken with swears by Eclipse. If you're writing Java, and not using Eclipse, chances are you're not getting the most out of your tools.

As good as Eclipse is for Java, it's support for other languages has never felt right. Every time I've tried, I've found myself frustrated by what it didn't do. Other languages work, but not nearly as well. Without even trying, I am 100% convinced that Eclipse is a bad choice for doing Python development, just because of how bad it was for C, C++, and PHP when I tried them.

I've been a ViM user for about 10 years. But ViM never quite made it to a full IDE for me. Add in the dynamic nature of Python, and ViM couldn't keep up. It had no way of knowing what a given object was, so I couldn't get features like autocomplete working. I've loved ViM for years, but ViM as Python IDE just didn't do it.

Emacs is a whole different beast. It might well be great for Python, I don't know yet. I've just switched to being an Emacs user (and I'll discuss why I switched tomorrow), and am still learning everything. As such, I'll not comment on what it can and cannot do.

Before I made that switch, though, by over a year, I had been looking for a quality Python IDE. I found a thread over on Slashdot speaking about Python IDEs, and took a look through them.

IDLE was too simplistic. PIDA looks good, embeds ViM, but didn't run everywhere I wanted it to (On occasion, I work on Windows, and need my IDE able to run there when I do). Eric is another good looking one, and is my second choice. My only issue with Eric is what feels like extreme clutter on the screen at startup.

I knew that Eric could be the right choice, but I wanted to see the other choice I'd found in that thread first, before I started working with Eric. I'm very glad that I did. The Wingware IDE might be the best money I have ever spent on software (considering that I rarely use proprietary software, favoring OSS even when the proprietary might well be better, that's saying something).

The interface starts out clean and simple. The initial opening screen walks you through a tutorial, teaching you the basics of using it. And then it sets you loose. You get all the features you would even think to ask for and then some.

Of course, you've got the standard debug mode. You also are able to change variables using the debug probe. Conditional breakpoints, normal breakpoints, exception catching (allowing you to look through the different points of the stack trace to see what the various values are), a Python shell that features tab completion, a project search, version control system integration, test running, docstring display, and tab completion of method and variable names. Yes, that last feature works, though sometimes you have to give a hint to Wing IDE by specifying an isinstance() call.

All of those are common features, though. If you're using an IDE that doesn't have that, you're probably using an IDE that is still in beta. Some uncommon features include remote debugging (which is very useful when debugging a WSGI application), debugging of various server type apps (Django, TurboGears, Zope, Plone, Google App Engine), support for multiple GUI libraries (wxPython, PyGTK, PyQT), support for other framework (Twisted, Blender).

And, lastly, a very uncommon feature: Wingware is cross platform. You can get it for Windows, Linux, and Mac. All of them work.

And that's just the application. The company itself maintains a mailing list in which they actively participate. Every question I've seen come across the list in the past several months always included at least one Wingware support person replying. They listen to their customers, and use the mailing list to get ideas for what to put into the next release.

If you go for the Pro version, you get access to their source code. You can write your own plugins. They'll even provide help by answering your questions on the mailing list for dealing with issues in writing that plugin.

All in all, this is the best money I've ever spent on any software program. I can't recommend them enough.


Pedahzur said...

Another endorsement of WingIDE. I've been using it for almost three years now. It's been a great productivity booster.

Epeli said...

When going for open source, I do find Eclipse with Pydev pretty good. It has almost all the features Wingware IDE has.

Note that formerly proprietary Pydev Extensions is now open source which gives you a remote debugger and better code completion amongst others.


Catalin Marinas said...

You should try the Python omni-completion support for vim:


From the above page, the features are:

- Dynamic type deduction (without actually evaluating statements)
- Local visibility handling (will complete from all parent scopes).
- completeopt=preview support, displaying python docstrings
- Function argument completion (whenever possible)

Cito said...

To be fair, you should also mention ActiveState's Komodo IDE. Their product and support are just as fantastic as Wingware's, and they're continually improving. There is also Komodo Edit for free, and many useful plugins.

Currently I'm using Eclipse because it has some really nice features and plugins that others don't offer, e.g. Mylyn. Plus, as Epeli mentioned, pydev it's now completely free.

Michael Pedersen said...

@Catalin: Normally, I would be happy to try it. Unfortunately, except for small/quick edits, I'm not using ViM anymore (and will be doing an actual blog post tonight about why). It's a shame, I really did love ViM, but I have been won over to the dark side.

@Cito: The last time I looked at Komodo was for a Perl IDE many years ago, and I simply hated Komodo. They might be wonderful for other people, but they did not work for me.

As for Eclipse, it might be wonderful. But every time I've tried it, I've found the same result: If I'm doing Java, it is fantastic. Easy to find how to do anything. Doing some other language? Good luck, and get ready to deal with the fact that the support is likely to be, at best, incomplete. I'll go to it for Java, but not much else, I don't think.

Brandon Craig Rhodes said...

I've just discovered your blog through seeing a link over at percious's blog (have you ever asked for your feed of "Python"-categorized entries to be added to Planet Python? this is great stuff!), so sorry if this is a repeat of something that's already been suggested or considered, but: have you tried the combination of "pyflakes" and "rope" running under Emacs?