Live data from Hacker News

Joe Armstrong: Why OO Sucks

harmful.cat-v.org

251–260 of 267 posts

Re: Joe Armstrong: Why OO Sucks

#252

Earlier quoted context omitted.

I won't go so far as state being the entire point, but it's simply another way to programmatically solve a problem. Writing to memory is stateful. Writing to a file is stateful. Printing something to the screen is stateful. Seeing the effect of your program is stateful. Would you say that the point of programming is to produce an effect?

That's fine. All your points are perfectly valid, but they have nothing to do with OOP, which is what I was referencing.

Objects rely on being mutable. An object-oriented language pushes objects everywhere. This pushes mutation everywhere. This is the opposite of corralled.

As I said in another comment:

Note that you can have objects without OOP. Python has objects. Python is not object-oriented. Same with OCaml or Racket. I'm not arguing against using state. If you're programming a state machine, you may want to model it with state. That would be a pretty good choice. The problem is that OOP says everything is a state machine.

Re: Joe Armstrong: Why OO Sucks

#253
post #183

Earlier quoted context omitted.

Even more - encapsulation is not always mean OOP. Erlang have encapsulation more strong than in any OOP language - all you have is server process and messages thrown to it.

How is that not OO then? OO is not defined by Java. The first OO languages and systems were descended from Lisp or built within Lisp, a functional programming language. OO without inheritance is still OO. OO with immutability is sill OO. Encapsulation is the heart of OO. Polymorphism is also quite important. Inheritance is a distant third property of OO, but it is one common aspect of OO that is highly over-used. Mos…

This is a pointless argument, since both views are "correct". Even Joe Armstrong says that "You can take two views, you can say that either erlang isn't object oriented... [or] you can say its more object oriented than all the object oriented languages."

But I do not think it's very useful to say that Erlang is object oriented, since it will confuse a lot of people, since it is not anything like the other "object oriented languages".

http://www.infoq.com/interviews/Erlang-Joe-Armstrong http://www.infoq.com/interviews/johnson-armstrong-oop

Re: Joe Armstrong: Why OO Sucks

#254

Earlier quoted context omitted.

Your hard-line stance is a little bit too far IMHO. That inanimate matter programming is all about manipulating also has no notion of objects or object orientation... or (for the most part) methods, fields, functions, procedures, arrays, modules, encapsulation, interfaces, garbage collection, databases ... and so on and so on. All that abstraction exists to make programming easier for humans to grok, and for teams to…

I would argue that objects, methods, fields, modules, encapsulation, interfaces, garbage collection, databases are not the basics of programming either. Good things to have, but are not basics of programming. So, teach/learn them later in the cycle. Basics of programming are variables, branches, arrays, loops and simple I/O. You can go a long way with these. And you can explain those to 6 yr old child.

Recursion is fundamental. Reassigning to a bunch of variables in a loop is a poor imitation of recursion that caught on because fifty years ago we could barely afford call stacks and hadn't invented tail call optimization. The better our hardware and our theory gets, the more of these shortcuts we can and should leave behind, so that we no longer need to try to preserve the illusion that programs run sequentially and state is globally consistent.

Re: Joe Armstrong: Why OO Sucks

#255

Earlier quoted context omitted.

Your hard-line stance is a little bit too far IMHO. That inanimate matter programming is all about manipulating also has no notion of objects or object orientation... or (for the most part) methods, fields, functions, procedures, arrays, modules, encapsulation, interfaces, garbage collection, databases ... and so on and so on. All that abstraction exists to make programming easier for humans to grok, and for teams to…

I would argue that objects, methods, fields, modules, encapsulation, interfaces, garbage collection, databases are not the basics of programming either. Good things to have, but are not basics of programming. So, teach/learn them later in the cycle. Basics of programming are variables, branches, arrays, loops and simple I/O. You can go a long way with these. And you can explain those to 6 yr old child.

[deleted]

Re: Joe Armstrong: Why OO Sucks

#256

Earlier quoted context omitted.

I would argue that objects, methods, fields, modules, encapsulation, interfaces, garbage collection, databases are not the basics of programming either. Good things to have, but are not basics of programming. So, teach/learn them later in the cycle. Basics of programming are variables, branches, arrays, loops and simple I/O. You can go a long way with these. And you can explain those to 6 yr old child.

> And you can explain those to 6 yr old child. The most popular programming language for teaching children is Logo, a FUNCTIONAL programming language!

I can't comment on this since I've never seen Logo in the wild. I know people who did and they never learned how to program.

Re: Joe Armstrong: Why OO Sucks

#257

Earlier quoted context omitted.

I would argue that objects, methods, fields, modules, encapsulation, interfaces, garbage collection, databases are not the basics of programming either. Good things to have, but are not basics of programming. So, teach/learn them later in the cycle. Basics of programming are variables, branches, arrays, loops and simple I/O. You can go a long way with these. And you can explain those to 6 yr old child.

Recursion is fundamental. Reassigning to a bunch of variables in a loop is a poor imitation of recursion that caught on because fifty years ago we could barely afford call stacks and hadn't invented tail call optimization. The better our hardware and our theory gets, the more of these shortcuts we can and should leave behind, so that we no longer need to try to preserve the illusion that programs run sequentially and…

It's not an illusion, it's in the CPU.

It didn't happen yet, call me again when it will.

Re: Joe Armstrong: Why OO Sucks

#258

Earlier quoted context omitted.

Why?

Does this really need to be said? One is a semi-automated bodily process necessary for extracting oxygen from the atmosphere, and the other is writing instructions in strictly defined languages to control the resources of computer systems. Other than a contrived emotional connection you might make between the two, they aren't comparable.

You assume that you live in a physical world but you live in information world for real.

I think you do, and you will increasingly do so as time passes. So, being able to control information flow becomes as important as controlling air flow. Yes, you don't die by being unable to do so for five minutes. You don't live that much either.

Re: Joe Armstrong: Why OO Sucks

#259

Earlier quoted context omitted.

> And you can explain those to 6 yr old child. The most popular programming language for teaching children is Logo, a FUNCTIONAL programming language!

I can't comment on this since I've never seen Logo in the wild. I know people who did and they never learned how to program.

Here's Logo in the wild:

   http://ccl.northwestern.edu/netlogo/
It's used to do all sorts of interesting things, including real economic modeling. I.e., I've seen it used by real economists.

When I first saw NetLogo being used by an economist to demonstrate an economic model, I thought it strange that the NetLogo people had re-used the name "Logo", a kid's programming language, for something that is a serious tool used by professional researchers. It took me a while to figure out that it is the same Logo! And those kids, I guess, grew up, and decided to do something real with it.

R is also a functional programming language used to do very real work.

Re: Joe Armstrong: Why OO Sucks

#260

Earlier quoted context omitted.

Recursion is fundamental. Reassigning to a bunch of variables in a loop is a poor imitation of recursion that caught on because fifty years ago we could barely afford call stacks and hadn't invented tail call optimization. The better our hardware and our theory gets, the more of these shortcuts we can and should leave behind, so that we no longer need to try to preserve the illusion that programs run sequentially and…

It's not an illusion, it's in the CPU. It didn't happen yet, call me again when it will.

Everything we do in any high level programming languages is an illusion. In fact, even assembly language is an illusion. The only thing that isn't an illusion is building a computer out of nand gates, and the like.

In my education, we STARTED with functional programming, and eventually we built real microcoded computers that we designed ourselves out of nand gates and adder chips. And, yes, I mean REAL chips with lots and lots of wires on a real physical breadboard.

Is a nand gate, the fundamental building block of all computers, is that functional? You bet your ass it is! State only comes by using this functional component and feedback to make a flip-flop.

Your premises are all wrong: My education started with FUNCTIONAL programming. We then learned how to build OO on top of functional programming, using only closures and single mutation operation: variable rebinding. We then went on to design and build our own physical computers out of chips and wires, starting with the fundamental functional component: a nand gate.

Post reply on HN