Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: IDE versus Text Editor?
17 points by breck on Dec 19, 2008 | hide | past | web | favorite | 33 comments
My question is this: if you invest the time in getting very proficient in a Text Editor like Emacs or vi, what type of return do you get? Please include an estimated number in your answer(ie. I am 10%, 50%, 500% more productive developing Python/Java/Ruby/other using Emacs versus IDLE/Eclipse/Arachno/other).

I continually go back and forth between using an IDE versus using Emacs/vi. I keep giving the latter two a few hours each here and there but haven't invested the time it takes to make it worthwhile. Most of what I write is Python, followed by PHP, JavaScript & SQL.

EDIT: Also if you've written your own editor/IDE, please mention that(it's one option I've been prototyping with).

It depends on the language. With Java, I get a huge return because the IDE can take care of so many mundane things like getters and setters. Java also sometimes has odd names used in its standard library (for example, you use queue.offer() and queue.poll() to add and remove things rather than something like 'enqueue' and 'dequeue' or the standard push/pop. An IDE prevents me from having to deal with looking it up constantly.

With Python and Ruby, I find a text editor sufficient and usually I'm doing web work with those languages which is perfect for vim/emacs over SSH.

PHP tends to have a huge library of builtin functions and it uses positional arguments (you can't call a function with arguments out of order denoted by keyword like python). I've found an IDE to be helpful for PHP in the past. SQL isn't a big language. As such, I can't see an IDE helping. JavaScript, with libraries becoming the preferred way to code, doesn't seem like an IDE could do much unless it understood the library.

I agree too. It really comes down to what helps you the most and what the best tool for the job is for you.

I've seen people use Eclipse for Perl, which make very little sense to me. Sure, you can use it, but personally I'm at least 10x - 15x more productive if I use vi.

But for Java, Eclipse is awesome. The ability to find what methods are available and other great tools Eclipse provides blows a lot plugins/extensions out of the water.

There is no one editor to the rule them all... :)

Pretty much agree with most of what you said. IDLE and Vim are my gotos for Python. PHP I rely on PHPDesigner(mainly for the tooltips for argument order) and syntax check.

And JavaScript the library is key(jquery for me). Though a good syntax checker would be nice. I think I spend too much time debugging semicolons in JS.

First: If you think you want to write your own editor, you've answered your own question. You need to learn emacs, vi, or TextMate immediately, because these are editors that make it very easy to change their behavior by writing your own custom extensions.

I wouldn't write my own editor until I had learned all three of those editors. After that... I still wouldn't write my own editor. ;) Spend your energy on a problem that urgently needs solving.

Now to your question: First, I can't answer it, because I'm not really a user of any IDE. Second, I think it is ill-posed. It's like asking which is more productive: using emacs, using Ruby, or using Excel. If you're an expert in one of these tools, you can use it to replace the others to some extent (I just encountered a programmer who was using Excel to compose hundreds of SQL queries. I have to admit that it works, although it would never occur to me to do this; I'd reach for emacs instead or, failing that, Ruby or Perl.) But, in general, these three tools are designed for different problems, and each tool has its sweet spot.

There are languages for which the vast majority of programmers use an IDE. (I'd probably use one if I had to do any Java programming; Mac development in Objective C might tempt me to use XCode to write code; I'm pretty sure .NET programmers use Microsoft tools.) But you become a different kind of programmer when you use something like emacs instead. For one thing, your text editor can be used to edit anything that is made of text: Python, PHP, Javascript, SQL, C, Ruby, Perl, Lisp, Haskell, Erlang, Java, shell scripts, config files, HTML, CSS, LaTeX, directory listings, version-control logs, long emails, documentation, outlines, to-do lists, blog entries, Wikipedia articles... ad infinitum. If you improve your emacs skills, your skill at editing all of these things increases. If a new language comes along, or a radical new way of using an old language, you needn't be one of those tiresome people who sits on the sidelines, complaining, because the New Thing lacks IDE support: You've got an editor that works fine with the New Thing, and which you already know how to use, and you can incrementally improve that editor by teaching it some New Thing macros, and before long someone (maybe you!) will write some emacs modes to support the New Thing.

Meanwhile, emacs skills do not become obsolete. The editor is quite possibly older than you, and will almost certainly live as long as you. It's cross-platform and open-source. Because it is not tightly tied to one language, platform, version-control system, workflow, or vendor, it has transcended and outlived all of these things.

>For one thing, your text editor can be used to edit anything that is made of text:Python, PHP, Javascript, SQL, C, Ruby, Perl, Lisp, Haskell, Erlang, Java, shell scripts, config files, HTML,

Yes, I get that. Funny, I actually do use Excel a lot to edit a lot of these things and don't think I could improve my productivity in any of them more than 10 or 20%. My real question is how much it would help me in the language I spend 80% of my time in(Python now), versus an IDE that was built specifically to help people writing Python.

But you make a good case and I'll probably go harder into emacs(I do use vim a fair amount now, and will try TextMate when I get that mac.

I actually do use Excel a lot to edit a lot of these things and don't think I could improve my productivity in any of them more than 10 or 20%.

Things that emacs can do for most of the languages in that list (after you install some appropriate emacs modules) that I doubt Excel can do very easily:

Syntax highlighting (the emacs term is "font-lock"). Auto-indentation based on language syntax. Auto-completion of symbols based on the contents of open files (if you've defined a constant "MECHFISH" in a file, and you type "MEC" in another file and press a keystroke, the system fills in "MECHFISH". Press the keystroke multiple times to scroll through multiple possibilities.) Snippets (type "func" and press Tab; your editor inserts the skeleton of a function definition for you). Integration with your version control system (git, in my case). Navigate from one of two dozen open files to another without moving your hands from the keyboard. Browse directory trees in panes, picking out files for editing -- or run a shell command across a bunch of selected files. Search-and-replace using regular expressions. Recursive grep through directory trees (I use emacs igrep-mode for this.)

This is by no means an exhaustive list. So suffice it to say that if you can't get more than a 10% "productivity" improvement by swapping emacs for Excel, you must be one hell of an Excel power user!

Incidentally, don't spend too much time bouncing from vim to emacs to TextMate. These editors take time to learn. Pick one and focus on it. Read some blogs and some wikis. Get really good at your editor of choice.

> Funny, I actually do use Excel a lot to edit a lot of these things

How is that even possible? I'm not trying to be snarky or anything, I seriously want to know what your workflow is. It never would have occurred to me to use Excel for editing SQL queries; and as for Lisp or config file or HTML... how?

A lot of what I do is taking data from one source(ie an HTML table) and throwing it into a database. Sometimes cutting/pasting into excel, then quickly formatting it, is easier than writing a regex to get it done.

> The editor is quite possibly older than you, and will almost certainly live as long as you.

That explains the funny smell.

The bottom line is that you need to work with something that you can extend. To suggest that the IDE/Editor designer is going to be able to anticipate all of your needs is silly. Instead, learn something like Emacs which you can extend with Emacs Lisp. Heck, Eclipse is fine if you take the time to learn how to write Eclipse plugins. Eventually you will reach a point where you start running into unique situations for which you require a unique solution. Being able to code your own is the only way to go.

Vim for the win!

I'm not a vim expert, I actually know the minimum you need to do work, and I've found it very good, but I hove almost no experience with other editors or IDEs. I do mostly python and I don't really need an IDE for that. Despite its learning curve, I've found vim to be really easy to use, once you get used to it, your muscle memory does all the work for you. Considering the time you work in an editor/IDE, i suggest just sticking to the one that makes your hands hurt the least.

I'll put in another vote for Vim, but I'm biased, as I'm a systems guy by trade. Losing my skills with vim would be death, because it's often the only working editor on a truly hosed machine.

Nope, that would be ed :) I had to use ed to rescue an OpenBSD VPN endpoint a year or so ago.

Point. I've had to use ed as well, but generally speaking, in all but the most dire of circumstances, vi will run -- I think on Solaris that vi is still statically linked. Even so, ed works very simmilarly to vi (including movement, search, save, and so on), so it's a lot easier to fix something with ed if you're a vi user. :)

seconded, there's no vi in openbsd install image

i had to use ed during installation to change the fstab (from sd0a to wd0a) of a 2.5" hdd mounted on usb

important step coz o/w rebooting from sd0a 2.5" ide put me to single user w/ read-only fs (too late for ed)

I used to develop in emacs/jbuilder now I am fully in eclipse. I miss multiple copy buffers and good keyboard shortcuts. To me, the value added by the IDE - autocomplete, extra method, generate getters and setters, find references completely, utterly and totally blow text editors out of the water. I wouldn't waste my time reinventing the wheel on a new text editor. If I were super motivated, I'd write eclipse plugins to do whatever I needed. However, I work on an eclipse RCP based project to pay the bills so I already had the learning curve financed by my job. That being said, I find vanilla eclipse sufficient for most of my needs.

I use vim and do R, ruby, and python mostly. Still, recently I've spent more time with IDEs and now I can appreciate them. Netbeans is a very good RoR IDE. I'd prefer it over Vim. for Python, the IDE that I like (and current favorite) is IDEA. Basically it's a matter of how big your project is; with 10s of thousands lines of code, I prefer an IDE, and also when you are learning the language or reading someone else's code.

Often, I don't have but a terminal, and there vim shines.

I always bounce around between Emacs, Vim and TextMate I've tried IDEs but their typically not native code, have shitty keybindings, are slow as dog crap and need to be custmized with entire plugins rather a few lines of elisp, python or whatever.

If I had to choose between the 3 I'd go with Emacs and I don't know how much more productive but well in the range of "enough". We code everyday in mostly the same place so learn your tool and enjoy it.

Two main issues come to mind:

1. Project size. It's usually easier to get an IDE to build your project, parse any errors, and show the right lines of code in a debugger, than it is to get a good compile/fix/debug cycle setup in Emacs.

2. Language complexity. There's a lot of variance between languages on what your text editor will support in terms of parsing, symbolics browsing (e.g. a class browser, function popup, etc.), and what you need for that language.

emacs's integration with C/C++'s compile/build/debug cycle is insanely good. M-x compile and M-x gdb work perfectly.

Integration with Common Lisp (SBCL at least) and Python are both also excellent.

I can't speak about other languages/systems but all the ones I use extensively have really tight emacs integration. Perhaps Java integration is weak?

Compared to how well you're coddled in something like Netbeans/eclipse, it's tough to be satisfied in Emacs. They'll search the entire classpath (not just the classes you've written) and find every match that could be usable in the given situation (according to your import declarations), using your project definition for class file resolution.

On C++, it's harder when you start using templates. Seems only systems with tightly-integrated compilers do a decent job here.

I use IDE's that have vi keyboard mappings so I get the best of both worlds. Visual Studio and Eclipse both have vi plugins.

Same here. I highly recommend WingIDE for Python development. The vim mode is pretty complete and they have been responsive to any bugs I report.

If you are interested in text editors, you should read The Craft of Text Editing (available at http://www.finseth.com/craft/). In spite of its Emacs-centric seeming subtitle, it discusses a lot of the basics of representing text and implementing an editor.

Interesting read, but I have to quote this part:

  2.4.4 Fancy Modems

  High-speed modems (9600 bps and higher) are starting to become quite common.

someday... that 14.4 US Robotics modem will be mine!

to increase productivity, you may need to 'do without'

do without mouse and hard-to-reach keys (F1-12, arrows, numpads)

i found ide is about using mouse and using those keys (like F5? to run) etc ... but i didn't use much ide shrug

in vim, you can take those keys plus backspace, alt and even esc (i map it to ^C because ^] hurts, not because of emacs) ... also xmodmap caps to ctrl

emacs still requires at least a meta key so that adds complexity. vim cheats by using modes :D

with fewer keys, the intensity = (strokes / #key) is high and that may lead to higher productivity

oh and of course, touch typing really helps especially the often untrained part like numbers and symbols.

i used 'typing tutor for mac' and trained streams of letters, numbers and symbols ... like 'aJ8@9)x|W,~2'

You can setup keyboard shortcuts to be whatever you want in eclipse.

I am 10x more productive developing Java using IntelliJ IDEA versus anything else :-)

its funny how this is the only response that included a hard number estimate. i take that to mean the improvement from a text editor versus an ide is not an order of magnitude.

emacs's "keyboard macros" feature is something I've not seen in any IDE and when you master it and start getting creative with it you can save insane amounts of time. Basically any time you need to make a bunch of changes of the same pattern to a file you can teach emacs how to make the change and then tell emacs to make the change X more times to the file. When you are accustomed to this feature and you need it and it's not there it's INSANELY frustrating! But then you remember you can just start up emacs so it's not really a big deal at all. :)

I could have sworn that most "programming" editors support macros, just not to the extent that emacs does.

I know I'm on the outside with this, but I don't even think I'd want to program without an IDE anymore. Not only do they save time, but I find they also save MISTAKES which one of the most valuable things out there. For example, how many times have you had that one variable or reserved word misspelled by one character and it took you how long to find it?

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact