3 ms·
I guess the mental block I have with Wolfram/Mathematica is that there's this feeling that you don't know how to do it until you know how to do it. As opposed t
by tunesmith 11y ago
I guess the mental block I have with Wolfram/Mathematica is that there's this feeling that you don't know how to do it until you know how to do it. As opposed to languages where you can learn a smaller number of principles and then use those principles to reason your way to how to do it.
Like, the third slide of the introduction:
Range[20]
Why not just something like List[1..20] ? Maybe List[1..20] works in Wolfram, but then it's weird that you have this Range function that serves no other purpose than to define a Range.
Same with NestList[f, x, 5]. I don't offhand know the way to create its output in something like Scala or Haskell but I imagine it's pretty concise, but meanwhile, in this case... if it's possible to get the effect without using NestList, then why use it? And if it's not possible to get the effect without using NestList, then how would you ever find out that you can use NestList?
It just seems like the actual programming experience would be a lot more about hunting-and-pecking through documentation and google searches, rather than reasoning your way to solution.
I'd love to hear from someone skilled with Wolfram to offer some clarity. Are you just basically thumbing through the documentation all the time to find that one perfect function call?
- programnature 11y agoYou are the target audience of this book. The Wolfram Language has gotten huge, making it harder for beginners to find their way around the basics via reference docs. That said, WL is in fact based on pretty simple primitives. If you are familiar with functional programming, things like NestList are familiar and you'll start learning by finding the analogues of your favorite FP constructs. WL also has a lot of functions that you might call "optional": those that could be restated as simple combinations of other functions. The rationale there is pretty simple: if there is a well-defined, commonly used chunk of computation, it should be given a name (and design). The fact that a fair amount of work is put into both the name and design of these things gives a higher sense of coherence (and predictability) than you might expect from their number.
- superfx 11y agoIt's just like any other language. At first you're constantly looking at the docs to find the right function (perhaps library call is the better analogy here), but eventually you'll know what's important and where to look if you're trying to solve something new.