23 ms·
Is the terseness of the programming language supposed to blow my mind? I know nothing of K, other than my quick STFW, which says it is some kind of proprietary
by readingnews 4y ago
Is the terseness of the programming language supposed to blow my mind? I know nothing of K, other than my quick STFW, which says it is some kind of proprietary language. What would that look like in say Python, I wonder?
- jonahx 4y agofor reference, golfed k code is typically 1/2 to 1/3 the size of golfed python code, which would be somewhat hard to read for a python programmer unfamiliar with golfing tricks. probably around 1/4 or 1/5 the size of ordinary python code.
- anonzzzies 4y agoDo you mean normal (idiomatic) k code is 1/2 to 1/3 of golfed Python? Because that seems more accurate. This code by John is not golfed.
- jonahx 4y agoI meant golfed vs golfed. Eg, this is a pretty typical result (14 vs 38): https://codegolf.stackexchange.com/questions/258335/shortest-code-to-find-the-smallest-missing-positive-integer/258389#258389 https://codegolf.stackexchange.com/questions/258335/shortest... EDIT: Actually, my memory failed me. I just took a quick survey of some more questions and 4x or 5x seems typical for golfed vs golfed.
- pasquinelli 4y agothe terseness isn't supposed to blow your mind, it's an artifact of k's iversonian heritage. the first iversonian language, apl, was originally intended as a kind of mathematical notation for computer programs, a compact notation for defining algorithms-as-mathematical-objects. imagine a programming teacher writing code on a chalkboard to the same degree a math teacher writes math on a chalkboard and the need for compact notation becomes obvious, i think.