by de_Selby · 8y ago · 0 comments
It would probably take a beginner python programmer 40+ minutes to write the mode function too.
J might have a lot of primitives, but for an example that might be more familiar, so does assembly and people got along just fine there. There is an investment in getting the hang of the primitives but there aren't a huge amount of them, and once you do a problem like this becomes much easier.
The other thing that's really nice is that you start to see how to solve it in different ways using completely different sets of primitives.
Normal languages only have about 20 unnamed functions (i.e. operators) and they're mostly things we've already learnt at school.
Is % an unnamed function? Or {. ? Then you have lots of unnamed things in, say, Java, which are "public", "static", "char" etc...
You don't need to learn them all before you can start doing something useful. J for C PRogrammers provides a good course gently introducing simple ones first.
>Normal languages
Who's to say what "normal" is? There is a learning curve to other languages too, people just forget that because they went through it so long ago.
There's some nice magic in how quickly you can write mode as an expert, and part of the appeals of APLs are the power of some of the built-ins. There's likely other tools that would be more worthwhile in the `:;` spot than its current definition.