2 ms·
>I'm not familiar with either J or NumPy... I have no idea what the first line does In that case, you owe it to yourself as a programmer to go and get familiar
by dTal 6y ago
>I'm not familiar with either J or NumPy... I have no idea what the first line does
In that case, you owe it to yourself as a programmer to go and get familiar with some APL-isms, for they are for numerical arrays what regexes are for strings and are rapidly becoming ubiquitous[0]. I wowed my boss once because I was able to mold an array into the shape we needed it in a few seconds... in Mathematica, a language I had never used before that moment, because I knew what to search the documentation for. It doesn't matter where you get it from, just pick a language with APL-isms - I recommend NumPy if you like popular stuff, and Q'Nial if you like esolangs - and work through Project Euler without writing any loops. It'll be fun!
And of course, if you're unfamiliar with the core concepts, then naturally both syntaxes will look equally opaque. That doesn't mean they are though. Once you understand what they are trying to express, then you will be in a better position to judge.
[0] In Julia:
b = reshape(1:12,(3,4))
cumsum(b,dims=2) #Julia is 1-indexed