Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In[115] is the reason for why Mathematica never clicked with me.. I'm not smart enough to read that big block and write it, much less debug it.


As a Wolfram employee: I really think we should start indenting and formatting the code in the blog better, have some kind of gist rather than those hideous images.

I'm sure that that blob of code would much more legible if it was better formatted.


As the token programmer in a big group of (now graduated) math major friends, the first thing I did when sitting down to help them with Mathematica was completely reindent their code, which was always followed up by "Wow! It looks so much better now!" Is it perhaps endemic to the culture of the language?


I think it's somewhat endemic to the notebook interface where your code grows by accretion from a oneliner function.

Whenever I help novices with their code I ask them to transform all their cells that are not oneliners into code cells which require manual indentation.


Or it's just how amateurs write code before they no better.


It would also really help people with vision problems, as making the text bigger for the article makes the code blurry. :(


To be fair, mixing math and display logic in a giant function like that is a bad idea in any programming language.

But the frightening flexibility of the Mathematica language certainly doesn't help.


I think that is the main reason behind the comments here. The mathematica language takes some using too, and its syntax definitely is on the weird side of functional. However, do you expect this kind of complex example to be a paragon of clarity in any language? Picture what this would look like in haskell, ipython, R or javascript. Do you think "oh yes of course I will totally be able to do that after 2 hours using the platform"?

As to the question if you have to be a developer to write that kind of code, of course not, but you do have to be an experienced developer on that platform. I for one really like Mathematica despite the closed source and the offputting look of the source code, exactly because you can do the sort of magic shown here and actually get there pretty quickly.

Now, I hope that didn't sound too defensive :)


The first five times I read this comment I read it as:

"To be fair, mixing meth and display logic in a giant function like that is a bad idea in any programming language."

Frankly, I agree with either statement.


It's a lot easier to write Mathematica than it is to read it. I've come up with some retrospectively-horrific functions that were intuitively easy to write - just keep piling on the functions, really. It's like the standard mistake when children learn maths of writing "If x=-1, then x^2+2x+1 = (x+1)^2 + 5 = 5" when they mean "x^2+2x+1 = (x+1)^2; then (x+1)^2 + 5 = 5": Mathematica makes it very easy to write in a completely unreadable stream of consciousness.


An ability to switch back and forth to a sort of "graph" view would be tremendously helpful, as most people tend to have a better ability to process visual information rather than a stream of text


You can't use it as an input form, but you can view a nice tree of your expression automatically.

TreeForm[ x^2 + 2 x + 1 == (x + 1)^2]


This. Some novel form of input would be nice. The few times I've used mathematica it has been slightly painful in this department.

I've been using a TI nSpire calculator on and off for math and it's pretty decent with respect to readability on the input and output side of things:

https://www.youtube.com/watch?v=PpmpFis8RQM

Even carries the input/output semantics into the programming language:

https://www.youtube.com/watch?v=oTdvIm9coXk

(just skip around the videos to see the input/outputs)


> It's a lot easier to write Mathematica than it is to read it.

+1. And it gets even more easier to read (“read”? :-) when you can select pieces in FrontEnd, with multiple mouse clicks or a corresponding hotkey. I got so used to it that I actually developed phantom pains in my editing of Html or TeX (or whatever, for that matter).


Don't you mean:

x^2+2x+1 = (x+1)^2;

If x=-1, then (x+1)^2 + 5 = 5




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: