[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I started programming in C almost 20 years ago. Vim is, without

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 2

File: 1461308415791.png (66KB, 1484x428px) Image search: [Google]
1461308415791.png
66KB, 1484x428px
I started programming in C almost 20 years ago. Vim is, without question, the worst C codebase I have seen. Copy-pasted but subtly changed code abounds. Indentation is haphazard. Lines contain tabs mixed with spaces. Source files are huge. There are almost 25,000 lines in eval.c. That file contains over 500 #ifdefs and references globals defined in the 2,000 line globals.h.

Some of Vim’s source code isn’t even valid text. It’s not ASCII or UTF-8. The venerable file can’t figure out the encoding.
ggreer@carbon:~/code/vim% file -I src/digraph.c 
src/digraph.c: text/x-c; charset=unknown-8bit

Thankfully, eval.c is pure ASCII.

Many of Vim’s #ifdefs are for platforms that became irrelevant decades ago: BeOS, VMS, Amiga, Mac OS Classic, IRIX. These preprocessor statements may seem innocuous, but they slow development and inhibit new features. Also, Vim doesn’t even work on most of these platforms anymore. It’s just that nobody has an ancient system with which to test Vim. Neovim developers analyzed many of the preprocessor statements and found a significant number that could never be included in a working Vim.


A couple of months after my disillusionment with Vim, Thiago de Arruda submitted a similar patch. It was likewise rejected. But unlike me, Thiago didn’t give up. He started NeoVim and created a Bountysource for it.

Neovim is exactly what it claims to be. It fixes every issue I have with Vim: The plugin API. The codebase. The community. The BDFL.

Neovim’s codebase is a substantial improvement. They’ve replaced much of the hacky, platform-specific code with libuv. They’ve fixed the problems with indentation, style, and bad file encodings. They’ve removed old code for ancient, unused platforms. They’ve drastically increased test quality and coverage. There’s still much to be done, but the difference is already worlds better.
>>
//install gentoo
>>
>>58659625
Complexity stemming from cross-platform support may be excusable, but even something as simple as reading keyboard input is a nightmare in Vim. Stepping through with a debugger will result in call stacks such as inchar() in getchar.c calling ui_inchar() in ui.c, which calls mch_inchar() in os_unix.c, which calls WaitForChar(), which calls RealWaitForChar(). This call stack can be completely different on different platforms. It also differs when running in command line versus GUI mode.

Figuring out Vim’s control flow is harrowing. Even when you hit paydirt in RealWaitForChar(), the code is extremely hard to follow. Here’s a snippet.
# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
/* Remember at what time we started, so that we know how much longer we
* should wait after being interrupted. */
# define USE_START_TV
struct timeval start_tv;

if (msec > 0 && (
# ifdef FEAT_XCLIPBOARD
xterm_Shell != (Widget)0
# if defined(USE_XSMP) || defined(FEAT_MZSCHEME)
||
# endif
# endif
# ifdef USE_XSMP
xsmp_icefd != -1
# ifdef FEAT_MZSCHEME
||
# endif
# endif
# ifdef FEAT_MZSCHEME
(mzthreads_allowed() && p_mzq > 0)
# endif
))
gettimeofday(&start_tv, NULL);
# endif

That if statement’s conditions span 17 lines and 4 different #ifdefs. All to call gettimeofday(). Amusingly, even the body of that statement has a bug: times returned by gettimeofday() are not guaranteed to increase. User intervention or ntpd can cause the system clock to go back in time. The correct solution is to use a monotonically increasing time function, such Linux’s clock_gettime() or OS X’s mach_absolute_time().
>>
File: 1470338466909.png (1MB, 759x7857px) Image search: [Google]
1470338466909.png
1MB, 759x7857px
Vim BTFO
>>
>>58659625
$ file src/digraph.c
src/digraph.c: Non-ISO extended-ASCII C program text
>>
> deletes 3000 lines of code removing backward compatibility
> hurr durr muh project
>>
>>58660369
But legacy code holds development, anon. It makes changing/adding new stuff a nightmare, and deprecated OSes should not remain compatible. It's not like old versions of vim will stop work suddenly.

An example is mpv, which began as a legacy code removal, and then added new features.
>>
>>58659625
Stop copying text from blogs.
Also what use is the best code base improvement if the editor input scheme is shit by itself.
>>
>>58659625
vim is trash anyways, a relic of the past
>>
>>58659625
>I started programming in C almost 20 years ago.
Why the lies, OP?
Thread posts: 10
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.