I learn best by doing. I don't have any pressing programming needs at the moment, so I'm not in a good position to learn a new language.

That said, I fool around at projecteuler.net. I fiddled with J a bit over the course of two weeks and solved three problems. A fourth problem I came up with code that works, but too slowly (ran for a day with no answer). I read through the primer and sections of the rest of the documentation.

In all cases I've stuck with implicit solutions. I have yet to write flow control in J, and all my solutions have ended up as one-liners. So although I feel like I've spent a lot of effort on J, so far I've managed to write five lines of code ;-)

Then Mike posted about his solution to another projecteuler problem. I studiously avoided reading his post or any of the follow-ups. Instead I looked at the problem and I had no clue. I had to retreat to my previous language to get a solution to the problem, just so I could look at Mike's code without it being cheating.

Imagine my disappointment when I couldn't even figure out the code.

Nevertheless, I've just solved a fourth projecteuler problem using J. That's the way it goes: I see a problem and realize that my limited understanding of J is sufficient, and I'm all set. But outside my understanding is completely outside my understanding.


I feel like an ancient alchemist working from a dusty tome, who can only mix up what the formulas tell him, never anything new. I look at something as simple as $,: and I don't know what it will do until I look it up. Something like:

mis =: monad def '>./(0:>.+)/\.y.,0'

is a serous puzzle.

So my question is this: how long should I expect it to take before I "get" J, at least enough that I can puzzle through other people's code without having to grab the dictionary every other symbol?

Here's my latest Project Euler code, to give you an idea where I'm at developmentally. I'm not saying which problem it solves, and it doesn't meet the 1-minute rule, but look away if you want to avoid any taint of spoilers:














+/(>/)"1 <.@(10&^.)(2 & x:) (+%)/\(1x,1000$2)

regards,

Geoff
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to