Hacker News new | ask | show | jobs
by jjoonathan 1653 days ago
Global scope (really global -- even between windows) is the default and the encapsulation tools are not particularly easy or convenient to use and not heavily promoted in the example material.

This leads to a dynamic where anyone without the CS background to recognize the foot-gun and the discipline to disarm it winds up with awful spaghetti code and the all-to-familiar consequences: a big blob of unmaintainable mystery code that becomes more and more difficult to modify until all project time is spent merely keeping it working rather than improving upon it.

We might laugh about this kind of newbie mistake here on HN, but even extremely intelligent people can't be experts at everything and the sheer number of physicist-hours and mathematician-hours I've seen needlessly flushed down this particular toilet is really quite unfortunate.

2 comments

Thanks for this comment. Have the same experience at a Maths Department.

Each run of some specific code is “ouch, we must try and see when we have the time to understand how it works and how each error is handled.” Just because it is soooo difficult to properly write a module.

> really global -- even between windows

This isn't the language though. A runtime in Mathematica is called a kernel. By default, Mathematica uses one. I think base licenses allow you to run two simultaneous runtimes and you can buy more. When you start a new window you have to pick the kernel, it doesn't launch its own like Jupyter would do.

This is an annoyance with Mathematica: it's proprietary software so it's in a world of license servers, license keys, artificial limits and paid upgrades.