Ask HN: Best code editor?
Hi, I currently use Notepad++ which I'm really satisfied with. I love Visual Studio but is just a hastle to work with sometimes(long loading time, not useful when working with 1 code file(etc), no reason to create a new "web project" instead of a file, etc).
I'd love to know what you use and if you're satisfied with it?
135 comments
[ 3.6 ms ] story [ 180 ms ] threadhttp://www.activestate.com/komodo_edit/
Just because it's not the most discoverable interface doesn't mean it's user hostile. I wish more software designers would look at vim as an example. A text editor falls into the category of software which users spend a ton of time using. For those types of software a steeper learning curve is completely accpeptable if it means the users can operate the software without even consciously thinking about it once they've learned how to use it.
Yes, vim is a non-discoverable interface.
http://www.google.com/search?q=discoverable+interface
( Side note: from that search I found this:
http://www.catb.org/~esr/writings/taouu/html/ch01s01.html
There it lists "... concision, expressiveness, ease, transparency, and scriptability." It then expands on each, but mysteriously quote "Discoverable" in place of "scriptability." Very odd.
But I digress ...)
Now the question is - without having to wade through plodding tutorial after plodding tutorial, how can we help people discover the interface? This doesn't just apply to vim, it applies to your web site, or application, or even your company procedures.
It's now a long time since I learned about :sp and ctrl-w to create and move between windows in vim. How can we help others find these things? How can we help them find the fast way of doing things on our web facility?
As a parting note - I wouldn't equate efficiency to "user-friendly."
fortune in /etc/profile is something I miss about older Unixes and Unixalikes that seems to be evolving away.
For me "discover" means "edit without the mouse." Once you do that, you're hooked - you can discover the voodoo magic at your leisure, from then on.
Second problem: And even then, you can't find it in the help (it's organized like a professional index - like that of a legal textbook - you have to know what you're looking for before you can find it). Google solves this problem.
Google also helps solve the first problem, of "what to search for": you search by describing the difficulty or problem you have. A brilliant resource for this is Stackoverflow. It's works well for developer-centered, technical questions. The internet is the vim help: "a user generated FAQ". But this is just a way to cope with poor discoverability - the real answer is to design the interface to be discoverable.
It's not exactly laziness, it's more that I got really spoilt at some point in the past by writing my own editor, but maintaining and porting it to new platforms as well as lots of work on customer machines has made it infeasible to keep the project going.
So, I use vim. But at the bare minimum level, I really should go and do something about that.
Thanks for the prod!
Also, hjkl is the most beautiful thing I've ever experienced, I constantly wish TextMate and VisualStudio gave me the separation from edit/navigate mode like VIM does.
http://unxutils.sourceforge.net/
Doing so, not only can I use them in vim (!sort, !ls, etc), but I also get a friendlier cmd :)
You can use it natively, and it works fine too, but I really like my unix utils
http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...
[Original source seems to be unavailable at the moment]:
Interview with Bill Joy, August 1984, Unix Review magazine http://74.125.95.132/search?q=cache:N14AkASeqMoJ:www.cs.pdx....
This goes for Emacs, too. I get the feeling I've never really used these tools the way they're meant to be used.
After that, being around other Vim users (in person, on the vim-users mailing list, or subscribing to the !vim group on identi.ca, etc.) is best - being able to ask someone "Is there a better way to do X?" or have someone watching over your shoulder say "I can't believe you're doing that the slow way!" is a great way to learn.
The best long-term solution, I've found, is to remember that laziness is one of the great Programmer Virtues, and pay attention whenever some editing task gets tedious, and take a moment to look for a solution in the (amazing complete and well-indexed) Vim online help (":help") and perhaps the Vim Tips site (http://vim.wikia.com/)
BUT everything goes downhill when the "window" arrangements are messed up. I am like, WTF did this open in the upper window. HTF do I move this "window/screen" from A to B. When this happens, I restart Vim and then open the files again. Really annoying. I wonder how expert Vim users go about this issue? Any tips?
I prefer using tabs with Vim. Here's a short overview:
* :tabnew to open a new tab.
* :tabe <FILENAME> to edit a file in a new tab.
* :q or :close to close a tab.
* :tabnext and :tabprevious to move between tabs.
* Ctrl+PgUp and Ctrl+PgDown are bound to :tabnext and :tabprevious. On my MacBook, I bind those to Cmd+[ and Cmd+].
* And, of course, :h tabs to find help.
map th :tabnext<CR> map tl :tabprev<CR> map tn :tabnew<CR> map td :tabclose<CR>
That said, it does depend on what kind of development you're doing. I think that in some cases, you can make life harder for yourself by straying from what most developers in your chosen language/framework are using. If I need to code up some .Net stuff, I'm going to use the MS tools. Likewise, if I'm doing heavy Java work, I'm going to likely use Eclipse (even if it's a tad bloated for my taste). If I'm on the Mac doing iPhone development, I'm going to use XCode. Sure, I could use vim for all of the above, but these IDEs are already very well optimized for their respective languages, and vim feels a bit out of place for me.
Check it out: http://derekwyatt.org/
A Macbook Pro is currently going for around $3500(USD), so its really hard for me to convince myself its worth it.
Who else here is totally stoked about the free 2.0 update?
Use the latest 'unstable' build of Intype (www.intype.info) on Windows daily.
I know Panic is all about Mac software, but I wish they would find a way to get apps like Coda up and running on other platforms.
And yes, I'm very satisfied with it. Everytime I see a feature in another editor I like, EmacsWiki usually has an implementation or guide.
Plus emacs has org-mode...
I gave it a try around a year ago since a lot of people I respect (looking at you HN) seem to worship it. After around a month I still thought it to be arcane and backwards. I even posted here to get some feedback on what I was doing wrong (http://news.ycombinator.com/item?id=313025) but we just never got along, Emacs and I. After around 2 months I went back to notepad++.
I'm not saying emacs is a bad editor, on the contrary, just that it's not for everyone and that it does seem to require a substantial effort before you're really productive in it.
I love emacs now. Yeah it takes ages to learn, moving around isn't quite as quick as hjkl in vi, emacs lisp isn't perfect, but it really is worth it. Nothing is as powerful.
23 even lets you connect to a running process from a tty and GUI simultaneously.
And yeah - org-mode is great. As is the gdb integration.
If I had used any other editor, it would have just been a text editor, and nothing more. With Emacs I could build real tools and multiply my effectiveness. If this job weren't Windows-only (yeah...) I would have used TextMate, but I think I'm better for forcing myself to learn Emacs.
http://github.com/technomancy/emacs-starter-kit
The starter kit serves as your .emacs.d and comes with some useful modes and easy customization.
I'm not yet maximizing all of the modes, but I am more productive than I've been in other editors, especially when it comes to switching between many open files with a few keystrokes.
http://aquamacs.org/
You can use other emacs builds on mac OS. I use Carbon Emacs. Emacs 23 has a native cocoa build now.
I found the Emacs Starter Kit (http://github.com/technomancy/emacs-starter-kit/tree/master) and the Meet Emacs Peepcode Screencast (http://peepcode.com/products/meet-emacs) to be awesome. After a couple hours of working through the screencast, I was a 5x better Emacs user than I had been after 2+ years of Aquamacs use. You have to "get" Emacs and Aquamacs doesn't force you to do that. The $9 for the Peepcode screencast was the best money I've spent in a long time.
http://atomized.org/2009/08/cocoa-emacs-231-cvs-builds-and-t...
I've since reverted to the Carbon Emacs 22 build (since I can't cope without fullscreen).
http://www.microsoft.com/express/
But really the only editors worth learning and using are Emacs and Vim, decide between which one or use both.
Eclipse, plus vim in a terminal window, take care of all of my editing needs.
Sometimes it seems like people buy quad-core machines and 8GB of RAM, and then are angry if an app uses more than 1% of CPU and a few MB of that RAM.
I'm not going to sit here and say that Eclipse's hour-long startup time doesn't annoy me, though...
The RAM I couldn't care about, that's fairly cheap these days. I haven't a clue what that software does when it starts up but there has to be some way to optimize it.
Intellij is not much better.
It's why I gave up on Eclipse a while back. (Well, that, and its tendency to crash with out-of-memory exceptions when using the syntax parser set to "full." That was the final straw.)
Also, I'd recommend eclipse users (that are vim fans) to try out viplugin (http://www.viplugin.com/viplugin/). It is far from supporting all of vim's commands, but it has enough for me to feel comfortable.
What won me over is the excellent refactoring support. That is definitely something that I was not going to be able to hack together with some Emacs-lisp. It just makes sense that rename, extract variable, extract method, etc. are atomic operations.
A much-underrated feature is the Mylyn task-focused programming system, which reduces information overload and saves you a lot of time repeatedly navigating around hierarchies and files. I've seen nothing comparable in any other editor.
There is also some great integration into bug tracking systems. My projects use Bugzilla, and I almost never need to visit the slow bugzilla web interface or wade through bugmail emails anymore - bug search and details, comment posting and bug change notifications are all right there in the Mylyn task list.
Before switching to Eclipse when the 3.5 release came out, I previously did all my Java work in jEdit, which I still use for other languages; I hate to think how much time I wasted by manually doing the tedious tasks that Eclipse could have automated for me.
I concede that you do need a fast machine, lots of memory and plenty of screen space, but it's well worth it for the time savings on the tasks for which it is suited.
http://www.dina.dk/~abraham/religion/ed-standard
It does have its faults (like any piece of software), but it can be very helpful.
http://www.netbeans.org/features/java/profiler.html
Plus the GUI editor kicks ass for doing JRuby Swing stuff.
Icing on the cake: There's a vi plugin. :)
That said, I'm slowly becoming more efficient in vi and it will eventually overtake Jedit for myself.
It's my impression that it was orphaned. Is it still under active development? I'd like it to keep going.
jEdit is great for its impressive range of language syntax highlighting support, large selection of small and useful plugins, good search/replace features, and ease of writing your own syntax highlight modes, recording macros, etc. As others have said, it has the power of emacs or vim, and everything is customizable, but it lacks any substantial barrier to entry.
It also has the advantage that you can use the same user profile on multiple platforms (e.g. linux/windows) - before I ditched my Windows machine I ran like that, rsync'ing everything to/from linux at work.
It's certainly still being developed, though activity is less than in the past. Last release was July: http://jedit.org/index.php?page=devel#schedule
I've found that the latest 4.3 releases are very stable and largely feature-complete for the purposes I use it for.
jEdit is great, it works on both Windows and Linux with no visual quirks, you easily make up your own syntax for custom languages, it has a console, a file system and a project viewer plugin.
Also it has subpixel sampling for fonts which keeps my eyes not falling off the sockets after long time hacking. Finally a feature that I have not found in other editors in the custom folding modes (like the region thing in VS) which makes it easy to understand the structure of long files.
The only negative issue that I 've noticed so far is the missing character substitution for foreign languages due to the Java thing. For example if you use a monospace font other than courier new and your code/resources contains multiple languages, english, greek, japanese etc you get squary blocks all over the place. All native Windows and Linux apps do automatic font substitution!
Otherwise people will just laugh at you behind your back. Or to your face.
$cat > $kernelroot/drivers/custom/screen_driver.c
[note, you learn not to make any typos eventually]
Seriously though, isn't this like asking what kind of car is the best to drive? I like vim, nano, n++, and textmate, but the "best" for me changes as often as my mood.
Emacs however has a steep learning curve. It is worth it in the long run, but I understand why many people shy away from it. Modern emacs distributions have icons and helpful toolbars and are not too intimidating, so if you think about it, give it a try.
Oh yes, and I run vi (vim or gvim) once in a while just so that I would not forget what it feels like, that's all. :-)