tags:

views:

1993

answers:

12

Hey All,

I started coding around 5 years ago. I was introduced through Java and Eclipse which both have substantial stigma attached in the programming community. A number of people at the company I currently intern at prefer emacs or vim. I can't see how a basic text editor is faster or easier than an IDE in general although I appreciate some things like building tend to be faster from the command line.

Is this a case of the 'old-boys' club or can it be more efficient to program a project in this way?

Can you provide some use cases to demonstrate? If I were advocating Eclipse I'd say refactoring and auto-completion were pretty handy tools.

Gav

+1  A: 

The efficiency provided from vim/emacs is mostly afforded by their heavy keyboard use. In these programs you can do most anything directly from the keyboard, rather than having to stop and use the mouse.

Jweede
+2  A: 

I'd say the actual vim/emacs editors are far superior to the Eclipse text editor in terms of the shortcuts they offer. However, I completely agree with you about refactoring.

Most people have to write scripts to do the sort of level of refactoring Eclipse is capable of. I think part of it is bragging rights or people just doing it the same way they always have.

Mike McQuaid
No, most of us just don't write code where "refactoring" requires changing 150 different files.
jrockway
I'm willing to bet I could change 2 files quicker than you in Eclipse than you could in vim/emacs.Also, some of us inherit bad code which requires refactoring and tools like those Eclipse provides make that a lot easier.
Mike McQuaid
+5  A: 

Emacs can be a powerful IDE, but having gone from Emacs to Eclipse, I have to say I would never go back. Eclipse just offers so many features that you can't get within Emacs.

Mylyn and scoped views of the data and files I'm using, the debugging UI, CVS UI, are all built in and easy to get and use. I'll use the mouse a little to get'em.

RC
+9  A: 

I got started in IDE's like Eclipse, but have switched to Vim about 2 years ago. Here's some reasons why you might want to use a text mode editor:

  • It can be used as an IDE for just about any language (you learn it once and use it for everything)
  • It can do all those fancy things like auto-completion and refactoring, and many more complex operations which you can extend by adding macro's or plug-ins
  • It works just about everywhere (and can be used through an ssh shell)
  • You don't need a gig of ram to run it

If you really persevere you will find that working in an editor like this will eventually be faster, and in fact becomes ingrained as a sort of 'muscle memory'. This means you can code without slowing down to think about the process.

Aram Verstegen
To make vim complete code you should always tweak something.
Mykola Golubyev
I think it's sort of implied. Eclipse requires just as much if not more tweaking, in my experience.
Aram Verstegen
And vim starts up faster than you can say "Eclipse".
Ludwig Weinzierl
Emacs on the other hand requires at LEAST a GB of RAM :P I love the beast.
kjfletch
+1  A: 

Vim / Emacs

  • Very fast/efficient code writing
  • Low memory footprint
  • Quick access to command line
  • Infinite possibilities through scripting/plugins
  • Never have to leave the keyboard

Eclipse

  • Full-featured IDE for many languages
  • Great refactoring support

All of them

  • Cross-platform
  • Feature rich
  • Extensible through plugins

I typically find myself writing volumes of code through vim and performing debugging tasks through my IDE. Familiarity with the code base is certainly a factor, as an IDE is a great tool for jumping around and learning unfamiliar source code.

Corey D
+2  A: 

I remember reading somewhere about a study which showed that people perceived keyboard shortcuts as more efficient than mousing, when in fact it wasn't always.

Another psychological effect is that we attach value to things which are expensive, i.e. since Emacs is harder to learn it must be better in some way.

I think those effects could explain a lot of the extreme affection some people have for Emacs/Vi.

However, in the case of Eclipse, I find it can be very slow and even crash occasionally, but that is not a case against IDEs in general.

I use both Eclipse, VS and Emacs regularly. I would use TextMate too, but I don't have a mac anymore. It depends on what I am doing, more specifically, what system best supports my language and tools.

I know people who spend considerably more time programming their editor, than they spend doing something useful. Some of them even admit themselves that they only do it for the challenge. Other people often claim that Emacs/Vi can do much more than IDEs, because they are scriptable. Well, most IDEs (including Eclipse) can also be scripted. In that sense almost all editors are equivalent (though, I admit, some editors are more easily scripted than others).

If you like IDEs, my advice is to keep using one. There is no One True Editor.

EDIT:

This seems to be the article Nick Bastin is referring to. I agree that it is far from a definitive source. However, I still think my point about perceived and real productivity not being the same thing still holds.

Jørgen Fogh
That "study" was done by Apple in 1989 (not a truly scientific study, but focus group research), when they were trying to evaluate the mouse as actual "new" technology to people used to using their computer entirely with a keyboard. Times (and interfaces) are quite different now, and even Tognazzini agreed that editors are one place where the keyboard was (and is) always faster (assuming, of course, that your keyboard shortcuts are not something you have to think about).
Nick Bastin
@Nick Bastin +1.
Jørgen Fogh
+2  A: 

I've used vi for years to edit code in a variety of languages, and really love it. But I've found IDEs like Eclipse to be even nicer for Java development, and now I tend to work in Eclipse almost entirely. I drop out to use vi from time to time for a few specialized activities like bulk-inserting copyright notices, mainly those dealing with certain kinds of rote edits that aren't well automated in Eclipse. I also have my Windows .java file type mapped to vi for when I just want to look at a source file without waiting for Eclipse to open up.

Some of the attractive features in Eclipse are:

  • method name completion
  • error highlighting
  • pop-up javadoc comments
  • refactoring

I do find it a lot more efficient than vi in general, so you should try it out and see if it that holds true for you too.

Jim Ferrans
+5  A: 

It all depends on what you want/expect and what your usage model is.

If you're looking for a Java IDE, Eclipse is difficult to beat. It's written in Java, for Java, by Java folks.

If you're looking for a tool to edit files from the command line quickly, Emacs or vi both fit the bill.

If you're looking for a tool from which you never have to leave because it can do anything you want (send/read mail, manage projects, todo lists, compile, debug, etc. etc. etc.), then Emacs is more "efficient".

If you're looking for reasons to switch editors, figure out what you want. If you want a better Eclipse, vi and Emacs won't give you that, stick to Eclipse.

If you're looking for a small, nimble editor, vi will fit the bill.

If you're looking for the ultimately extensible editor, Emacs is the way.

Whichever tool you decide to go with, immerse yourself. Learn all of the ins and outs, extend it to meet your needs. Use it to its limits and become efficient in its use.

Trey Jackson
+8  A: 

The argument "Eclipse for Java" is a different argument than "Eclipse for [something that isn't java]". Eclipse does rock for Java.

I mean, vi is like a screwdriver, or maybe a swiss army knife, and Eclipse is like a big CNC combo mill and asphalt spreader. You don't exactly compare them, you kind of just use both.

Also, are you working inside something giant, which you know little about, but which Eclipse understands? An example would be working on Eclipse itself. Here, Eclipse has perfect visibility, total language support, and you need the toast prompts and the documentation links.

But if you are typing in a 100-line Ruby program to convert an SQL database, Eclipse doesn't add much value, especially considering its baggage.

It's also critical to set up vi right, or you won't grok the appeal. Autoindent, showmatch, tab handling, and various other options should be set. You should have a easy way to generate a tags file. Google can find tag generators, or just write one from scratch, with a few lines of shellcode and sed(1).

I don't consider refactoring to be a criteria. That's not something you do once an hour or even once a day. Sure, fire up the big IDE when you need to refactor. Oh, and don't expect automated refactoring of anything except Java.

Finally, vi can actually do a lot of things that the IDE can't begin to do. The grouped regular expression global substitution is kind of a generalized refactor-anything engine. To appreciate the vi gestalt you need to learn the line (":") mode. Briefly, it's like having sed(1) inside your editor.

DigitalRoss
I disagree on the frequency of refactoring. Refactoring can be as simple as renaming a class/method name and having the IDE do the hard work is a big time saver. I know of a team who had their trainee spend 2 weeks going through their code manually doing renames...
hbunny
+1 for pointing our the "Eclipse for Java" thing. "Eclipse does rock for Java." I agree 100%.
Ludwig Weinzierl
Please don't tell people to use substitution for refactoring.
Martinho Fernandes
Didn't I say to use the "IDE when you need to refactor"? But the further away you get from Java, the less IDE refactoring you have...
DigitalRoss
+1  A: 

We've had this argument at work recently. My take was that one single feature I couldn't do without is Emacs's autocomplete. Eclipse's autocomplete is based on syntactical analysis - the code gets parsed, and as you type code you're offered choice of completion. Emacs' autocomplete is base on simple textual analysis. That means it works in plain text, in comments, in documentation - everywhere. I keep saying the Emacs' autocomplete is what IntelliSense wants to be when it grows up.

Update:

Eclipse does offer Alt-/ which is supposed to be similar to Emacs. Not sure how well it works, though.

Arkadiy
+2  A: 

It depends on the languages.

For Java or .NET use an IDE (Eclipse,Netbeans,Visual Studio...).

For almost all the other languages(C,C++,ruby,python,haskell,lisp...) vi and emacs are better in my opinion.

hiena
If you do .NET you can have the best of both worlds: Visual Studio + ViEmu.
Martinho Fernandes
A: 

Like some of the posts above, I started out with an IDE (Eclipse). From there I moved to Emacs, and then I moved back to a rich text-editor (TextMate).

For me, the efficiency was the ability to have an editor at the interface level. Allowing me to integrate other service I've built up (or others) into my pseudo-IDE environment.

Rev316