Different languages are better at different things, so it rarely makes much sense to say that one language is better than another in general. Python is definitely much better than Mathematica for "typical" imperative programming tasks (web servers, CLI programs, CRUD apps, etc.), but Mathematica is much better at data processing, symbolic manipulation, drawing plots, and other similar tasks.
> there is no real scoping (even different notebooks share all variables, Module[] is incredibly clumsy)
Scoping is indeed an absolute mess, and the thing that I personally find the most irritating about the language.
> no real control flow (If[] is just a function)
You're meant to program Mathematica by using patterns and operating on lists as a whole, so you should rarely need to use branching/control flow/If[]. It's a very different style of programming that takes quite a while to get used to, but it works really well for some tasks.
> no real error handling
For input validation, you should use the pattern features to make it impossible to even call the function with invalid input. And for errors in computation, it often makes the most sense to return "Undefined", "Null", "Infinity", or something similar, and then propagate that through the rest of the expression.
> The notebooks are also difficult to version control (unreadable diffs for minor changes)
Mathematica notebooks tend to do slightly better with version control than Jupyter Notebooks, although they're both terrible. You can work around this with Git clean/smudge filters, or you can just use ".wls"/".py" files directly.
For writing production code, I find good scoping rules non-negotiable. And error handling, monitoring etc has to be well thought out before deploying at scale.
So as great as Mathematica sounds for interactive math and science computations, sounds like a poor tool for building systems that will be deployed and used by many people.
> So as great as Mathematica sounds for interactive math and science computations, sounds like a poor tool for building systems that will be deployed and used by many people.
Yes, I definitely agree there. Mathematica is definitely great for interactive use, but I'm not really aware of anyone aside from Wolfram himself who tries to deploy it at scale.
That is a fair assessment. By and large it is used for the former. It is super handy in the exploratory phase of certain kinds of mathematical research.
How is "If" as a function even a drawback? It is largely seen as something desired, no? I would see that as a huge advantage, which allows for very powerful programming and meta-programming techniques.
One potential issue is that unlike most other languages, it doesn't create a new scope. But almost nothing in Mathematica introduces a new scope, and Python also uses unscoped "if"s, so it's rarely much of a problem in practice.
But with pattern matching, you almost never need to use "If[]" anyways:
On the note of Jupyter notebooks and version control - there was a talk at this year's Pycon Ireland about using a built in cleaner for notebooks when committing the JSON (discard the cell results), and then dropping the whole lot into a CI system utilising remote execution (and Bazel or similar) to run and cache the outputs. Was a talk from CodeThink. No video up yet though. Scenario was reproducible notebooks for processing data from a system under test.
> On the note of Jupyter notebooks and version control - there was a talk at this year's Pycon Ireland about using a built in cleaner for notebooks when committing the JSON (discard the cell results)
Yup, I use a long "jq" command [0] as a Git clean filter for my Jupyter notebooks, and it works really well. I use a similar program [1] for Mathematica notebooks, and it also works really well.
Different languages are better at different things, so it rarely makes much sense to say that one language is better than another in general. Python is definitely much better than Mathematica for "typical" imperative programming tasks (web servers, CLI programs, CRUD apps, etc.), but Mathematica is much better at data processing, symbolic manipulation, drawing plots, and other similar tasks.
> there is no real scoping (even different notebooks share all variables, Module[] is incredibly clumsy)
Scoping is indeed an absolute mess, and the thing that I personally find the most irritating about the language.
> no real control flow (If[] is just a function)
You're meant to program Mathematica by using patterns and operating on lists as a whole, so you should rarely need to use branching/control flow/If[]. It's a very different style of programming that takes quite a while to get used to, but it works really well for some tasks.
> no real error handling
For input validation, you should use the pattern features to make it impossible to even call the function with invalid input. And for errors in computation, it often makes the most sense to return "Undefined", "Null", "Infinity", or something similar, and then propagate that through the rest of the expression.
> The notebooks are also difficult to version control (unreadable diffs for minor changes)
Mathematica notebooks tend to do slightly better with version control than Jupyter Notebooks, although they're both terrible. You can work around this with Git clean/smudge filters, or you can just use ".wls"/".py" files directly.