Re:Ask HN: What are alternatives to OO programming?
by ErotemeObelus on Friday April 12, 2019 @03:38PM
(#19648282)
When I took programming classes in uni it was the OOP section where I would consistently get 100% on tests. Everything else was 75-80%.
OOP is one of the few parts of programming that are genuinely enjoyable. Sometimes I open up Ruby and make an OO model of something from my work (mathematician). So I'm not asking because I'm bad at it.
But it seems like there are only two programming paradigms: object-oriented and structured (classical functional programming (like you find in Scheme) is really structured programming without loops and variable assignments). And the problem is that structured programming is not temporally infinite: it breaks down most ungracefully past 150k lines of code.
You can't tell me that the only temporally infinite programming paradigm is OO and that nobody invented anything else in the intervening 30-40 years.
Was it easy to learn how to do OOP well? If you're looking to move away from OOP, are you sure you ever learned how to do it well? I've been doing OOP for 20 years and I've found far more practical application from functional ideas than any design patterns I've come across.
You don't have to go all in on any paradigm, you can mix and match. The parts of any system should be small. If the part is easier to design in OOP (UI comes to mind), then use that. If the part is just manipulating data (just about everything else comes to mind) functional can be very nice.