3 ms·
OOP is great when you write APIs/libraries (your examples), but is useless or even counter productive when writing applications, where encapsulation or inherita
by _old_dude_ 5y ago
OOP is great when you write APIs/libraries (your examples),
but is useless or even counter productive when writing applications, where encapsulation or inheritance just obfuscate everything.
My main grip with Java is that everything is by default a library.
But there is hope, recent changes in Java, records and pattern matching move away from that idea.
- kitkat_new 5y agosaying OOP is only useless and counter productive is as short sighted as saying it is the golden hammer for everything. PS: WinUI apps use plenty OOP
- _old_dude_ 5y agoIt's not what i've said, OOP is great for creating APIs like WinUI, not great for writing applications
- jcelerier 5y agoIn which universe an application which uses mainly OOP APIs isn't itself OO.
- _old_dude_ 5y agoWhat OOP is good at is maintenance over the time by making clear what is API and what is implementation. My point is that when you develop an application, you only need strawman OOP i.e. calling methods. You don't need class inheritance if you can pass functions as parameters, you don't need encapsulation given all your pieces co-evolve at the same time (if it's not split than part into a library).
- kitkat_new 5y agoand WinUI apps are applications, and - as said - OOP is used by them, see e.g. the reference architecture guide