4 ms·
I've also seen plenty of horrifically deep layered stuff in PHP, and to a lesser extent JS. Just like Java, it's possible to write elegant well structured code
by tomxor 6y ago
I've also seen plenty of horrifically deep layered stuff in PHP, and to a lesser extent JS. Just like Java, it's possible to write elegant well structured code in any of these languages (yes even PHP, even though I still hate PHP).
And of course you can... purely in terms of organizing building blocks most object orientated languages are pretty much a super set. I think the problem is most people are not consciously aware that object orientated approaches are just a pattern, and like any pattern you shouldn't apply them to everything. Being built in to many languages gives the impression they are as fundamental as a loop or a function - those are technically still abstractions, but far more primitive and less subjectively applicable... Object oreanted patterns feel like they are in between domain specific and basic building blocks, the higher you go the more polarizing these become, trying to use a DSL will seem absurd for one thing extremely elegant for another - when classes fit they are beautiful, but when they are carelessly used as a default, they are annoying bags of loosely coupled functionality and data that only serves to obscure relationships.
I'd speculate that the prevalence of poorly applied OOP is more to do with legacy and culture of the language along with the focus on how to use the language for newcomers.