3 ms·
Unfortunately, the Mathematica language is a 'write-only' language; reading and debugging code months after use is... difficult. And that means it's hard to bui
by sdenton4 8y ago
Unfortunately, the Mathematica language is a 'write-only' language; reading and debugging code months after use is... difficult. And that means it's hard to build up libraries which depend on libraries. The Sage community is great, and pushes a lot of code for research problems; things that are technically possible in Mathematica, which someone might work up into a notebook at some point, with a lot of effort, grow into reliable libraries in Sage.
- sampo 8y agoIt is true that stuff like (to take a random example) Total@Map[Function[{L}, Min @@ Table[dist[func[Array[c[#, k]&, n]]][L], {k, m}]], dd] is normal and common in Mathematica code. Like with Perl, the culture has started from small scripts making heavy use of shorthands provided by the language, and slowly evolved to writing larger codebases. Some of this can, on an individual level, be fixed by adopting a clearer coding style. But like Perl 5, the language kind of lures you to use the shorthands a lot.
- gh02t 8y agoIt's also cultural- line breaks, indentations, and parenthesis help a lot to make Mathematica more readable, but there's a strong tendency to do things in one liners like you show. Even the official docs are like this. I think even then it can have some readability problems, but it would certainly improve things quite a bit if the community would use a better style.
- shawn 8y agoThis isn’t true. It depends how you write your Mathematica. If you define modules, it’s nearly the same as as a scripting language.