top | item 21124288

Why don’t we have good code editors?

26 points| kreykjalin | 6 years ago |kristofer.reykjal.in

72 comments

order

tlackemann|6 years ago

> In all seriousness though, a terminal does not a pleasant user experience make.

Yes, yes it does. At my fingertips I have access to every single tool and program without needing to clumsily navigate through folders or Finder, whatever it is. Moving my hand away from my keyboard to my mouse to check TS typings is biggest waste of time when I know how to get to any line in any file with less than 3 keystrokes.

> The way these editors achieve this is through graphical representation of the project hierarchy – the file sidebar

I work on a site which is part game engine, part marketplace, and part React application. I have never once used a file tree because I don't need it to understand the code. This isn't a flaw of terminal editors, it's classic PEBKAC.

Terminal editors don't suck. They require learning and discipline, something that some might argue is becoming a lost art in this field. In the days of "gluing modules together", maybe vim isn't for you, but it's for me and this piece contributed nothing.

mattlondon|6 years ago

> I know how to get to any line in any file with less than 3 keystrokes

FWIW it is 2 key strokes in VSCode (ctrl-g, then the line number or -n to index back from the end of the file) out of the box. Ctrl-p takes you to any fuzzy-matched file in your workspace.

My point is that VSCode has a lot of shortcuts too - you don't need to use the mouse if you really do need those extra couple of seconds time savings in your 8 hour work day in order to meet your deadlines. But on the plus side you can use they keyboard or the mouse as you see fit - best of both worlds.

If you really are working in such a sweatshop where saving a couple of seconds a day is something you need to think about, then you have my pitty and condolences! At least for me, not every single waking second of my work day is spent hammering out code - I am probably only actively typing in new code perhaps 20-25% of the time max with the rest going on reading existing code, stepping through a debugger, dealing with tickets/bugs, running tests, doing emails, meetings etc etc.

For me, something like VSCode offers some nice visual benefits, e.g. the minimap is super useful, subtle indentation lines, line-length rulers, intellisense popups near where I am actually looking, spelling squigglies etc. I would not be surprised to learn that vi/Emacs can do the same, but if you are adding all that to a text mode editor, why bother and not just use a modern visual editor and just be done with it? Just muscle memory?

shawnz|6 years ago

The mouse is not a "clumsy" input and there are plenty of situations in which the mouse allows more efficient usage than the keyboard like when navigating through 2D space. For example it is clearly more efficient to place your cursor at a certain arbitrary point in the document using the mouse than to navigate there using keyboard commands.

I'm also not really convinced about the "hands on the keyboard" argument... What percentage of the time that you work are your hands actually on the keyboard and ready to input? Are they on the keyboard right now? Because that seems like an uncomfortable way to sit at a workstation. I also don't think it takes very much time to switch between the input devices unless maybe you don't have practice with that workflow.

overthemoon|6 years ago

I guess we can't all be 10x geniuses who have their codebase memorized. It's really not crazy to want to take advantage of modern UI, and the idea that you simply don't need to see a file tree is nonsense.

johannes1234321|6 years ago

I love using the terminal. And I mostly use vim and for raw editing hardly anything can beat it.

But there are things which a terminal can't to. The article mentionedd the ability of IntelliJ (and derived IDEs) to show the code of functions in a mouse over tooltip. A proper tree to show hierarchy of code. The ability to click and browse and so on. They are really useful things when exploring a code base.

_4ziu|6 years ago

> Terminal editors don't suck. They require learning and discipline, something that some might argue is becoming a lost art in this field. In the days of "gluing modules together", maybe vim isn't for you, but it's for me and this fluff piece contributed nothing.

I mean, I use vim too. Any project that is sufficiently large benefits greatly from a file handler, there is nothing to be proud about for remembering each and every subfile. Why not just put it right there in view? You can't possibly argue it somehow rots the brain; i mean we aren't even talking about writing code here, it's just accessing files.

winternett|6 years ago

Find and replace is laborious in VIM...

https://www.linux.com/tutorials/vim-tips-basics-search-and-r...

In Notepad++ it's easier to do for me... I use Find & Replace VERY frequently as I inherit apps developed by others, Some developers don't need to use it at all because they work on a Single Page App...

We're truly in the era of "If it works for me it's great for everyone", which is truly a bad posture to adopt, because now developers dictate features based on opinion rather than research, polling, testing and facts like they used to in the early days. This is why apps, like Android dialer become annoyingly dysfunctional, because it's made and tested on a small group who have 2 hands rather than also on people who only have one hand (and can't afford 2 clicks to get to a keypad as easily).

CLI has been around forever in terms of development. I understand there are use cases where it's highly useful, but in a world where development should be getting LESS complex, it's a dinosaur that preserves job security because of a huge learning curve.

As an architect I frequently work with non-technical people, and using abstract tools to do my work only complicates my ability to get them to understand what I do. Things should be getting simpler, but they're not.

netfl0|6 years ago

I prefer the terminal as well. Maybe he should just take the time to make a proper vimrc file and stop hyperventilating.

fennecfoxen|6 years ago

> Terminal editors are out of date. By this I don’t mean that they’re obsolete; I mean their user experience is lagging far behind modern standards. Using editors like Vim and Emacs is not a good experience for the user.

You... you are aware that you can run emacs not in a terminal, right? Use the mouse and resize split buffers and everything? It's okay if you still don't think it's good enough, just... don't pigeonhole it quite like that.

c256|6 years ago

Modern GUI emacs has basically all of the features that the OP’s rant mentions (You can even run WebKit inside of emacs, if you want), but they have to be configured. It seems likely that they haven’t tried emacs in a while, because the rant demands things about packages that already exist. If this were a serious request for help rather than a rant, “Use Spacemacs or Doom-emacs” would be a fine response.

That said, there’s nothing wrong with a little rant now and then. There’s a pretty pervasive feeling among programmers that our tools for interacting with code certainly could be better, and probably should be. I assume the OP is hitting one of those moments right now.

More seriously, though, I believe that there is an answer to the headline question: we don’t have better code editors because the people with the combination of skill, desire, and opportunity almost always fall into one of the two traps:

1.) If they want to make a better general editor for experienced, skilled programmers, then they get sucked into learning an existing editor (usually emacs or vi, sometimes both) on the way, and they find that once you are proficient, those are really quite powerful coding environments.

2.) If you want to make a better general editor for people learning to code, then they tend to create something that is limited (simplified, streamlined, etc). Along the way, they either stop at a version that’s good enough (there are lots of these around), but definitely missing things that are important to (a smaller group of) skilled, experienced programmers – at which point, see #1. The strongest candidates survive, and some of them go quite far (Linus Torvalds uses a fork of micro-emacs, there are people at Google who use nano, etc.)

In the end, the “editor wars” between emacs and vi came down (IMNSHO) to a question between “fast and lean” vs. “expandable”. In the end, both became ”expandable enough”, and software growth (bloat) grew so extensive that both became “fast and lean enough”.

jimmyvalmer|6 years ago

Summary: I would like a vscode that better integrates modal editing.

Verbosity is an existential threat.

Ballas|6 years ago

Well, it would not be a proper rant if it wasn't as verbose.

bauerd|6 years ago

>a terminal does not a pleasant user experience make

Author doesn't establish this, just takes it as a given. I wonder what features terminal emulators/editor programs would lack that are afforded by GUIs? I consider the terminal text editing experience far more efficient

bipinu|6 years ago

Efficient is not necessarily a pleasant user experience though, is it? I am not downplaying anyone's preference of one over the other. However, a better UX would mean that the initial learning curve to start with something should be low, which isn't usually with terminals.

WilliamEdward|6 years ago

Usually? File handling. It's convenient on large projects to have a list of files in view next to the code.

roryrjb|6 years ago

I disagree. Terminal is modern it's just different to GUIs, of course they were a precursor but I don't think anyone can say that GUIs are supposed to be a replacement, as in, I don't think they can say this in retrospect. It's just a different interface, which to me is much more convenient and intuitive. I can pick up a command line application that I have never used before and get up to speed very quickly. Obviously this does depend on the usage of conventions, such as environment variables, arguments, man pages and so on but because of its perceived "limitation" it probably means that applications in this domain are more alike to each other at least in terms of their interfaces. I am biased of course, I live inside tmux and vim and I would happily just use the framebuffer (and use cmus, newsboat, irssi, mplayer, et al) but I have to use a browser for work so yeah. Vim is a very good user experience, you either have to learn it a lot to be productive, or use a few plugins that gloss over this somewhat, but I don't think it has such a massive learning curve considering its vibrant ecosystem. Emacs on the other hand, and I really like the keybindings (using a subset in the shell) just makes my head hurt.

kace91|6 years ago

I think there could be a huge market for a ux effort that brings the somewhat forgotten goodies of old modal editors into the modern world, combining them with new advances like fuzzy searching. I love vim, but it's appalling that we have so many historical baggage creating a gap for the users...

It's so obvious how vim's ergonomics are made for the [adm 3a keyboard](https://catonmat.net/images/why-vim-uses-hjkl/lsi-adm3a-full...) (location of esc, control, arrow keys, etc) and yet we keep making layers of customization or force ourselves to the standard instead of doing the very needed reboot.

GordonS|6 years ago

Erm, we do have good editors? VSCode, Visual Studio, Rider, to name but a few.

I'm not really sure what the OP's beef is here. They begin by bemoaning anything that isn't vim, then move on to say they want a graphical UI, support for plugins, and a bunch of other things that pretty much any IDE has these days.

I think what they really want is a vim extension for VSCode, customised just for them?

Ballas|6 years ago

>I think what they really want is a vim extension for VSCode, customised just for them?

Exactly. But they don't want to write it themselves.

sundayedition|6 years ago

Vim has plugins that seem to address most of what you note.

Nerdtree gives you see semblance of a graphical UI. I rarely use it since installing fzf and getting better at using buffers. It's much, much easier to press a shortcut and type a partial name. I use Nerdtree when I need to browse the hierarchy. I also previously had ranger integrated into vim which is really nice

Vim has tons of user extensions. Yeah, the package managers aren't great UI but I use vim awesome website to browse and a plug-in install is a simple copy paste of 1 line.

Using tabnine with vim has been really great for autocomplete. It's probably not as good as vs code but it's good enough for me.

Peek at implementation is available via ctags. Configuration can admittedly be a bear but I have a shortcut to jump to the method definition under the cursor that works pretty well.

I'm using neovim which is usually fast and responsive. Some things like folding and syntax highlighting aren't great in certain conditions but you can write scripts to disable those things in those conditions (file name, and probably size even)

I've tried to switch away from vim but the extensibility is better than any other editor I've looked at. Neovim + tmux makes me feel pretty productive

drcongo|6 years ago

TabNine is amazing. I use it with SublimeText and it constantly surprises me by guessing correctly what I was about to type, sometimes even when what I'm about to type doesn't exist in any of my codebases.

vinceguidry|6 years ago

Use Spacemacs. Take everything that's great about Vim, and Emacs, make the configuration sane, and the features super-discoverable. You'll never look back.

GordonS|6 years ago

Does anyone know what "modal editing" is?

I've read the article, and it's mentioned several times, but I've no idea what it actually means.

dhagz|6 years ago

Basically, having two ways of interacting with the file: one mode lets you execute commands to edit the file, the other mode lets you type like in a typical GUI editor.

iikoolpp|6 years ago

> The most limiting factor for my choice of code editors is that I need modal editing. After learning how to use Emacs, and then Vim, I can not imagine going back to the typical non-modal text editing. These editors make it much more comfortable to edit text (and code), and ruined every other way of editing for me.

Truly, v*m rots the brain.

ScottFree|6 years ago

This rant reminds me of Gary Bernhardt's talk from Strange Loop 2012[0]. In that talk, Gary shows a true modal editor that has more than just "edit" and "write" modes. His talk focused mostly on visual layers that could be laid overtop of the code, but it made me think adding "debugging" and "git" modes would be nice. I certainly wish git had a dedicated mode every time I use fugitive[1].

[0]: https://www.destroyallsoftware.com/talks/a-whole-new-world [1]: https://github.com/tpope/vim-fugitive

coldcode|6 years ago

Because no one can agree on what is "good". It's entirely subjective to each person. One loves vim, one loves Notepad, one loves VSCode, one loves Intellij, maybe someone loves hammer and chisel on stones. Like virtually everything in the programming world, it's all about what gives you the ability to do what you need to do with the least extra effort. Like any tool you need what you need, not what someone else says you need. Arguing about what is better is pointless but common.

WilliamEdward|6 years ago

His first topic / sub-heading answers the question for itself: people are too fussy about editors. Everyone has different tastes when it comes to editors, some want syntax highlighting, some like integrated command line, some just want plaintext.

There are no two people with the exact same preference in editors, and that's why there are too many editors and yet still a perceived lack of quality overall.

It's also why most people end up customising the ever loving shit out of their own editors anyway.

sword_smith|6 years ago

I like that the author has high standards for an editor. He should have. In my opinion VSCode and VS live up to his requirements about out of the box intellisense, inline definition peeking, and extensions that are easy to install (VS Code being better than VS in this regard). They probably don't live up to his model requirement, though, but I think the author could have done a better job of explaining exactly what he wants from this editing mode.

dhagz|6 years ago

Vim has mouse support. You just need to turn it on in your .vimrc/init.vim with `set mouse=nv` (that specifically enables the mouse in normal and visual modes).

mpfundstein|6 years ago

Does that work in terminal? Afaik I had the only working in gvim.

giancarlostoro|6 years ago

I am kind of excited for Emacs in Rust. I would love something Emacs like that looks modern and easier to manage like VS' ability to easily drag and drop components wherever you need them, and is very fast to boot, think of ST3, CudaText, and co. Then all the bloatware is optional plugins.

I would say VS Code is a good goal, it has everything you need to have an IDE, and yet you don't feel forced to use it.

nika1975|6 years ago

The main reason for Emacs existence is the ability to customize it as you want. That's made possible by Lisp. It is on a whole different level than a VSCode plugin. How does Rust enhance this experience?

I do not get the requirement to be "very fast to boot". My Emacs instance is always running and I use emacsclient as an entrance point for external tools. This is the typical workflow for Emacs users.

jbergens|6 years ago

I think Emacs and Vim missed how popular js got. That is a reason why Atom and VSCode has tons of plugins for everything including some Intellisense-like completion.

iKnowWhyIamHere|6 years ago

I think I can relate to his feelings. I want vim with default Intellisense of VS Code.

I know about coc-nvim, but I still couldn't get it to work for C++ on Ubuntu 19.04, will try again soon.

pnako|6 years ago

> I want vim with default Intellisense of VS Code.

Your best bet is probably CLion (it's proprietary) with IdeaVim plugin. It's not perfect but it's probably easier to implement vim-mode into any IDE than turn vim into an IDE.

payne92|6 years ago

TL DR; The author wants a modal editor (like vim) that's also "modern"/graphical.

My view: this is largely a religious issue.

Editor design is like QWERTY keyboards (or beer): preferences are more dominated by your muscle memory and what you're used to, than any objective notion of "good" or "best".

frou_dh|6 years ago

Inane article title required for clickbait?