3 ms·
Every time I see one of these array-processing languages, I'm always baffled at how small you can make the code, but then am further baffled and wonder how anyo
by tombert 7y ago
Every time I see one of these array-processing languages, I'm always baffled at how small you can make the code, but then am further baffled and wonder how anyone is able to read/debug it.
To people here who know APL/J/K rather well, does it become second-nature and easy to find mistakes?
- RodgerTheGreat 7y agoYep.
- kick 7y agoI second this.
- xelxebar 7y agoMy experience is only with J, but I imagine it carries over to APL and K as well. The code ends up reading a lot like an algebraic sentence after a while: x (1/u + 1/v) = x/(uv) (u - v). Spot the error? Once you are familiar enough with the orthography that the symbols dissapear and you see the concepts, once you have some familiarity with the common ways these concepts interact, then J/APL tend to feel refreshingly clear in their expressiveness. This is similar to how an algebraic equation feels a lot clearer than its rendition into "more readable" prose. Take the above equation and contrast it with this: The sum of two inverses, when scaled by some factor, equals the difference between the two reverted numbers, scaled by the quotient of the original factor with the product of the reversions.
- toastking 7y agoYou start to see "idioms" in the code. Common ways of doing things. You learn that taking the first element of a reverse of a list is the last element, per se. Like any language, with experience it becomes very easy to read.