Hacker News new | ask | show | jobs
by scscsc 4290 days ago
It seems to me that everyone is missing the point behind object-orientation.

Object-orientation sucks for everything except user interfaces. If you don't believe me, try writing a UI library without objects and see what happens. UI is OOP's best (and only compelling) use case.

For all other algorithms classical data structures/ADTs are much better. If you don't believe me, try writing an OOP compiler.

1 comments

I write a lot of interactive SVG based user interfaces in JavaScript and always default to using "classes" to represent composable elements in the UI. I've recently been wondering about whether writing UI code with a functional language would even be possible. When it comes to data manipulation though I will always use underscore.
My thesis is that by trying to write functional/imperative UI code you will create your own ad-hoc OOP system.