News for hackers. Stuff that matters.
Re:I laugh at your puny human 'objects' by kragen on Tuesday August 25, 2009 @01:43PM (#785284)
Gian,

If you want to argue that functional programming is better than object-oriented programming, you should take an object-oriented program, show how you would rewrite it as a functional program, show us why the result is better, and then show how the defects in the OO program are unavoidable within OO.

Some aspects of "goodness" for programs are:

* Brevity.

* Whether the program does something useful or at least entertaining.

* Local modifiability: that some modification of the program requires only local knowledge and local changes, rather than global knowledge and global changes. The more local, the better. This is conditional, though: requiring a ten-line change to a ten-line program is still better than requiring a twenty-line change to an eighty-line program. Demonstrating this requires that you show what is needed to make some particular change to both versions.

* Speed.

* Memory usage.

* Readability.

If you can show that your rewrite is better at least one of these axes and no worse on any of them, and that the difference is a result of OO vs. functional, then you will have shown that OO is worse than functional style for that program. This shouldn't be hard; I think symbolic differentiation is the usual example program for this. If it's better on some but worse on others, then you've shown that for that program, the choice is a situationally-dependent tradeoff.

If you can show that this is true for a wide range of programs, then you will have shown that OO is worse than functional in general.

However, you haven't shown it even for one program. Instead you have some vague bullshit example from some terrible textbook, some vague bullshit example from a sci-fi movie, some theoretical objections stated in the form of a series of mutually contradictory statements, a statement that you aren't actually an idiot (in case we might think that from reading the rest of your article, I guess?), a bunch of apparently false statements about Standard ML, and a bunch of evidence that you're pretty much missing the point on OOP.

Edit: Aristotle Pagaltzis wrote an excellent takedown of what Gian is missing a few years ago: http://plasmasturm.org/log/340/

I still haven't seen the non-shitty OO tutorial he was wishing for.

Re:I laugh at your puny human 'objects' by gdp on Wednesday August 26, 2009 @05:09AM (#786876)
The "missing the point" argument is a little bit easy. It's not that I don't understand OOP - I do, and I've done far too much of it. I understand it, and I reject it as a useful paradigm for any of the classes of program that I would like to write. That's an easy "out", right? Whereby it's easy to say "oh, you obviously don't write programs of type x", but I have enough confidence in my experience doing both general-purpose commercial programming and very specialist research programming to think that I can at least make that judgement on the basis of a reasonably large set of problem domains. Perhaps there are domains that match OOP really well. I just haven't found them yet.

And I'm not sure where you are getting most of these criticisms. Did you actually read to the end?

Re:I laugh at your puny human 'objects' by gdp on Tuesday August 25, 2009 @02:26PM (#785380)
I think you're reading wayyyy to far into this. I wasn't making a this-versus-that argument. I was having a rant about X being totally unfit for the purpose for which it is sold (in this case, X is 'OOP' and its purpose is 'modeling systems in an intuitive, natural way that corresponds to the real world'). I even included the word "rant" in the first few sentences just so that people who don't like reading rants could close the window at that point.

So basically, I respect that you disagree, but complaining that something that was clearly labeled as a rant didn't present objective evidence is asking a little too much.

Re:I laugh at your puny human 'objects' by kragen on Tuesday August 25, 2009 @03:12PM (#785524)
The context in which modeling systems in a way that corresponds to the real world makes sense is when you're writing a simulation of the real world. The Sims, say, or Knuth's elevator example. Historically this is where OO came from. It was only later (with Smalltalk, for which the term "OO" was invented) that it was used for more general programming.

My complaint wasn't that it was a rant. It was that it was a vacuous, boring rant.

Re:I laugh at your puny human 'objects' by dasil003 on Tuesday August 25, 2009 @03:06PM (#785509)
You are being way too aggressive for no discernible reason.

Aside from that, I believe you left out the most important aspect of functional programming: correctness. If you take a pure language like Haskell you're going to have to jump through some hoops, but the point is to create a more correct program. The benefits of that are not going to be seen in a comparison of the final product.

Re:I laugh at your puny human 'objects' by gdp on Wednesday August 26, 2009 @04:49AM (#786851)
In kragen's defense, we do know each other (from the internet), and we argue about these sorts of things to no end.

So there is a discernible reason, it's just probably not obvious to the casual observer :)

All of these properties of functional programming are true and nice, but that still ignores the fact that I wasn't making an ideological point about FP vs OOP! I said "here is a rant about why I don't like OOP as a modeling paradigm" and then (as a separate point) "here are a bunch of ways in which this other paradigm I'm familiar with achieves the same things as OOP without annoying the pants off me". It's a subtle distinction, but I wouldn't want to be thought of as just a run-of-the-mill religious-war troll.

Re:I laugh at your puny human 'objects' by kragen on Monday August 31, 2009 @03:36PM (#796552)
It's awfully nice of you to defend the appropriateness of me arguing with you!