Live data from Hacker News

Matlab is oversold as a general-purpose language

abandonmatlab.wordpress.com

61–70 of 104 posts

Re: Matlab is oversold as a general-purpose language

#61
post #8

For something to be oversold... it has to be sold as something in the first place. I work at a company which uses Matlab extensively. I don't think anyone here views Matlab as a general-purpose language, even though you can put together some fairly fancy things in it. What we do view Matlab as is an exceptional domain-specific matrix manipulation and data visualization language. The IDE is exceptionally easy to use,…

I've been working with Matlab for years and have been quite intrigued by claims that SciPy is the new, better, Matlab. But every time I tried it, it felt like a cheap knockoff. For example, let's say I want to apply DCT to a matrix. In Matlab it's simply dct(A). How do you do that in Python? Well, there's scipy.fftpack.dct, but when I try it, it turns out it operates on the rows of A, instead of the columns. So I sta…

On a side note, in the case you mentioned, it would probably be more intuitive to pass in "A.T" instead of "A", rather than using the "axis" keword.

Re: Matlab is oversold as a general-purpose language

#62
post #9

Okay, I'll bite on this one. I used matlab quite extensively (for years) in the medical imaging field, as well as other miscellaneous engineering (read: electronics, modeling, FEA. Not web apps) disciplines. I noticed several things about the matlab culture: - In academia, people really do not seem to give a fuck about using the right tool for the job. I used to try to explain to the people in my lab why their softwa…

I could not agree more with every word you have written here. I would like to add that scientists are neither averse to change, nor too lazy to learn new tools. However, they typically only care about the solution to their problem, not about programming in general. It is thus futile to try to convince them to use a different tool from a programmers' point of view--you need to convince them by showing them how much si…

I've had an unfortunate opportunity to have to help out a cousin's girlfriend with python. She's studying informatics and it's their introductory course in programming (recently switched from pascal). But python has really too many abstract constructs to explain easily. One example they had was using the for loop. I don't know python, but from the examples and exercises the professor gave them, it doesn't seem to have a "normal" for loop. All the examples used the function range() to generate an array of indices to loop over. Which is silly, since they don't cover functions and arrays until later. I had a hard choice to either go into details of why it works or tell her to just memorise it. Later on in her materials, after introducing arrays, suddenly the for loop doesn't use indices and she has to unlearn the old way. The other problem was explaining strings and methods, which they use (such as str.uppercase()) but their introductory course doesn't cover OOP. The last atrocity was an example of looping over lines in a file using the for construct. Of course, polymorphism, iterator patterns and so on are too advanced, but it really bothers me that they have to just memorise stuff without knowing why it works. I'm glad I had C as the first language. Firstly you generally learn how the CPU actually handles instructions, since C is so close to metal. Secondly, after C you can really appreciate what other languages have to offer. And thirdly, I really prefer the bottom-up approach. Then again, my perspective might be a bit skewed, since I graduated in computer engineering, which is a bit more involved than informatics.

Re: Matlab is oversold as a general-purpose language

#63
post #23

Earlier quoted context omitted.

try python. it is much more powerful in almost every sense. And it is not easy to write crappy code in python.

I've seen abominable code written in python from academics.

ya ya, its possible but hard :D

Re: Matlab is oversold as a general-purpose language

#64
post #53

Earlier quoted context omitted.

As someone who loves Matlab but would rather use a free-software solution, I must say that Octave is not an effective replacement for Matlab. Matlab itself is just so much more feature-complete and polished, turning to Octave feels like going back two decades in technology.

In what way is Matlab more feature-complete and polished? With respect to just the actual language Octave is nearly a 1:1 implementation of Matlab, which is an primary goal to stride for and maintain, any differences between the two is considered a bug even.

Graphics in general, handle graphics in particular, and no I'm not kidding. OOP for visualization can't be beat.

Re: Matlab is oversold as a general-purpose language

#65

Paraphrasing the Greenspun's tenth rule of programming: "Any sufficiently complicated C or Fortran numerical program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of MATLAB/Octave/Scilab." This could be called Gastón's corollary :-). MATLAB, Octave and Scilab are like the UNIX shell but for matrices instead of text streams; this is they problem domain. If you can explain a problem…

In academia I'd say most programs are run (when finished) 2-3 times - once on a smallish testset when you decide that this version is correct, second time on the full data that you have to produce results for the paper (and you don't care how long it runs as long as it finishes before the submission date); and maybe a third time if you get a larger/better dataset somehow.

Re: Matlab is oversold as a general-purpose language

#66
post #9

Okay, I'll bite on this one. I used matlab quite extensively (for years) in the medical imaging field, as well as other miscellaneous engineering (read: electronics, modeling, FEA. Not web apps) disciplines. I noticed several things about the matlab culture: - In academia, people really do not seem to give a fuck about using the right tool for the job. I used to try to explain to the people in my lab why their softwa…

I could not agree more with every word you have written here. I would like to add that scientists are neither averse to change, nor too lazy to learn new tools. However, they typically only care about the solution to their problem, not about programming in general. It is thus futile to try to convince them to use a different tool from a programmers' point of view--you need to convince them by showing them how much si…

The thing is it isn't just about solving their problems. The tough thing is to convince them how much it would help the community as a whole. I have tried many times to download some PhDs code and attempt to get it to compile. Usually it can be done after a lot of effort and tweaking. But it would be beneficial for science if code was treated as important as the paper itself.

Re: Matlab is oversold as a general-purpose language

#67

Paraphrasing the Greenspun's tenth rule of programming: "Any sufficiently complicated C or Fortran numerical program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of MATLAB/Octave/Scilab." This could be called Gastón's corollary :-). MATLAB, Octave and Scilab are like the UNIX shell but for matrices instead of text streams; this is they problem domain. If you can explain a problem…

In academia I'd say most programs are run (when finished) 2-3 times - once on a smallish testset when you decide that this version is correct, second time on the full data that you have to produce results for the paper (and you don't care how long it runs as long as it finishes before the submission date); and maybe a third time if you get a larger/better dataset somehow.

It's sad, but you're right. In my field, I've found that there is little interest in experiment design when doing data analysis; you'd be asked to perform an analysis on eight or ten data sets, only because the people think that is exhaustive.

Re: Matlab is oversold as a general-purpose language

#68
post #62

Earlier quoted context omitted.

I could not agree more with every word you have written here. I would like to add that scientists are neither averse to change, nor too lazy to learn new tools. However, they typically only care about the solution to their problem, not about programming in general. It is thus futile to try to convince them to use a different tool from a programmers' point of view--you need to convince them by showing them how much si…

I've had an unfortunate opportunity to have to help out a cousin's girlfriend with python. She's studying informatics and it's their introductory course in programming (recently switched from pascal). But python has really too many abstract constructs to explain easily. One example they had was using the for loop. I don't know python, but from the examples and exercises the professor gave them, it doesn't seem to hav…

I'm teaching Python to my kids (ages 10 and 13) right now, after finally ditching Visual Basic myself last year.

Of course I'm at liberty to improvise my "syllabus." I decided to introduce lists before program flow. I introduced range() as a way to populate a list. And then we started doing things with lists using constructs like [x2 for x in range(-10, 10)].

At that moment, my daughter asked: "Can we use Python to make a graphing calculator?" With my syllabus in tatters, we installed matplotlib and played with it a bit. I've explained to my kids that in programming, sometimes we have to look up and use things before we fully learn how they work.

This approach would probably make no sense for teaching C, where looping comes before lists. But in my idiosyncratic mental map of Python, lists come before looping.

I'm not dogmatic about what first language to learn. My only intention right now is to see if my kids will take an interest in it.

Re: Matlab is oversold as a general-purpose language

#69
post #62

Earlier quoted context omitted.

I could not agree more with every word you have written here. I would like to add that scientists are neither averse to change, nor too lazy to learn new tools. However, they typically only care about the solution to their problem, not about programming in general. It is thus futile to try to convince them to use a different tool from a programmers' point of view--you need to convince them by showing them how much si…

I've had an unfortunate opportunity to have to help out a cousin's girlfriend with python. She's studying informatics and it's their introductory course in programming (recently switched from pascal). But python has really too many abstract constructs to explain easily. One example they had was using the for loop. I don't know python, but from the examples and exercises the professor gave them, it doesn't seem to hav…

Those are all valid points.

However, I am teaching an introductory programming course and I have seen many a student terribly confused by manual memory management and low level data types. My hope is to be able to introduce the very basic parts of programming (variables, assignment, branching, looping, functions) without having to go into any OOP or containers.

There are always people who will never get even those most basic concepts, but there might be some who will get a basic glimpse of what programming means who would otherwise fail at basic C data types. In the end, they will all need to understand all of Python, then C, then (sadly) Matlab.

What you are describing is indeed very interesting. One has to be very careful to not introduce too many concepts too early. So maybe, one should restrict looping to while loops until lists are introduced. And string processing could be taken as the introduction to OOP.

Re: Matlab is oversold as a general-purpose language

#70
post #16

Earlier quoted context omitted.

I'm curious... is the matlabbing that happens at your work related to the simulink/realtime/control parts of matlab? Based on the other things you've said it sounds to me like that might be the case. Obviously I might be wrong. In any case, I've found that those parts of matlab can actually be used pretty effectively. I think the reason is that, even though matlab as a language is pretty crappy (IMO), these domains a…

We don't use simulink or anything like that - we just use the typical linear algebra stuff: Markov chains, finding eigenvalues, solving linear systems, etc.

And that's the thing with Matlab, it does the math part really well

Maybe R and Numpy are getting better, but try to invert a matrix, find and eigenvalue, find the solution to a polynomial, fit an equation, etc Not to mention the most advanced things outside Matlab

Post reply on HN