Live data from Hacker News

Goodbye, Object Oriented Programming (2016)

medium.com

31–40 of 41 posts

Re: Goodbye, Object Oriented Programming (2016)

#31
post #26

Earlier quoted context omitted.

Sure. I presume you're asking about why FP is easier, though if you're wondering about my language there's more info at https::/darklang.com. I think the quote about the gorilla and the banana and the jungle is a really important piece. It's just hard to compose things in OO languages unless they're designed to be used together. Whereas in an FP language, you focus on simpler primitives (arrays, hashtables, nullable…

Thank you! Do you have any thoughts on Elixir/Erlang/LFE? Elixir is dynamic, but seems to have many of the benefits of a static type system by use of Dialyzer, Erlang's static type analysis tool.

I have no experience with Erlang sadly. I did my PhD on static analysis though, and my general opinion is that the difference between a language designed for analysis (eg via a type system), and one that isn't, is night and day.

Re: Goodbye, Object Oriented Programming (2016)

#32
Also see Yegor Bugayenko's essay, "What's Wrong With Object-Oriented Programming?"`

http://www.yegor256.com/2016/08/15/what-is-wrong-object-orie...

and also the essay "Object Oriented Programming is an expensive disaster which must end" had an interesting conversation here on Hacker News:

https://news.ycombinator.com/item?id=8420060

Re: Goodbye, Object Oriented Programming (2016)

#33
post #26

Earlier quoted context omitted.

Any chance you can talk more in depth about this? I'm really curious! FP seems wonderful, but there are few side-by-side code examples out there.

Sure. I presume you're asking about why FP is easier, though if you're wondering about my language there's more info at https::/darklang.com. I think the quote about the gorilla and the banana and the jungle is a really important piece. It's just hard to compose things in OO languages unless they're designed to be used together. Whereas in an FP language, you focus on simpler primitives (arrays, hashtables, nullable…

> about my language there's more info at https::/darklang.com.

I find it slightly reassuring that someone is actually working on a language/compiler with PaaS features built in. I'd thought of doing that and jotted it down in my notebook.. assuming it was just a crazy idea.

When do you plan to release an alpha version? I'd be interested in seeing it!

Re: Goodbye, Object Oriented Programming (2016)

#34
post #17

I feel like the author doesn't understand the design part of OOD. Yes, you can inherit yourself into rigidity. OOP doesn't prevent you from making design choices that turn out to be bad, or are bad in the first place. You can't reuse a class without reusing the whole world? That's the purpose of dependency injection and depending on interfaces instead of implementation. Decoupling. Diamond problem? Okay, granted. But…

If you have to tell too many people that they are "not doing it right", then perhaps its too hard to do it right. If you build a paradigm that only Sheldon Cooper can get right and complain when non-Sheldon's "can't use it right", there is a bigger problem. It was supposed to make software design easier and "more natural". If it takes lots of training to get right, that's not "natural".

In general, I find OOP fairly well suited for building utilitarian API's, but NOT for domain modelling. Domain modelling is where OOP failed bigly. When UI/GUI's got more complex, they outgrew OOP's ability also and became a mess. There seems to be a size/scope limit to OOP of subject matter.

Re: Goodbye, Object Oriented Programming (2016)

#35
post #33
post #26

Earlier quoted context omitted.

Sure. I presume you're asking about why FP is easier, though if you're wondering about my language there's more info at https::/darklang.com. I think the quote about the gorilla and the banana and the jungle is a really important piece. It's just hard to compose things in OO languages unless they're designed to be used together. Whereas in an FP language, you focus on simpler primitives (arrays, hashtables, nullable…

> about my language there's more info at https::/darklang.com. I find it slightly reassuring that someone is actually working on a language/compiler with PaaS features built in. I'd thought of doing that and jotted it down in my notebook.. assuming it was just a crazy idea. When do you plan to release an alpha version? I'd be interested in seeing it!

Alpha is probably out this year. We send periodic announcements to our mailing list, there's a link at the bottom of Darklang.com. Also, we're hiring: http://darklang.com/careers

Re: Goodbye, Object Oriented Programming (2016)

#37
Hello, OOP (2018)

I just recently wrote a Lisp compiler and assembler (for VM) using OOP.

http://www.kylheku.com/cgit/txr/tree/share/txr/stdlib/compil...

http://www.kylheku.com/cgit/txr/tree/share/txr/stdlib/asm.tl

Even abused inheritance for logic re-use: see defopcode-derived macro in the assembler.

The OOP system is my own---now compiled. :)

It's a pleasure to use and makes the code look good. No bo

Re: Goodbye, Object Oriented Programming (2016)

#38
> For efficiency sake, Objects are passed to functions NOT by their value but by reference.

What that means is that functions will not pass the Object, but instead pass a reference or pointer to the Object.

This is confused garbage, and goes rapidly down hill from there.

Reference semantics is required for OOP. The reference is necessary because that is the object. The object's "value" is a concept from the record or structure types of non-OOP languages like C and Pascal. If we pass the value, we are not passing the object, but a copy.

In high level languages, we don't even see the reference as a separately declared reference type; that is a low-level concept from "Blub OOP".

I'm surprised this blogger's Smalltalk experience didn't set him straight.

> If an Object is passed by reference to an Object Constructor, the constructor can put that Object reference in a private variable which is protected by Encapsulation. But the passed Object is NOT safe! Why not? Because some other piece of code has a pointer to the Object, viz. the code that called the Constructor.

The charitable way to understand this bizarre nonsense is that because the caller of the constructor has a reference to the object, it has access through the reference to the object's "value", and by going through that reference, it should be understood as bypassing the encapsulation of the container which also holds that reference as a private variable.

This is laughably confused. Encapsulation means just that the binding is private: the newly constructed object holds that existing object in a private slot. Encapsulation doesn't mean that the embedded/aggregated object's contents are also private to the aggregator. Those are protected by that other object's class!

> The Constructor will have to Clone the passed in Object.

Only in some very specific circumstances when it is necessary for this parent object to have its own instance of an object similar to the one which is passed in: either so that it can mutate this instance without having an effect elsewhere, or else so that it has a snapshot facsimile of the passed object which is immune from changes elsewhere.

Such a requirement doesn't always apply.

> So much for efficiency.

When such a requirement doesn't apply, the construction of the similar object or 'deep cloning' will not just be inefficient, but wrong. For instance container object will expect the contained object to react response to events, but instead it actually has a dead copy which isn't receiving calls from anywhere.

It's clear from the semantics whether "we want to be composed of that actual object" or "we want to be composed of a similar one, in a similar state to that one's current state".

The second situation may require planning and design work. Indeed, not objects can be easily copied.

Some other solution may be required, like splitting that object into some state that is easily copied and some part that remains shared. This need not even require a split, just a suitable copy operation.

Linux has clone() system call for processes with a bazillion flags to copy this and not copy that; kind of the same thing. Sometimes we share the address space and file descriptors and signal handlers, sometimes we don't.

Re: Goodbye, Object Oriented Programming (2016)

#39
post #31

Earlier quoted context omitted.

Thank you! Do you have any thoughts on Elixir/Erlang/LFE? Elixir is dynamic, but seems to have many of the benefits of a static type system by use of Dialyzer, Erlang's static type analysis tool.

I have no experience with Erlang sadly. I did my PhD on static analysis though, and my general opinion is that the difference between a language designed for analysis (eg via a type system), and one that isn't, is night and day.

In that respective order, too.

You could have caught that had you assigned night and day different types, instead of having it blow up 19 hours later in the field like this.

Re: Goodbye, Object Oriented Programming (2016)

#40
post #34
post #17

I feel like the author doesn't understand the design part of OOD. Yes, you can inherit yourself into rigidity. OOP doesn't prevent you from making design choices that turn out to be bad, or are bad in the first place. You can't reuse a class without reusing the whole world? That's the purpose of dependency injection and depending on interfaces instead of implementation. Decoupling. Diamond problem? Okay, granted. But…

If you have to tell too many people that they are "not doing it right", then perhaps its too hard to do it right. If you build a paradigm that only Sheldon Cooper can get right and complain when non-Sheldon's "can't use it right", there is a bigger problem. It was supposed to make software design easier and "more natural". If it takes lots of training to get right, that's not "natural". In general, I find OOP fairly…

big bang theory is not a meme
Post reply on HN