5 ms·
Welp, you were not kidding: https://github.com/KxSystems/kdb/blob/master/c/c/curl.c https://github.com/KxSystems/kdb/blob/master/c/c/curl.c This code is basica
by kolme 9y ago
Welp, you were not kidding: https://github.com/KxSystems/kdb/blob/master/c/c/curl.c https://github.com/KxSystems/kdb/blob/master/c/c/curl.c
This code is basically obfuscated by hand. Absolutely unapproachable. Only the original author(s) can understand it.
Judging by other comments, it seems to work well. So they seem to be good programmers producing working code. It's just not intelligible by other human beings, which is a pretty bad thing, but not the only factor in software quality/health.
The Vim code base is at some parts straight batshit insane, but it's one of the most polished programs I've ever used.
All that being said, I would find infuriating to work with such code. Nope!
- beagle3 9y agoIt takes time getting used to, yes. And it is not for all people. But it's just a foreign language; You could look at Japanese text[0] and make similar statements, and would be just as valid (or rather, invalid) as your statement. You expect to be able to read it because you're used to a class of languages which are all similar enough at the surface level -- perhaps you are even familiar with more than one fundamentally different classes, say, "lispish and algolish" or "germanic and latin". But that doesn't make APLish or Japanese[0] horrible. This is just APL using C syntax. [0] assuming, the proverbial you does not know Japanese
- IshKebab 9y agoAPL isn't really readable by other humans either. This is idiotic.
- sctb 9y agoCould you please stop breaking the guidelines? We just asked you to comment more substantively than this. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- deleted 9y ago[deleted]
- marshray 9y agoThe difference between "#define Z static" and Japanese is that Japanese is an effective method of communicating between 125 million people.
- shitgoose 9y agok/q is an effective method of writing useful code. if you are not used to it and can't appreciate it, doesn't mean that nobody can.
- PaulRobinson 9y agoAnd k/q is an effective method of writing very fast software for domains such as finance understood by thousands of people. Just because you find it strange, it does not mean it's strange. I'm sure you'd find languages in Papua New Guinea difficult at times, and you'd argue English is "better" because more people speak it, and there is a richer literature in it, but the ideas expressed in those languages - and how they are expressed uniquely in those languages - are valuable to the people who speak them.
- marshray 9y agoNo one here said it was strange. The original word was 'unhealthy'. I'd be very interested to learn more about which semantics of APL-derivatives correspond to which of the 4 or 5 distinct meanings of the keyword 'static' in C.
- kazinator 9y agoI don't see where this code is getting a definition for K. (The return type of the ctype function). It's not in the "k.h" header, though that references it also. Maybe the build system injects it through the compiler command line or a forced-include header. Though the gcc command line alluded to in the block comment header shows no evidence of that. Edit: Found it! It's a typedef for a pointer to a struct k0: typedef struct k0{signed char m,a,t;C u;I r;union{G g;H h;I i;J j;E e;F f;S s;struct k0*k;struct{J n;G G0[1];};};}*K;
- hoosieree 9y agoThat's the dominant data structure in the whole program. It's a little different from what's used in APL and J, but essentially it represents an array which carries around its length, shape, and pointer to items. An explanation for the J version is in An Implementation of J [1]. There are a handful of helper functions to get/set various parts of this structure, and most of the functions in the language (and its implementation) take 1 or 2 of these and return 1. [1]: http://sblom.github.io/openj-core/iojNoun.htm#Arrays http://sblom.github.io/openj-core/iojNoun.htm#Arrays
- deleted 9y ago[deleted]