A lot of modern IDEs provide features that are pretty close to magic, compared to what emacs sports. The emacs user response to this generally seems to be something like, "Code navigation can't be as good as M-x rgrep", and "How can refactoring ever be as good as C-M-%?"
This reminds me of various people I have worked with in the past who have wondered why I ever bothered with the complexity of searching and replacing with regular expressions, when you can just do a normal search and replace, watch for matches that match the more complicated thing you're actually looking for, then replace them by hand...
I use Visual Studio to wrangle giant enterprisey C# applications, but I still use find+grep/Emacs for browsing code quickly. Visual Studio is a long way off from matching the simple blazing speed of grep and file buffers in Emacs.
P.S. I'm not sure why I'm being downvoted. It's what I do. There's really no debate about whether grep is faster than VS search.
VS mimics both to an extent by allowing you to search with regular expressions and to choose to search from a file system context instead of project context. My favorite thing about this is I also use viemu, and I can search VS's search results using vi commands.
>A lot of modern IDEs provide features that are pretty close to magic, compared to what emacs sports.
This is true, so why did I go with vim?
Well first, I'm primarily using Ruby not Java, so the magic available in IDEs is somewhat diminished. But more to the point, vim is really well optimized for the widest array of types of editing. It also has the advantage of critical mass open source immortality.
So when I hone my vim/emacs skills, it's an investment for the next 50 years, during which time I'll have no problem using my preferred editor on my preferred platform with whatever languages happen to be striking my fancy.
> A lot of modern IDEs provide features that are pretty close to magic, compared to what emacs sports.
Which modern IDEs and what features? I have used eclipse for months before deciding I was better off with emacs with eclim-mode anyway to provide the only two features of eclipse I liked: the compiler and the ability to see the members of an object (occasionally).
I work on a 5GB source tree at work with a couple (or more? I haven't looked) thousand Java source files. After my last machine decided it would be a good time to crap out and I started over with a new OS X install, I tried working strictly with vim and emacs and our scripts (written by vim aficionados, it seems) to navigate around the codebase.
It was like a root canal. If I was on fire.
Seriously--I'm not an Eclipse fan by any stretch, but Open Type alone saves me hours of frustration a week. Its code completion isn't nearly as good as Visual Studio's, but is a lot better than ctags. And its source generation (implement getters/setters, override inherited methods, even just basic context-aware renaming) is fantastic, too.
IME--and this is something of a generalization because I know fantastic programmers who use vim and emacs, and I use either where I have to--the folks who tout them are either using languages where IDEs are less effective (although this is still dubious--NetBeans has surprisingly good intellisense for PHP and Ruby, at least) or don't realize what the IDEs can do for them on a regular basis.
> I work on a 5GB source tree at work with a couple (or more? I haven't looked) thousand Java source files.
the linux kernel is 14 million lines of code and the size of its source tree is 500MB, you are working on a source tree that is ten times the size of linux? 140M lines of code? In any case it can't be all 140M LoC in a couple thousand java files so something should be clarified.
> I'm not an Eclipse fan by any stretch, but Open Type alone saves me hours of frustration a week.
ido-mode plus tags file worked well to replace Open Type for me. Before that I used a stupid five line bash script.
> don't realize what the IDEs can do for them on a regular basis.
Or maybe you don't realize what you can do with a good editor. Good, modern IDEs have some good features, better than what you can do with emacs/vim however:
a. they are not good editors (and insist on being one)
b. they are not good window managers (and insist on managing your windows)
c. their usefulness degrades quickly depending on the build system/language you use. If you need to quickly glance at the source of a library you just downloaded they are no help at all.
No, it's not all code, but glorified shell script call-outs from vim, etc. have to walk the entire thing far too often for my liking. (Unless something has recently changed, tags files have to be rebuilt in their entirety after a svn up - Eclipse just reindexes the changes.)
As for "not realizing what a good editor can do"--remind me how I get context-sensitive renaming or method extraction in emacs or vim? These features are critical when you're dealing with sufficiently gigantic amounts of code (especially the crufty kind), and if I really wanted I could get a full set of vim keybindings for Visual Studio (albeit the Eclipse ones aren't quite as accurate).
(And can we lay this holier-than-thou claim about "good editors" to rest already? The idea that editors that don't require six fingers on each hand or a modal personality are "not good editors" is patently silly and I have no interest in stooping to that level. You don't like them. That does not make them "not good," it means you don't like them. I grew out of that sort of thing when I was 15 or so, and am pretty much identically productive, in terms of just writing text, in emacs or a standard editor; I'm close in vim, but I only picked vim up a few months ago. When you stop identifying yourself based on your text editor of all things it stops being a material factor in your ability to get things done.)
You don't but I did tell you that IDE do some things better.
> method extraction
After the third time eclipse crashed and deleted code while I was trying to do this I'm not really sure how you can get method extraction working in eclipse either.
> And can we lay this holier-than-thou claim about "good editors" to rest already? The idea that editors that don't require six fingers on each hand or a modal personality are "not good editors" is patently silly
Agree, but it's also silly to think that any editor is a good editor and the ones in IDEs are not.
> I grew out of that sort of thing when I was 15 or so
C. For Java, at least, Eclipse will automatically display Javadoc for a library you download (in both mouseover hover and a sidebar window) , and will navigate to source if the library has an attached source jar (which maven will usually find from a Repository )
The take-away I got from your post is if I need to deal with "enterprise-size" crapware I'm better off using IDEs. That is certainly an interesting niche, but why would I ever want to work on "enterprise-size" crapware?
I've used JBuilder, Eclipse, NetBeans, and Visual Basic 6. None of them address a fraction of the things I actually need or like to do on a regular basis (edit files remotely, browse directories, use a shell, actually edit text efficiently). At work my Emacs session has files open in four different programming languages. There's nothing stopping people from writing refactoring tools for Emacs (take a look at Xrefactory), it's just that grep and dired and search-replace are universal tools that are good enough for all occasions. If you need something else it's easy enough to use macros or write elisp code to do it (ever try writing an Eclipse plugin? that works with multiple versions of Eclipse?).
You are assuming that your use case is typical. It's not. Eclipse may be better at your use case, but it fails miserably at the things typical Emacs and vim users need.
> That is certainly an interesting niche, but why would I ever want to work on "enterprise-size" crapware?
Because it pays the bills, and pays them quite well.
> it's just that grep and dired and search-replace are universal tools that are good enough for all occasions. omething else it's easy enough to use macros or write elisp code to do it
Extract a superclass or an interface with them. Automatically and contextually build your getters/setters in Java/properties in C#, respecting visibility and implementing proper logic in the case of constant or final fields.
I'm not going to hold my breath waiting for you to do either. Emacs is nice enough, but it's absolutely silly to claim that context-insensitive tools are "good enough for all occasions."
And I would be pretty easily called a user of both emacs and vim. Both are tools for specific use cases. They are not, as the strange culture of text-editor-worshippers would like to claim, inherently superior as editors simply because you know them.
"Because it pays the bills, and pays them quite well."
Why don't you just go into investment banking or law or medicine instead? All those careers pay a lot more than doing copy-paste on millions of lines of crap Java code, which I highly doubt you like doing anyway.
I pay the bills by doing things I'm interested in.
I used to use pymacs and ropemacs with python, but it broke in hard to determine ways, and then on my latest project it was horribly slow, so I stopped.
The modern IDEs I am thinking of are Visual Studio (appropriately tarted up with Visual Assist) and Xcode. Yes, unoriginal, I know, but what can I say? Anyway, people always tell me these two are rubbish, so I assume everything else must be at least somewhat better.
Perhaps I was guilty of hyperbole, and "magic" is excessive. But stuff that comes out of the box in the above IDEs, and in its out-of-the-box state is slicker, easier to use and requiring less effort on one's own part than in emacs:
- Symbol browsing with search by substring, so you can leap to a symbol knowing only its name or part thereof;
- Project file browsing with search by substring, so you can open a file by name or part thereof;
- Pretty reliable jump-to-symbol with context sensitivity (so p.xyz, say, will take you to the right xyz), so you can find something given a valid mention of it in the source code;
- Popup code completion without my having to do anything funny or wait for the next build;
- Refactoring - OK, actually my use of refactoring tools could probably be done in emacs without making me want to die, but I know people who like 'lift method' and all that other junk, which would be basically a manual process in emacs.
I tried a couple of things to try and bring this stuff to emacs. M-x imenu, M-x ctags, CEDET and ido-mode are the ones that stick in my mind. None of them were up to much, though I wrote some helper functions to combine ide-mode and imenu, and I was somewhat pleased with the result. Then I upgraded emacs, and they stopped working. I took this as a sign, and didn't bother rewriting them. I don't use emacs for C/C++ any more.
Refactoring. In Visual Studio I can click on any usage of a badly named class, press F2, type in the new name and it will be updated everywhere. Even the name of the file holding the class is updated.
More importantly, it won't be updated for things that aren't it. As in, you can have a class called 'i', used in 50 files, and confidently replace those usages and only those usages with another name. That's something you just plain can't pull off with Regular Expressions.
[waits for somebody to post the 4000 character Regex that actually does this correctly]
My typical responses is that replace-* modify+isearch macros are good enough that I don't miss having refactoring tools that parse my code on the fly.
My projects are usually not large enough that it matters. If they were, I suspect my typical response would be that I would simply install the appropriate mode for emacs and use that.
your argument about code navigation in emacs is inaccurate, though "M-x rgrep" is used heavily. at least there are gtags. and now there is auto-complete. For C/C++/Obj-C, clang+auto-complete stand there.