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

I have seen some horrible shit. Terrible, awful, fucked up stupid undocumented code. I have worked in psychophysics shops (go figure).

What makes you think it would be any better had they not used MATLAB?

I actually like MATLAB. It really excels when used as a glorified calculator and you can plug lots of things into it and have it 'just work' without much fuss. When I worked in a tutoring lab sometimes it was cool to have around because I could quickly whip up something interesting and visualize the whole thing to explain concepts. When I worked in the research lab (after I completely trashed the old application and started my own) I could hook up the computer to some cool hardware, run the experiment and do the statistical analysis all in one place. At my job now, people who aren't good at programming can use a computer to solve very hard problems.

I don't know why it's getting so much hate. I agree that it's not a good tool for every problem and that in the scientific community (and especially the psychology community) it is overused. But I don't really see why switching to another language would make things better.



> What makes you think it would be any better had they not used MATLAB?

Probably the most general cross-disciplinary reason MATLAB worsens an already bad situation is that it isolates scientists and engineers from people who are good at programming. When you seek out help for a particular problem, it's often a blind-leading-the-blind situation. How can you learn to program well if you've never seen a good piece of MATLAB code? Good luck finding good examples and role models to learn from if your programming universe is limited to MATLAB. Poor quality and practices proliferate because there is almost never anyone skilled reviewing changes and helping you get better. People just make a change and pray it still works.


Interesting point.

From my own experience, though... I'm doubting you. I really don't think these people see a problem with what they're doing and wouldn't care even if they did - so why would they ask for help? You'd have to have someone sitting over their shoulder all the time training them (most colleges already have introductory MATLAB courses, so apparently that doesn't help much) - no one would like that arrangement.

But what you've identified isn't really a problem with MATLAB, is it? It's a problem with the culture of people who tend to use it. It's a real problem, but I'm not sure what can be done about it other than to try to get at these people while they're still young and learning.


> But what you've identified isn't really a problem with MATLAB, is it?

Yes, it is. Everybody that knows what they are doing moves away from MATLAB as fast as they can. That's MATLAB's fault.

Except for teaching, mind you. The entire problem is that MATLAB is a great teaching tool, and a completely worthless tool for anything else. Guess what, lots of people stick with what they learn at school.


One of the problems with Matlab is that it does not encourage any sort of partitioning scheme for code. It even makes the simplest form of partitioning (functions) excruciatingly frustrating by requiring them to live in their own files--thank god there are subfunctions, nested functions and anonymous functions.

But there is still no notion whatsoever of namespacing, modules or a usable class hierarchy. It is thus very hard to organize code in a modular manner. Matlab actively encourages globally-scoped script files and long long functions. This makes constructing medium to large sized systems very painful and error prone.

TL;DR Matlab is fine for a single script or two. But anything larger than that is immensely complicated by it's lack of code organization.


Yes, the fundamental problem of the Matlab language is the namespace problem.

The hilarious thing is that basically every feature added to the Matlab language since the beginning has been an attempt to control the namespace problem, and they still can't solve it. Besides subfunctions, nested functions, and anonymous functions (and does anyone using them actually understand all of their scoping rules), you have old style classes, new style classdef, packages, and sometimes case-sensitive and sometimes case-insensitive identifiers.

It's a mess. And I don't think it will ever get fixed.


I usually find nested functions and closures to be more pleasant to use than Matlab's class system. A sad state of affairs, really.


> I don't know why it's getting so much hate.

It's a terrible language. One function per file, you need to special case LxMxN matrices where N is variable in the case N=1, can't do myfun()[0:4].

Use it for a while and you will run into painful limitations.


Back in the day when I was in a psychophysics lab as an undergrad I managed to take the entire mac I was working on (system 7 I think) with my supervisor's crappy psychophysics experiement code. Fortunately one of the uni sysadmins was there cracking passwords on the uni network from the HP-UX cluster and restored it for me PDQ.




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

Search: