4 ms·
Doesn't seem that strange compared to K[1] or Q[2], which are used by Wall Street banks. K encourages you to use single-letter variables and bunch your code up
by Thorrez 5y ago
Doesn't seem that strange compared to K[1] or Q[2], which are used by Wall Street banks. K encourages you to use single-letter variables and bunch your code up as tight as possible into long lines. Here's an example: [3]. Interestingly, their Github repo has some K-inspired C[4], Java[5], C#[6], and Javascript[7].
[1] https://en.wikipedia.org/wiki/K_(programming_language) https://en.wikipedia.org/wiki/K_(programming_language)
[2] https://en.wikipedia.org/wiki/Q_(programming_language_from_Kx_Systems) https://en.wikipedia.org/wiki/Q_(programming_language_from_K...
[3] https://github.com/KxSystems/kdb/blob/master/holiday.q https://github.com/KxSystems/kdb/blob/master/holiday.q
[4] https://github.com/KxSystems/kdb/blob/master/c/c/odbc.c https://github.com/KxSystems/kdb/blob/master/c/c/odbc.c
[5] https://github.com/KxSystems/kdb/blob/master/c/jdbc.java https://github.com/KxSystems/kdb/blob/master/c/jdbc.java
[6] https://github.com/KxSystems/kdb/blob/master/c/c.cs https://github.com/KxSystems/kdb/blob/master/c/c.cs
[7] https://github.com/KxSystems/kdb/blob/master/c/c.js https://github.com/KxSystems/kdb/blob/master/c/c.js
- smsm42 5y agoThank you. Now when I'm thinking some code I have to untangle is bad, I'd always remind myself "at least it's not K-inspired C"...
- grayrest 5y agoThis took me a while to figure out but K/APL code is built on a different value system than most software. Specifically, the goal is to be able to see and operate on the entire program at once. Obviously this only works for programs up to a certain size but that size is larger than you'd expect when abstractions, variable names, and general legibility are sacrificed. I wouldn't write code this way but I can see how someone would find it valuable.
- trenchgun 5y agoVery interesting. I am feeling the urge to learn array processing languages. There is something very tempting.
- leprechaun1066 5y agoThe big banks don't write code in K4 though, managers generally encourage people not to write code in it due to the difficulty of finding developers who are fluent in it. They all use q and q is very wordy and highly readable if you speak english. It's mostly just developer defined functions which are compositions of the keywords of which there are not many: https://code.kx.com/q/ref/#keywords https://code.kx.com/q/ref/#keywords Most of the code you would see in a kdb+ system in an investment bank won't look like any of the links you've provided.
- mst 5y agoDo you have any suggestions for q code to look at? Every time I try array languages I bounce off the ubercompact and I feel like there's actually a chance I could learn something more q like.
- liveranga 5y agoI have a copy of Fun Q sitting in the tsundoku pile on my desk that seems pretty good from a quick flick through. https://www.fun-q.net/ https://www.fun-q.net/