I recently spent some time fiddling with my setup of emacs on Windows. I use emacs for lots of stuff; just now I optimized my setup for development of C# apps.
I knew of the JDEE, which has been around for a long time. JDEE is the Java Development Environment for Emacs; it used to go by the moniker of JDE. It has code completion (aka "intellisense"), compiling tools (ant I think), syntax highlighting, an "immediate window" (BeanShell) for evaluating Java expressions right now, that kind of thing. There was a copycat project launched in 2001 called CSDE (C# Dev Env for Emacs). It sounded like a great idea, but it is now stale as 3-day old doughnuts, not having been updated since early 2005. With just one contributor, it never reached critical mass. And no update since before the launch of .NET 2.0 means no support for generics, I suppose, no support for msbuild, nothing for the yield keyword, and other goodies like that. Certainly nothing for LINQ syntax or anonymous methods. I didn't even have the courage to take it for a test drive.
So lacking an integrated set of add-ons, what would be the best Emacs setup, for C# development? Here's what I put together.
There were some places where I came up short. Intellisense is something I really wanted, and I know it has been done within Emacs for Java. The CSDE though, was just too stale. I found a smaller package, dedicated more narrowly to just .NET intellisense, called csense. Bummer though; this thing did not work for me at all. It was a non-starter. I invested quite a bit of time but no joy. Couldn't find any doc. It seems like it was one of those things that someone built, and it worked for him, and that was it. I think it had something like 13 downloads.
I also checked out a package called folding.el. But it seemed heavier than hideshow.el, and unnecessarily so. Also, not sure if folding.el is still being maintained. I can't even find the URL now, where I downloaded it from, though I know I downloaded it. The emacs wiki says that the author appears to have vaporized. Anyway, I punted on folding.el.
I don't have integrated debugging, but I can separately start up the clrdbg.exe which is included in the .NET SDK.
I didn't bother with setting up unit testing. I can run nunit, from outside of emacs. So it's really independent.
The upshot is, I have a pretty good development environment for C# now, in Emacs. And, it's free. (no license charge) It uses emacs and a bunch of free add-ons, and the .NET SDK, which is a no-cost addition to Windows.
How does Emacs compare to Visual Studio?
Comparing Emacs to Visual Studio… hmmm…. Let me start by asking you a question: what is your time worth? I like what I have set up here, but I have to say, I don't think what I have done is accessible to, or feasible for, most people. I have used emacs for 20 years, the keybindings are in my nerve cells, it would be like major surgery for me to stop using it. But for most people, I imagine emacs itself would be hard to approach. Beyond that is the C# support, which is all add-on. The sheer number of pieces I had to seek out and install, configure, understand – that alone is daunting for most people I would guess. Couple that with the fact that I had to wade through and even write elisp code, which is yes, something I can do, though not very well. (I took a couple lisp courses in college 22 yrs ago) The other black magic is regular expressions, which are tricky and for some people, a complete puzzle. I had to use a ton of regexp's in the setup, for everything from hideshow (to find region/endregion) and the compile error messages. I have regexp knowledge from way back, too. All of this took lots of time to do, as well as some esoteric skills.
So for me, the emacs setup will continue to be useful. But for most devs, I'd guess it would be a tough sell.
In contrast, Visual Studio is just an install. Most things I want are set up already – I don't have to write a regular expression, for example, to find the compiler error message. I don't have to write an msbuild file to compile. The refactoring tasks are already built-in – you don't have to write code to describe what refactoring you want. Debugging is built in. Intellisense. Unit testing. Snippets. Collapsing regions of code. All of it is just soooo much more accessible for mere mortals, or for anyone, really who values their time realistically. And that doesn't even mention the graphical designers, the database designers (eg linq support), or the team-development capabilities of Visual Studio.
The Bottom Line
My effort at setting up emacs was a labor of love – it is not the kind of thing I would recommend to anyone who wants to actually make money at writing code. I did it because I wanted to see if it could be done. If time is money, I spent myself into the poorhouse setting up emacs for C# work. I spent a bunch of time evaluating options, exploring dead-ends. (I was just thinking – g*d help me if I lose my laptop, because my setup is totally unique and not reproducible.)
The bottom line is that it is possible to set up emacs as a dev environment for C#. What I got for myself – I will actually use it extensively, for quick jobs and small projects, as well as larger single-person efforts. For me, it will be better than VS, for those kinds of projects. But in the end, Visual Studio is still sooo much better in terms of overall cost/benefit.
On the other hand, all of the emacs stuff I did works on any platform. I benefited from emacs packages that were developed for and by devs using mono on non-Windows platforms. So I can see that for some people, emacs could make sense. The way I got into emacs, by the way, was in school. There was a critical mass of people using emacs as an editor, and so I was able to pick it up easily. Then I worked at a company where emacs was standard issue, and that is when emacs became part of my DNA. I had no choice in the matter. The emacs setup was all prearranged, set up and shaken down for me. I can see that continuing as a common scenario for new developers picking up emacs – when they join a team of experts who have done all the setup for them, and who can transfer the lore to them. The body of experts can make emacs accessible to the new guy. But without that, IDE's like Visual Studio just seem sooo much more broadly applicable.
Hey, last thing - If I've missed any gems for working with c# within emacs, please let me know! Especially intellisense!