←back to thread

628 points cratermoon | 2 comments | | HN request time: 0.409s | source
Show context
chrismorgan ◴[] No.44462001[source]
> Like, just to calibrate here: you know how some code editors will automatically fill in a right bracket or quote when you type a left one? You type " and the result is "|"? Yeah, that drives me up the wall. It saves no time whatsoever, and it’s wrong often enough that I waste time having to correct for it.

I have not yet figured out why anyone would choose this behaviour in a text editor. You have to press something to exit the delimited region anyway, whether that be an arrow key or the closing delimiter, so just… why did the first person even invent the idea, which just complicates things and also makes it harder to model the editor’s behaviour mentally? Were they a hunt-and-peck typist or something?

In theory, it helps keep your source valid syntax more of the time, which may help with syntax highlighting (especially of strings) and LSP/similar tooling. But it’s only more of the time: your source will still be invalid frequently, including when it gets things wrong and you have to relocate a delimiter. In practice, I don’t think it’s useful on that ground.

replies(13): >>44462030 #>>44462032 #>>44462150 #>>44462206 #>>44462213 #>>44462300 #>>44462368 #>>44462389 #>>44462450 #>>44463659 #>>44463863 #>>44464038 #>>44466698 #
1. rasur ◴[] No.44462368[source]
Emacs user here, and the whole "electric-mode" stuff (for matching parens or other balanced pairs of things) I find really quite useful. And closing a pair is usually something like shift+enter, which is quite simple (but also - at least in Emacs - generally completely configurable). I think the benefits outweigh the pitfalls, personally.

Can't speak to other editors though.. I don't want to sound like I'm trolling, but they generally feel quite clunky, compared to Emacs (ducks, runs ;p )

replies(1): >>44462644 #
2. bbarnett ◴[] No.44462644[source]
There's nothing wrong with emacs. Both vim and emacs are just targeting different segments of humanity, that's all. Vim is clean, concise, slim, where as emacs is more bulky, cluttered, stifling.

It's just matching, and reflecting the way different humans think, and reason, that's all.

(yes, said in jest)