News for hackers. Stuff that matters.
Re:Pretending OOP Never Happened by overgard on Friday May 15, 2020 @12:32PM (#23194084)
I think if we called it "binding functions to data", instead of "objects" we would have a much different view of how important OOP is. There are certainly times that binding functions to data can be useful, but I think if you tried to tell someone "im making a language where all functions must be bound to data" they would think you're crazy. (Even though that's basically what Java is)

There are so many times you don't want to bind functions to the data they operate on, and languages that force OOP always make it painful

The other thing OOP gives you is type taxonomies, but frequently those are an anti-feature. Almost every experienced developer I know thinks inheritance is usually a bad idea.

Re:Pretending OOP Never Happened by cy_hauser on Friday May 15, 2020 @03:57PM (#23196697)
I'd change "binding functions to data" to "binding functions to types." The "data" is an object of a particular type. The binding to the actual data (object) can take place at compile time or run time, depending on need. IMO that makes it a bit less weird and more just shifting the position of a parameter.
Re:Pretending OOP Never Happened by overgard on Friday May 15, 2020 @07:32PM (#23198757)
Well, the reason I say binding to data instead of binding to type is that runtime polymorphism on instances is one of the selling points of OOP. I think its a little overrated but that is a good reason to use OO if you need that functionality. If you're only attaching functions to a type there isn't much difference between "thing.fn(x)" vs "fn(thing, x)"
Re:Pretending OOP Never Happened by user_0x on Friday May 15, 2020 @01:50PM (#23195094)
Having just come out of a datastructures class, this is the view that seems the most useful to me. ADTs in general seem to be very well expressed with classes, and I think it is exactly for the reason you mentioned: they are just systems that need to be able to define the ways in which a user is allowed to interact with the data.
Re:Pretending OOP Never Happened by gbear605 on Friday May 15, 2020 @01:06PM (#23194537)
I think the key is the ability to have functions bind to data without functions mandatorily being bound to data.