3 ms·
Surprised nobody talks about the kdb codding style: https://github.com/KxSystems/kdb/blob/master/c/c/k.h https://github.com/KxSystems/kdb/blob/master/c/c/k.h
by vhb 8y ago
Surprised nobody talks about the kdb codding style: https://github.com/KxSystems/kdb/blob/master/c/c/k.h https://github.com/KxSystems/kdb/blob/master/c/c/k.h
- swalladge 8y ago:O that is ... interesting. Sure that's not an entry for the ioccc? ;)
- vhb 8y agoNope :) This is being used everyday in production by most financial institutions. https://code.kx.com/wiki/Cookbook/InterfacingWithC https://code.kx.com/wiki/Cookbook/InterfacingWithC I've been told that the guy who wrote this believe that the brain only has a limited buffer to compute source code. So he is trying to use the shortest code possible everywhere.
- saagarjha 8y agoI think looking at this code has already caused a buffer overrun in my brain ;)
- 0xfeeddeadbeef 8y ago"This is being used everyday in production by most financial institutions" — you can't be serious...
- userbinator 8y agoI'm not surprised, it's an APL family language.
- mruts 8y agoKDB developers make BIG money. It's an APL-like language and used to analyze financial time-series.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- nomel 8y agoIt looks more like the guy that wrote this wanted good job security and pay, and ended up making and industry with good job security and pay.
- yiyus 8y agoThat's Whitney's style. My preferred example is http://www.kparc.com/b/b.c http://www.kparc.com/b/b.c It looks obfuscated, but in fact it is just a lot of information. Many people would claim dividing it in 10 files with longer function names and less tricks would make it easier to understand, but after spending a long time studying (and partly rewriting) this code, I actually find the terse version better.
- deleted 8y ago[deleted]
- taneq 8y agoThe problem with satire is that no matter how far over the line you think you've gone, someone will always wonder whether you really meant that.
- pavel_lishin 8y ago> after spending a long time studying (and partly rewriting) this code, I actually find the terse version better. I'm sure Mr. Goldberg understood his machines just fine, too.
- jungler 8y agoI've tried Whitney's style and got some good takeaways from it. I don't need that level of density, but it made me realize that when the code is already doing something very abstracted from business logic, there is no sense in trying to name the variables with more than one or two letters. (x0 and x1, appearing in geometric functions, are favorites of mine.) I also started using "result" after seeing it in Pascal code and have quite liked it for many years, but I just had the epiphany that "ans" (answer, as seen on several graphing calculator lines) would be a little more dense. Basically, it was well worth it to try these radical styles out. They did a lot to smooth my everyday coding.
- userbinator 8y agoOr anything APL-related, really: https://news.ycombinator.com/item?id=13565743 https://news.ycombinator.com/item?id=13565743 https://news.ycombinator.com/item?id=13797797 https://news.ycombinator.com/item?id=13797797
- gohwell 8y agothat's just for writing c interfaces to kdb. As someone who writes q all day, it's typical to see functions written in one line and no white spaces. The mantra is, if it takes you more than 1 line you're probably doing it wrong.