Live data from Hacker News

Why don’t we have good code editors?

kristofer.reykjal.in

41–50 of 74 posts

Re: Why don’t we have good code editors?

#41
post #25

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?

>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.

Re: Why don’t we have good code editors?

#42
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

Re: Why don’t we have good code editors?

#43

> 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…

> 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…

> 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.

The reason to not having to move your fingers/arms much is not about time. You just stay in the zone longer, you have less possibilities of distractions... It is about comfort and not disturbing the flow.

It's the same with music (wether is jazz or blues at least). Good intrumentists just don't move their hands much, lest their instrument goes in the way of their improvisation. 60% of the time, our job is quite boring, so make sure you really enjoy the 40% that's left.

Re: Why don’t we have good code editors?

#44

> 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…

> 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…

> the minimap is super useful

Is that really something you use all the time? I tried to switch from emacs to vscode in 2017, but in practice the minimap didn't do that much for me. Nor did the graphical file view to the left. The emacs experience is just too fast and good, even though it means I need to carry my customizations with me everywhere to get those intellisense popups and spelling squigglies.

Re: Why don’t we have good code editors?

#45

> 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…

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.

> the idea that you simply don't need to see a file tree is nonsense

Have somebody who uses emacs show you sometime how they navigate the file tree. The "modern UI" graphical representation with a little icon for each node of the tree isn't an advantage.

Re: Why don’t we have good code editors?

#46

Earlier quoted context omitted.

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.

I never said memorized. I do believe if you truly understand your code however (and ours spans 500k+) then you don't need a file browser to know that components live in the "components" folder. I agree with taking advantage of a modern UI, all programs could benefit from advancements. I find the article was written with little research or thought put into what is available on the terminal.

You do have to memorize a ton of arcane key strokes just to get around in your editor though. I bet that time invested is a big reason why some coders hang onto terminal editors.

IMO you shouldn't have to do "research" to setup your editor or even simply to use it effectively. With VS Code everything that you need is already integrated and clearly stated - Ctrl+Shift+P to find any command Ctrl+P to open any file in your workspace (no file browser needed). When you want to expand - you have the integrated Extensions marketplace.

And all things are accessible via the keyboard in Code as well as in my preferred desktop environments (XFCE or Windows - macOS, not so much, which is why I don't prefer it). Having the mouse to fall back to is not a bad thing, particularly when you visit someone else's station where they might have configured their editor or desktop differently than you.

If someone gave you a different 500k+ file codebase to maintain, I'd bet that you'd need to browse around a bit before you got familiar enough with things to not need a file browser.

Re: Why don’t we have good code editors?

#47

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.

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.

I don't want to even think about those things. I don't have to with Visual Studio or VS Code.

Re: Why don’t we have good code editors?

#48
post #39

Earlier quoted context omitted.

No

OK... what is the difference, as you see it?

vim (I can only really speak for vim here) has several modes for editing. The main ones are: normal, insert, visual. Most people I know (incl. myself) spend most of their time in normal mode, which allows you to manipulate text objects using movements. In insert mode, your key strokes are converted to characters which are inserted into the file buffer. Switching to normal mode isn't really the same as summoning a command prompt into which you enter commands, it's a bit more fundamental than that.

Re: Why don’t we have good code editors?

#49
post #31

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).

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

Works for me (iTerm2 + tmux + vim/neovim).

Re: Why don’t we have good code editors?

#50
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

Post reply on HN