Live data from Hacker News

Vim's 400 line function to wait for keyboard input

geoff.greer.fm

231–239 of 239 posts

Re: Vim's 400 line function to wait for keyboard input

#231

Earlier quoted context omitted.

That is fascinating to me, in a train-wreck sort of way. We had a discussion a few days ago about the ways in which some interfaces (command line in particular) can be user-hostile. ( https://news.ycombinator.com/item?id=9831429 ) Vim's Ctrl-S appears to be a function, keyboard-adjacent to several commonly-used functions, whose main effect for many users is "cause the program to fail immediately with no indication of…

It is not "Vim's Ctrl-S"; it's the terminal emulator's ctrl-s. Same thing happens in less, for example.

Ah, my mistake. Same criticism applies, though; possibly more so, as a terminal emulator running within a GUI would find it even easier to display a useful status message or similar.

Re: Vim's 400 line function to wait for keyboard input

#232
post #178

Earlier quoted context omitted.

"Vim is, without question, the worst C codebase I have seen." From the example you give, I agree it must be bad. But if you want to see something worse, check out PHP. No, not the billions of programs written in the PHP language (which are, indeed, almost all terrible), but the C source to the PHP interpreter. Obviously PHP was invented by someone who just doesn't care about creating a decent programming language. Ev…

The best-engineered technology is rarely the most popular. I'd be interested to see a list of well-written code bases that are also popular. The interesting thing about PHP (the program) is that, in my experience, the code doesn't suck because it was hastily written or because it was written a long time. It sucks because the people who write it and work on it have bizarre, nonsensical philosophies about writing code.…

Checkout the Nginx source. It's pretty damn good.

Re: Vim's 400 line function to wait for keyboard input

#233

Earlier quoted context omitted.

I use Neovim as my daily editor, it definitely has it's quirks over Vim (sometimes it takes over 10 seconds to write to certain files, locking up Neovim and there are some bugs with the fuzzy finder I use that cause file corruption that aren't present in Vim) but on the whole it's pretty stable. Haven't encountered any issues yet that are more than a minor annoyance.

> ...there are some bugs with the fuzzy finder I use that cause file corruption... Having your text editor corrupt the file it's working on sounds like the absolute worst case scenario. Is this fuzzy finder thing some third-party plugin? Do you have any idea why it corrupts the files that you point it at?

It's a third party plugin, it's definitely a Neovim issue because the file corruption doesn't happen with Vim. No idea why it happens. I'm fine living with it because I just check the file back out if it corrupts it. It's only an issue when opening a new file so it doesn't cause work to be lost.

A github issue about it https://github.com/junegunn/fzf/issues/206

Re: Vim's 400 line function to wait for keyboard input

#234
post #48

Earlier quoted context omitted.

I made the page as a companion piece to a blog post[1]. The code works, but it's quite buggy. Also, it is almost certainly broken on outdated OSes. It's just that nobody uses the latest Vim on IRIX or VMS, so no bug reports get filed. A quick glance shows some obvious errors in RealWaitForChar(). For example: with typical preprocessor defines, it uses gettimeofday() in a select() loop. This will break if the system c…

I too have followed the vim mailing list for many years, and tried and failed to submit a patch to it. I mostly use neovim now, and have successfully submitted a patch to it. Based on these experiences I found your blog post unnecessarily incendiary. The thread of your patch submission ( https://groups.google.com/d/msg/vim_dev/-4pqDJfHCsM/LkYNCpZj... ) was actually quite civil. It didn't do what you want, but let's b…

"...they explicitly allow forks like neovim for the aspects they can't find time for."

With the risk of sounding like captain obvious here, but in open source you do not have the luxury to allow or disallow forks, they just happen.

Re: Vim's 400 line function to wait for keyboard input

#235

Earlier quoted context omitted.

Do Apple supply security updates for Snow Leopard still?

Apple doesn't even supply security updates for 10.9 anymore.

So the OS is EOL. In that case why should 3rd party software go out its way to support it?

Re: Vim's 400 line function to wait for keyboard input

#237
post #234

Earlier quoted context omitted.

I too have followed the vim mailing list for many years, and tried and failed to submit a patch to it. I mostly use neovim now, and have successfully submitted a patch to it. Based on these experiences I found your blog post unnecessarily incendiary. The thread of your patch submission ( https://groups.google.com/d/msg/vim_dev/-4pqDJfHCsM/LkYNCpZj... ) was actually quite civil. It didn't do what you want, but let's b…

"...they explicitly allow forks like neovim for the aspects they can't find time for." With the risk of sounding like captain obvious here, but in open source you do not have the luxury to allow or disallow forks, they just happen.

You can use shady licenses to prevent people from re-using your code, or you could not be open source. It is a kinda-explicit green flag.

Re: Vim's 400 line function to wait for keyboard input

#238

Earlier quoted context omitted.

I am reminded of the old Joel on Software article "Things you should never do part 1": http://www.joelonsoftware.com/articles/fog0000000069.html From the article: "The idea that new code is better than old is patently absurd. Old code has been used. It has been tested. Lots of bugs have been found, and they've been fixed. There's nothing wrong with it. It doesn't acquire bugs just by sitting around on your hard drive…

He is talking about commercial software where the only thing that counts is money in and money out. That a free software developer should never clone and rewrite another developers software is false. Lots of successful projects are rewrites or clones of existing software, like QMail over Sendmail and vim itself over vi.

Er, the article in question was written about Mozilla...

Re: Vim's 400 line function to wait for keyboard input

#239

If you are all such experts, why don't you "fix it" and then pull request it in.

Please, you can critique something even if you lack the skills to fix it, or the desire to fix it, or the time to fix it. Also, you can point out that something is broken even if you have no suggestions on how to fix it.

You certainly can, and in polite society folks who frequently engage in this sort of behavior are commonly referred to as "assholes".
Post reply on HN