Hacker News new | ask | show | jobs
by TeMPOraL 4290 days ago
(I mean absolutely no disrespect towards the author and his great post, it's just that after reading it I felt I have to write down an Emacs version of that.)

Six reasons to use Emacs

Emacs is a great IDE for octopuses and Lisp developers, but did you also know you can use it for almost every other project? Here are 6 reasons why you should use Emacs for your projects.

Emacs is at the top of a one-element list when it comes to great free Lisp IDEs. But for a little over three years now I have been using it in more and more projects. Going from basic HTML, CSS, JavaScript to Erlang, PHP, C++ and programming ARM microcontrollers. You name it, Emacs can handle it.

It is true, that Emacs was conceived initially for developing primarily with Lisp and various forms of stuff barely more convenient than pure assembly. But now that it is in its 24.4 version, it has grown to cover much more ground, from languages - as I mentioned above - to frameworks like Angular.js, Node.js, Symfony, Zend, etc…

So here are 6 reasons to use Emacs:

6 - Emacs is uber-modular

Unlike Eclipse, Netbeans, or most others, Emacs is a really modular IDE. And this is great for both users and developers. After downloading Emacs you can choose between different packages, modules and extensions depending on your needs, If you only need C/C++ projects you won’t be downloading unnecessary packages for Java or PHP. You can install, tweak and remove packages depending on your needs, making Emacs a highly customizable IDE with little effort.

Plus, if you’re a developer, you can make Emacs do whatever you like by modifying running code on the fly. If a feature you want is missing, you can trivially code it up in few seconds and enable immediately, all without restarting Emacs. You can browse through the fully-documented elisp sources to study how the power of Lisp and right design decision can allow various modules augment other modules without conflict…

Emacs also can have a Nyan Cat in a modeline.

This can be very instructive.

5 - A great community

Like all great open-source projects, Emacs has a very active online community. I rarely stumble on an issue that was not already solved somewhere on the Emacs wiki. This is particularly helpful when you’re discovering a new IDE. Also the Emacs Rocks videos. Those are great too. You can also participate in the community using IRC. Emacs has a built-in IRC client, of course.

4 - Org Mode

Trying to organize your work? Emacs has some great text-oriented tools to suit your needs. It will happily turn your simple plaintext list of tasks into full-blown calendaring system, complete with clocking the time you spent on tasks, pomodoro mode (optionally installed in org-pomodoro package), generating agendas for whatever timespan and set of conditions you want, and many more; all of this with a very nice workflow and possibly the most convenient tool for editing tables on the planet.

3 - Teamwork

Working on a team or alone I like to use version control (Git mostly) to manage my work. Emacs offer a great support for this (Git, Mercurial and SVN; and Darcs, and Fossil, and even TFS, you name it). You can manage branches, commits, pushes and conflicts effortlessly and without having to touch a mouse or leave your editor. No other IDE has perfected this, out-of-the-box, like Emacs (though you might want to install magit package).

2 - Browser REPLs

Read-Eval-Print-Loops are awesome, as any Lisp-speaking SLIME-using programmer will tell you. Emacs has numerous REPLs that connect to browsers to make your life easier. Their main features are: Refresh on Save (ok, you'll probably have to type it up yourself, but it's a single defadvice...), bi-directional element inspection, JavaScript debugging, HTML debugging and pushing to browser, CSS debugging and pushing to browser, etc…

If you’re an experienced web developer you’d say “I can set those up myself with some scripts and extensions”. And you’re correct. The thing is, it's simpler than it sounds. Emacs offers you all this with a bunch of simple M-x package-install invocations.

1 - Feature rich

I have been using Emacs for a while now, and every other day I discover new things; and even if I discover a new thing in another IDE, the Lispiness of Emacs never ceases to amaze me - like with all Lisps, it's trivial to copy a feature from a competitor and do it better. That is, if you don't already have a better one.

Note: I always keep something like vim installed for quick editing, most of the time because I'm too lazy to set up emacs-client as EDITOR for rare random interactions with interactive editing in unix shell.

Are you using Emacs or another powerful editor? Share your experience in a comment!

2 comments

> You name it, Emacs can handle it.

- Graphics tooling.

- GUI designer

- Semantic refactoring

- Graphic visualization of CSS modes

- Integration of JavaScript frameworks with code-completion support and two way editing between CSS, HTML and JavaScript code

- Graphical visualization of data structures in debugger

- Graphical support of heap data and threads in debugger

- ...

Most important in my book: an IDE should be a simple batteries included experience. Something tweakable like eclipse or emacs is fine, but I want it tweaked. I don't want to tell my editor where it can find my compiler or what language I'm using. I want to install, type in a syntax highlighted and auto-completed hello world program, and have it run. Plenty of IDE's do this, for example variations of eclipse/netbeans/idea and of course VS.
I agree. Emacs was historically a little weak on that side; if there are language-specific preconfigured bundles, they're usually out of date.

Fortunately, with the recent inclusion of a decent module manager in Emacs 24, one could hope people will start making preconfigured Emacs "distros" for particular use cases.

- Graphics tooling - to some extent, yes. You can even edit videos with Emacs.

- GUI designer - not really, but you're likely to be using a framework-specific GUI builder anyway. Then again, if you really wanted it, you could probably twist the artist-mode hard enough to draw mockups in it and save them as XML descriptions.

- Semantic refactoring - CEDET.

- Graphic visualization of CSS modes - Rainbow Mode, or just open a frikkin' browser.

- Integration of JavaScript frameworks with code-completion support and two way editing between CSS, HTML and JavaScript code - not sure what you mean by "two-way editing" here, but you have code completion, CSS/HTML/JS support, and - as I mentioned - a way to push all of this back and forth between Emacs and a browser.

- Graphical visualization of data structures in debugger - depending on how complex you want to be, but for most practical uses the answer is "yes, Emacs handles it"

- Graphical support of heap data and threads in debugger - again, if by "graphical support" you mean trees, not bubble-graphs and pretty pictures, then yes

- ... - type it up, M-x eval buffer, and carry on.

I have been an avid Emacs user between 1996 and 2005 when working on UNIX systems. At the same time, I have used lots of different IDEs across multiple OS and languages, starting with Turbo Pascal 4.0.

In no way is Emacs a match for what modern IDEs are capable of.

Your list just shows lack of understanding in what they are capable of.

Nowadays Emacs is just when I cannot make use of an IDE.

It's been almost ten years from 2005. Have you looked at Emacs since then? It's still being developed and improved.

Anyway; you asked if Emacs can handle this and that, I provided examples. I don't see how my list reflects on any kind of understanding apart from knowing my package ecosystem and how to use Google.

Would you mind sharing what do you think in particular sucks at Emacs compared to an IDE you use, that you have tested on both to come to this conclusion?

> Unlike Eclipse, Netbeans, or most others, Emacs is a really modular IDE.

Considering the number of plugins that exist for Eclipse, IDEA and NetBeans, the claim that emacs is more modular than all these IDE's is a bit absurd, don't you think?

> Like all great open-source projects, Emacs has a very active online community.

As do Eclipse and IDEA (NetBeans being a distant third, not so much).

> Working on a team or alone I like to use version control (Git mostly) to manage my work.

All the IDE's have git (and other revision systems) plugins. They all have their pros and cons and personally, I prefer to use an external tool (SourceTree) but emacs is unlikely to have an obvious advantage here.

> 2 - Browser REPLs

The Lisp eval mode and shell interaction are nice, but they are pretty limited to elisp and shell. All the IDE's have evaluation windows that let you run any arbitrary Java code, something that doesn't exist in emacs.

> 1 - Feature rich

Well, yes, all these tools have a lot of features.

It's interesting that you don't list the number one (and pretty much only) advantage that emacs has over any other text editor: macros. Macros are pretty much the only reason why I still use emacs today (\C-x(, \C-x) and \C-xe). And occasionally for small text files.

But for code, if you're not using a specialized IDE, you're not as productive as you could be.

> Considering the number of plugins that exist for Eclipse, IDEA and NetBeans, the claim that emacs is more modular than all these IDE's is a bit absurd, don't you think?

Modularity is not measured in how many plugins you can have, but in what those plugins can do with your editor without stepping on each other's toes.

All your other criticism applies to the original text as much as to my comedy piece.

> The Lisp eval mode and shell interaction are nice, but they are pretty limited to elisp and shell.

No; go and check it out. I specifically wrote about browser REPLs. People wrote REPLs that connect to the browser and let you execute arbitrary JavaScript, as well as transfer HTML and CSS between Emacs and an open page. Check out Moz Repl and skewer-mode.

> All the IDE's have evaluation windows that let you run any arbitrary Java code, something that doesn't exist in emacs.

Well Emacs has it too. Just install a Java REPL. Or shell out from inside Emacs, like all the IDEs used to do.

> It's interesting that you don't list the number one (and pretty much only) advantage that emacs has over any other text editor: macros. Macros are pretty much the only reason why I still use emacs today (\C-x(, \C-x) and \C-xe).

Well, I don't find macros that important alone. Their power depends on having complex text selection, navigation and modification tools. Things like reverse incremental search (regexp or regexp-free version, whatever you like), skipping and selecting semantic units (sentences, paragraphs, s-expressions, etc.), expand-region, transposing, sorting, rectangle-operations, etc. And then there are things like ace-jump, multiple-cursors, etc.

The power and convenience of Emacs lies in all those features being readily available everywhere, one key press away. Emacs is a "total greater than sum of its parts" type of editor.

> Considering the number of plugins that exist for Eclipse, IDEA and NetBeans, the claim that emacs is more modular than all these IDE's is a bit absurd, don't you think?

Is modularity measured by plugin count alone? Or is it measured by something like how feasible it is to remove some of the core IDE logic and replace it with your own choice of logic?

Macros are one of the worst reasons for using emacs, IMO - especially trivial keyboard macros that you describe. Almost all editors have a keyboard macro facility; the only one I use on a regular basis that doesn't come with one out of the box, ironically, is Eclipse.
IDEA has macros.