So, when can this go wrong? When you try learning a language radically different from any others you've seen before at three in the morning.
Introducing J, an array programming language. What is an array programming language, you ask? Well, first off, they're confusing as hell and trying to read code written in one is like trying to translate hieroglyphs while simultaneously being whacked with cactuses. Angry cactuses.
Here's a good example of some APL (the original array language) code, which J is closely related to:
(implements a version of Conway's Game of Life, though I'm sure you already figure that out)
Yeah, it doesn't even stick to ASCII. J does, though it still manages to be not much more readable:
+/ i.@x:&.(p:^:_1) N
The above returns the sum of all primes less than N.
As cryptic as it might seem from the above, it's actually a pretty cool language. I wouldn't ever use it for general programming purposes before trying Python first, but if I'm working on a Project Euler problem, sometimes it might be quicker to fire up the J interpreter and write a single line of code.
Of course, I've still got no idea as to what the hell I'm doing.
I nearly cried after reading this.
ReplyDeleteIT'S SO BEAUTIFUL ^___^
What's up? I'm Pescina at Mahalo. Drop me a line whenever you can, please.
ReplyDelete