by ilovecaching · 7y ago · 0 comments
Now I see OO as something I have to deal with, like a tiger in my living room. Thankfully, so many new languages have come out recently; Go, Rust, and Elixir being the ones that I use regularly, that have called out OO for what it is and have gone in more compelling directions.
Hopefully one day they will teach OO alongside other schools of thought, as a relatively small faction of programming paradigms.
Now I can compare Erlang to Java and it is really baffling how the heck Java took over the world. To do erlang I just need an editor with some plugins, ssh connection to linux with OTP installed and of course rebar3. To do Java I need 4GB of RAM to simply run an IDE with gazillion of plugins, maven to cater for thousands of dependencies for the simplest app and I need to know Spring, Hibernate, AOP, MVC and quite a chunk of other 26^3 3-letter abbreviations. No thanks.
> Build encapsulated components that manage their own state, then compose them to make complex UIs.
Components managing their own state is a textbook definition of OOP. They even use inheritance in their example on the main page:
> class HelloMessage extends React.Component
Have a look at functional reactive programming.
Re "The model is a data structure and the view is a series of functions on it." This is exactly how I see my OO-based GUI programs. The object I define is firstly a data structure. Then I want some operations/views on it? define methods on it.