7 ms·
> OO can be abused to produce bad designs, of course, but that's not an indictment of its syntax. It is. The strength of a language isn't just in what allows
by tomtomtom777 7y ago
> OO can be abused to produce bad designs, of course, but that's not an indictment of its syntax.
It is.
The strength of a language isn't just in what allows you to do, but also in what it limits you to do.
OO in the style of C++/C#/Java is extremely flexible in terms of code organization. This means that most codebases eventually grow towards a mess of different styles and inconsistent design patterns. One guy's abstraction is the next guy's unnecessary plumbing. Teams often have to manage consistency of style and structure through out-of-code agreements.
The advantage of paradigms like procedural or functional programming as well as trait based "OO", is that there is generally an obvious way to structure something. Two different programmers working on the same problem, are likely to produce similarly structured code. The result is that different programmers will adopt much easier to different codebases.
- throw0101a 7y ago> OO in the style of C++/C#/Java is extremely flexible in terms of code organization. Is the problem perhaps that the wrong lessons were taken from earlier OOPs by later OOPs? Alan Kay in 2003: > OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them. * http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay... * https://news.ycombinator.com/item?id=19415983 https://news.ycombinator.com/item?id=19415983 (via)
- flukus 7y agoIf Alan Kay's definition is at odds with what 99% of the industry call OOP then it's not particularly useful, his definition sounds more like micro-services. Funnily enough it also describes some of my more elaborate shell scripts with various messages flowing into and out of self contained processes.
- gdy 7y ago"The advantage of paradigms like procedural or functional programming as well as trait based "OO", is that there is generally an obvious way to structure something." And surely that would be the way that you consider correct. After seeing codebases with hundreds of global variables I know that OOP is not the only paradigm that can be abused.
- GoblinSlayer 7y agoTraits can be abused too, you can create a trait for every thing because abstraction is good and pass traits everywhere. Where to get the trait? From a factory of course. Then you roll an IoC container.