TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Why would you prefer Emacs over IntelliJ IDEA?

15 点作者 anildigital大约 10 年前

11 条评论

bpodgursky大约 10 年前
(note: everything here is scoped to the Java&#x2F;JVM ecosystem.)<p>Not to flamebait, but as someone who has worked extensively with large Java &#x2F; Clojure projects, the only reasons you would use Emacs are<p>- when working with a toy project (only one module, no complex dependencies or scoping<p>- intertia (or less kindly, stubbornness)<p>- ignorance<p>I have nothing against command line tools. As a linux user, I use Vim whenever possible and it makes sense. But when you are using a large modern Java application, especially one built on a framework (ex Hadoop) with a complex dependency chain and command line classpath manipulation, you are going to go insane trying to manage everything in Emacs. Intellij gives you many huge tools<p>- JUnit integration and debugging. I don&#x27;t know if Emacs in theory supports this, but I am sure no plugin will correctly parse dependency chains and let you debug a test well<p>- Finding references and usages. You can find all usages of a method or class across an entire codebase with a few keyboard shortcuts in Intellij. This is hugely valuable when figuring out what teams are impacted by changes. Grepping for usage simply does not cut it (grep for .get()? hah.)<p>- Safe refactoring. Want to rename a method? Just refactor it, and everything will compile afterwards, including all usages, and if you want, all superclasses or interfaces which define the method. Incredible.<p>- Style and safety warnings. The method recurses infinitely? You&#x27;re getting the wrong type out of the map? A local variable is unused? Intellij will do them all. Not a chance, unless your IDE is integrated with a real compiler.<p>I could spend all day filling in this list, but you get the idea. You can waste time playing around writing Java in Emacs, but at the end of the day my goal is getting real work done.
评论 #9209603 未加载
daly大约 10 年前
Emacs works everywhere (windows, linux, mac, etc). It is not specific to any language so I can use it for many projects. It works on remote systems as well as local systems. It has decades of extensions (rmail, slime, org mode, etc). It works for HUGE files, can follow compiler errors, does xref lookups, make a shell unbelievable useful, and is very productive. On some days it seems that at least half of my productivity is due to emacs, especially due to keystroke macros. The only valid complaint I ever heard about emacs was that it is a great operating system which could use a good editor.<p>On the other hand things like IDEs try to hide everything. You don&#x27;t know what the build system actually does. You don&#x27;t know how &quot;resource files&quot; get attached. You are presented with a bunch of menus which focus your attention and skills toward a &quot;standard&quot; style. The Java IDEs are not as bad as the XCode IDE (proprietary files?) but they still hide information.<p>Your tools shape how you think and what you can think. Emacs is &quot;just there&quot; waiting for your commands. IDEs limit your thoughts and hide things from your understanding.<p>As a programmer, I need to know how my code calls the operating system, how the operating system runs the hardware, how the hardware fetches and caches, how the bits get turned into voltages, and how the voltages affect the world. Emacs is just a logical extension of the same philosophy.
s_kilk大约 10 年前
I work in emacs mostly, but have given IDEA (and its varients like PyCharm) a fair shot on several occasions. I keep coming back to emacs. Why, well, in no particular order:<p>- extensibility, if I don&#x27;t like something in emacs I can always change it, less so in IDEA.<p>- IDEA has problems with key shortcuts on the dvorak (and other non-querty) keyboard layout, and the devs have no intention of fixing them.<p>- plugins. In my experience, language-specific plugins in IDEA tend to either suck or not work so well. Emacs, by comparison has support for damn-near any language, and many of those packages include tasty features which make working in each language a joy. (see the various lisp modes, ensime, and so forth)<p>- speed, IDEA is slow, too slow.<p>- IDEA is too &quot;mouse driven&quot; for my liking. In emacs, absolutely everything can be controlled via keyboard shortcuts, less so with IDEA.<p>- emacs runs in a terminal as well as a gui.<p>- emacs has awesome productivity boosting packages like helm, god-mode, projectile and org-mode, which don&#x27;t have equivalents in IDEA.<p>- With emacs I can mold the tool to fit my hand. When I use IDEA, it feels the opposite, like I&#x27;m having to change my hand to fit the tool and its way of doing things.<p>- ultimately, I don&#x27;t think an IDE actually brings much to the table. I don&#x27;t get any value from having the project build tied to a green triangle graphic, and I generally find the usual IDE workflow to be slow and clumsy. Emacs works perfectly, it does exactly what I ask of it and then gets out of the way.
评论 #9207698 未加载
lettergram大约 10 年前
(1) I ssh and use the terminal based emacs more than just about anything else.<p>(2) Macros are awesome, though I&#x27;m sure you can set up IntelliJ to use this as well.<p>(3) I wrote some eLisp to make my life easier, that&#x27;s the really big advantage to Emacs over most alternatives.
bloodorange大约 10 年前
- Works in the terminal<p>- org mode<p>- has a lot of maturity and innumerable useful extensins&#x2F;plugins&#x2F;whatever-we-may-choose-to-call-them<p>- can be quite lightweight if desired
评论 #9207640 未加载
jdreaver大约 10 年前
I routinely program in Python, C, and Haskell, and write prose in Markdown, reST, and LaTeX. I also sometimes use emacs modes for other languages, like QML, YAML, and GLSL. It is very convenient to have a unified interface when using those different languages. This means the only context switching I have to do with different projects is directly related to the language or project itself, not with how to use the different IDE (especially if you haven&#x27;t touched a project or language in a while). I even have auto-complete setup for the three programming languages.<p>Another killer feature of emacs is org-mode. With it, I organize all of my tasks for work and my personal life, and create outlines that I can easily export to pdf to send to others. Every org file is just plain text, so you can have all of your notes saved forever as long as you can read ASCII text :) Honestly, org-mode was the original reason I decided to learn emacs; it really is that neat.<p>I can&#x27;t and won&#x27;t try to make an argument about how emacs is objectively superior to certain IDEs for certain tasks. Really, you just have to have an interest in learning it, and hopefully you can increase your productivity with it. I thought learning emacs was fun, and I am always grateful that I can modify my text editor however I like.
joshribakoff大约 10 年前
I&#x27;ve used IntelliJ IDEA on Ubuntu for years and I can&#x27;t remember it being actually stable at any point in time. There&#x27;s always been known issues where its freezing, crashing, sometimes requiring complete re-installs. I didn&#x27;t like the experience of dealing with their support. They&#x27;d tersely request me to perform tasks to help them debug (don&#x27;t have the time to help them debug a commercial product), and they would blame their dependencies stating that those dependencies have known issues on my OS. Their stuff is very stable on mac, but not on Ubuntu. I still put up with the random bugs because its pretty decent overall.
jefurii大约 10 年前
I&#x27;ve flirted with IDEs over the years but I&#x27;ve stuck with a combination of Emacs, Terminator, and various commandline tools like bpython.<p>Here are some reasons I&#x27;ve seen for using IDEs:<p>- Autocomplete, syntax highlighting: Emacs has autocomplete and syntax highlighting (there are many themes in Emacs). bpython (an enhanced Python REPL) also has these.<p>- Code navigation: Emacs has a lot of nifty keys for zipping around within a document and with iswitchb navigating between documents is really fast. Some of the IDEs offer &quot;goto&quot; functions that will take you directly to where a function is defined, which would be nice.<p>- Code discovery: bpython displays function documentation and args; with autocomplete these are really quick. Granted, they&#x27;re not displayed whenever my cursor hits a function so an IDE would be convenient if you use this all the time.<p>- Integrated console, debugger, and VCS: With Terminator I usually have a tab for each project, split into panes for console, logs, etc, etc. They&#x27;re not displayed in the same window as my code but flipping between Emacs and Terminator is trivial.<p>- Refactoring support: Emacs has python-rope mode but it&#x27;s a bit clumsy. This is one area where an IDE is probably better.<p>With my setup I have the keystrokes for the original tools (git, pdb, etc, etc.) under my fingers. I have to use these tools outside of the IDE anyway so this way I only have to learn one set of keystrokes.<p>My Emacs configs live in a Git repo and I can install them wherever Emacs is installed and I have a user directory.<p>I run Emacs and Terminator on my desktop and edit code directly on VMs and remote systems via ssh[1]. This keeps my desktop free from cruft and lets me develop in a setup that&#x27;s close to my production setup. IDEs all seem to require that the code be on the same system as the IDE. Maybe they can but the ability wasn&#x27;t obvious or well documented and I confess I didn&#x27;t spend much time looking.<p>I do mostly back-end web programming and system administration. IDEs certainly have their place, and might be more useful if I was developing desktop applications, iPhone apps, or coding for microcontrollers.<p>[1] ssh&#x2F;tramp can cause lockups due to network issues but these settings in my .emacs file work nicely:<p><pre><code> ; tramp - edit over ssh ; open remote files with &#x2F;username@host:remote_path (require &#x27;tramp) (setq tramp-default-method &quot;scp&quot;) (setq password-cache-expiry 3600) ; password cache - 60 * 60 </code></pre> Updated for clarity, and to add tramp config.
solomatov大约 10 年前
I wouldn&#x27;t. I use IntelliJ for almost all the stuff I code, thanks to the support for almost any languages which you can find via plugins.
robinhoodexe大约 10 年前
100% control and it works in the terminal.
actsasbuffoon大约 10 年前
I use Idea for Scala and Emacs for everything else. I prefer Emacs for the following reasons:<p>* I find Idea to be very cumbersome. I can perform many powerful transformations on text in Emacs with just a few keystrokes. Idea respects virtually none of them, even in Emacs mode. I often have to copy&#x2F;paste from Idea into Emacs, make changes, then copy&#x2F;paste back into Idea.<p>* Idea is hopelessly mouse driven. Most of the functionality can&#x27;t be triggered via the keyboard.<p>* Emacs has a much smaller system footprint. Idea usually eats up a few gigs of RAM. I understand that it&#x27;s trying to do a lot of stuff to help out, but I feel like it really needs to be optimized.<p>* I can mix and match minor modes. I don&#x27;t usually care about spellchecking my code, but it&#x27;s a few keystrokes away in any given buffer. In Idea I&#x27;m always getting warnings about misspellings, even though I don&#x27;t care. I have a minor mode for line wrapping, showing whitespace, finding stop-points mid-word in camel-case&#x2F;snake-case text, and innumerable other things. I can turn them on globally, or in a single buffer.<p>* Macros are wonderful in Emacs. They can do anything I can do with the keyboard, which is everything. I can even have a macro that uses Magit to find changed files in my project, find each occurrence of a given regex in those changed files, copy each of the containing lines into an Org mode document, and prettily format them. It takes about 20 seconds to build that macro.<p>* Emacs has thousands and thousands of great extensions. Idea has a fair number, but not nearly as many.<p>* Many of the languages I care about (Haskell, Idris, Agda, etc.) are either supported better in Emacs, or are ONLY supported in Emacs. LiquidHaskell is amazing, but I don&#x27;t believe there&#x27;s any support in Idea.<p>* I don&#x27;t generally care about the sorts of IDE things that Idea does. Intelligent autocomplete doesn&#x27;t appeal to me. Many languages (like Ruby, JaveScript, and Python) make it literally impossible to intelligently autocomplete with 100% accuracy. Much like with documentation, I&#x27;d prefer not have intelligent autocomplete at all rather than lying intelligent autocomplete.<p>* I can embed a terminal as a buffer. I know Idea has a terminal, but it treats it as a special window, and I can only have one without a terminal multiplexer. In Emacs it&#x27;s just a major mode, so I can have as many as I want, and I can treat them like any other buffer. I can even use my familiar Emacs commands and minor modes on them.<p>That&#x27;s a lot of bad stuff, but one thing that Idea gets right is that getting set up for JVM languages is easier. I keep meaning to get around to setting up proper Scala support in Emacs, but I never seem to find the couple of hours it would take. Idea has reasonable support for it out of the box.