Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's kind of crazy that OOO is sold to people as 'thinking about the world as objects' and then people expect to have an object, randomly take out a part, do whatever they want with it and just stick it back in and voila

This is honestly such an insane take when you think about what the physical analogue would be (which again, is how OOP is sold).

The proper thing here is that, if A is the thing, then you really only have an A and your reference into B is just that, And should be represented as such, with appropriate syntactic sugar. In Haskell, you would keep around A and use a lens into B and both get passed around separately. The semantic meaning is different.



I recently had this problem is some rust code. I was implementing A and had some code that would decide which of several 'B's to use. I then wanted to call an internal method on A (that takes a mutable reference to A) with a mutable reference to the B that I selected. That was obviously rejected by the compiler and had to find a way around it.


It's not crazy at all, especially since majority of programming is about digitalization of real world things/processed.

eBay, Tinder, Youtube, Robinhood, etc, etc.

Those are all real world things that are now represented in digital world and adjusted for that.

Also "world" doesn't imply "physical", but that's different matter.

And at the end of the day that was not wildly crazy, but wildly successful!

Such school of thinking enabled generations of software engineers who created all this digital world.


Wildy successful does not mean a good idea.

> Such school of thinking enabled generations of software engineers who created all this digital world.

Same could be said for imperative or functional programming for that matter.


As far as I know OOP has orders of magnitude higher market share than FP.

>Wildy successful does not mean a good idea.

Sure, but if there was FP instead of OOP, then would current digital world be better, as big, safer?

Who knows?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: