I have been using Eclipse for some project editing and a couple of things have improved since the last time I looked at this. I have gotten a faster laptop, Eclipse Ganymede has come out and Pydev has improved hugely due to the commercial arm merging with the open source one.
The good bits
Editing python files is easy and efficient. The discovery of interpreters and installed modules is good and the type inference (which is the hardest part of getting Python editors to work well) is quite good — better than Netbeans.
The strange bits
(things I think aren’t broken as much as I just don’t understand why it’s done that way):
Why is it that, when I edit a file in another editor, then open Eclipse to that project, it does all the checking that allows it to say ‘this resource is out of sync’, but that I have to follow the instructions “Go to File|Refresh”. Surely it should just refresh itself, or at least make the action clickable in the message. Why doesn’t it just load the file as it is when it opens?
What is up with workspaces? I understand (kindof) what they are, but what are the advantages of having workspaces rather than just storing the project information in a file in a directory that I can sync and use on another machine, or zip up and send someone without using the IDE?
How does my workflow fit into the “Project” mold? Let’s say I have my PhD, which is a real-world project. Normally I would have a PhD directory and bang stuff related to my PhD in there. Now, there’s the thesis document itself which is written in LaTeX, which I can edit using
TeXlipse. There’s also loads of programs written in many different languages, many with some levels of support in Eclipse. What do I do? What seems to make a bit of sense is to create a PhD workspace and then have projects for each of the programs so that I can edit them in the right mode and have all the right compile options and whatnot. If I just have one big PhD project, how do I tell Eclipse to change behaviour based on the file I’m editing like Emacs does? I mean, if I have some Fortran sources in front of me, I probably want to compile them when I click on the play button. If I have a Python script open I probably want to run it. I guess this is from the use of Eclipse to edit “Applications” — single, well-defined programs that consist of many files that all end up going into the application and where there is a clear build target to build and run. Perhaps with some tests. My projects just aren’t like that.
The bad bits
Refactoring (one of the big reasons I want to use an IDE) is broken for me. Many simple things broke in strange ways. “Extract variable” would place the variable definition inside a function defined earlier in the file, which would break everything if I did it. It’s still better than Netbeans, because the Python plugin for Netbeans has renaming as the only refactoring option. On the other hand, the rope support in Emacs means that refactoring just works.
Syntax highlighting is also strangely limited. I have grown very used to editing stuff with syntax highlighting and support for code formatting. Python is ok in Eclipse, but Makefile syntax is not supported (edit: Makefiles are supported by installing the C/C++ dev tools), neither are bash or awk, which I use quite a lot.
I am also very annoyed that stuff isn’t indented as I type, but rather that I have to do periodic “clean my code” up formatting (even if it’s a single key). I have become spoiled by Emacs, which can usually do the right thing when you press tab (who inserts a real tab in code ever anyway?). So your code always looks pristine. I don’t know if it really boosts my productivity, but it’s nice to have.
The last thing has to do with how I manage my files on my laptop and my desktop. I sync all my files to my destop when I get to work and sync back to my laptop when I leave. This is important functionality that has to work without me holding its hand. I use
unison, which
never breaks — I have been using it daily for almost 10 years and it has not failed me in that whole time. The information that Eclipse stores in the workspaces just doesn’t translate all that well between multiple machines. I am guessing this is because I have different versions of Eclipse running on my Mac and on my Linux box (because I haven’t upgraded my Linux box). It’s not really Eclipses fault, but it’s annoying none the less.
The verdict
I get the persistent idea that I’m doing it wrong — that if I just knew a couple of tricks in Eclipse it would all start to come together, and I must say I enjoy the passive information stuff a lot (the documentation pops up when you start typing, there’s autocompletion of methods, there’s a lot of highlighting that lets you know there are problems in the code. That’s all great, and I would even consider doing my next project in pure python just for those benefits, which is what I suppose drives the one language for everything mentality I see so much these days, but for my existing code base, I’m not going to get the benefits without a lot of swearing using Eclipse.
If anyone reading this has used Eclipse (or another IDE I have not tried yet) and is thinking “Geez, he should just do this or read that”, pleas post a comment. I read manuals. I figure stuff out. I can really see how Eclipse can help if you plan to write a Python program that’s all in python all the time, but if there are other languages in there, it becomes less useful.