Mathematica terseness

Submitted by reeses on Sun, 2004-11-14 22:28. |

I don't know why it is, but Mathematica really encourages you to obsess about getting your program down to one line, where one line might be 500 characters and ten screen lines long. Part of it may be the crappy Notebook "IDE", which is great for linear reasoning and an interactive evaluation shell, but horrible for programming. I do know that every time I write something, I notice at some point that I've just been making my program shorter and shorter, until it's as close to one line as possible, even if pulling things out into functions would make more sense. Those of you who have seen my code in other environments know I prefer to follow the Smalltalk model of lots and lots of tiny functions, preferably with no side effects.

Luckily, I tried nesting pure functions (the first sign that you're probably an obsessive one-liner writer), and realised that doing so is like when you're building a perl program iteratively in shell and trying to remember how to quote strings so they aren't evaluated until they actually get to the perl process. You have to keep so many layers of abstraction in your head that you start to realise the tool is actually an obstacle.

26,121 words and I think I'm just going to let this guy get lost in a desert and die.

Post new comment

Captcha Image: you will need to recognize the text in it.
Please type in the letters/numbers that are shown in the image above.