4 ms·
Please, define "reasonably". Because these people who created hilariously Finnish ThingDoerFactoryFacadeFactoryInstaniatorService also thought they do a reason
by thesz 4y ago
Please, define "reasonably".
Because these people who created hilariously Finnish ThingDoerFactoryFacadeFactoryInstaniatorService also thought they do a reasonably reasonable job.
Per your comment on "use classes for data modeling" I would like to provide you with two historical facts: it took more than 25 years to get Simula (and OO) types right [1] and it took not more than 8 years for Per Martin-Loef to have intuitionistic type theory right [2].
[1] http://lucacardelli.name/Talks/2007-08-02%20An%20Accidental%20Simula%20User%20(ECOOP%20Prize).pdf http://lucacardelli.name/Talks/2007-08-02%20An%20Accidental%...
[2] https://en.wikipedia.org/wiki/Intuitionistic_type_theory https://en.wikipedia.org/wiki/Intuitionistic_type_theory
Classes are much harder to reason about than other type systems.
- sebastianconcpt 4y agoReasonable in this context I'd understand as: 1. ThingDoerFactoryFacadeFactoryInstaniatorService trying to represent the reality of an abstraction meant to represent a reality (an indirection that isolates the domain in that level of abstraction of an abstraction). 2. ThingCreator. An abstraction named in a way that is closer to direct reality (and that can perfectly hide its own inner complexities using composition and they could be as many or more than the ridiculous example in 1). Note that people that, conscious or unconsciously, exclude the inverted pyramid principle fall into creating 1 and people that, conscious or unconsciously, embrace it, tend to create 2 in "a reasonable" way.
- jkaptur 4y agoDefinition of a reasonable paradigm: millions of developers can successfully use it to build software systems used by billions. Windows, iOS, Android, Photoshop, Excel, Chrome - these are complex products that use object-oriented programming. They exist and work well. They have shipped many new features over the years.
- ihatepython 4y agoThose products don't need to be complex, at their heart they are actually rather simple. They are just written in such a way that they become unnecessarily complex, because they are poorly understood. I would argue that the examples you give don't work well (Windows, Android, Chrome, later versions of iOS). They get worse and worse over time. Even if they start out with a good design, it turns to crap eventually. Just because a piece of software is used by billions doesn't mean that it is well written.
- DeathArrow 4y agoIf by successful you mean slow to develop, slow to run, bug ridden software we have to deal with today, you have built a great definition. This kind of thinking got us Teams and Slack.
- thesz 4y agoMillions of developers also use functional programming, for decades now. Even bigger order of magnitude of developers use relational languages to build systems of various scale. Indirectly, even more millions of developers use constraint programming of various sorts (compilers, databases and user interfaces). Given that, the definition of yours does not provide much to discern between paradigms. But we can compare complexity of logic of different systems and I provided two examples of that. We can even discuss some ordering between different systems. For example, contemporary type system that is powerful enough (not even dependently typed) can model class hierarchy, it is a no big deal [1] from, at least, 2005. So classes are, in some sense, less general than System F that is used above. They also more specific, whether it is good or not. [1] https://www.cs.tufts.edu/comp/150FP/archive/oleg-kiselyov/overlooked-objects.pdf https://www.cs.tufts.edu/comp/150FP/archive/oleg-kiselyov/ov... But in System F in [1] you can have several parallel class hierarchies, without requiring anything else from the system. The same goes to other things like "escape hatches". System with dynamic types cannot prevent (runtime) errors that can be prevented by a system with static types. It is just not possible to have reasonable description of a system without certain kinds of (runtime) errors without reimplementing many things from system with static type checking. On the other side, in system with static types it is quite possible to have over-encompassing type that represents all dynamic values one needs. So, systems with static type checking are, in some sense, more general than systems with dynamic type systems. And, of course, systems with dynamic types are more specific, whether it is good or not.
- lolinder 4y ago> Given that, the definition of yours does not provide much to discern between paradigms. That's the whole point. "Reasonable" is not synonymous with "optimal", so we ought to expect that there would be multiple reasonable paradigms to choose between. Which programming paradigm you choose is very rarely the largest factor in the success or failure of your product.
- thesz 4y agoExactly. You can solve any problem by throwing more money (millions of developers). The money is the largest factor in the success or failure of the product of... yours? When something is constantly true for all objects in the scope of the domain, it is considered tautology and should be dropped from the discussion as it adds nothing. If reasonableness is equally meaaningless, we can drop it. Instead, we can look at other properties of programming paradigms.
- rqtwteye 4y ago“Because these people who created hilariously Finnish ThingDoerFactoryFacadeFactoryInstaniatorService also thought they do a reasonably reasonable job.” The people who did this will mess up FP or any other paradigm too. I think OOP was a huge step forward but like with everything in software design, you have to have good taste and recognize when something you do is going off the rails. There is no paradigm that will save you from clueless people or ideologues.
- thesz 4y ago>The people who did this will mess up FP or any other paradigm too. The people who did this will not mess up FP or any other paradigm. I have an example of that somewhere in my career, with Haskell. But it is "he said she said" here and it is not me who started that. >you have to have good taste and recognize when something you do is going off the rails The Liskov substitution principle is not precisely defined, see the "shapes" problem (class Rectangle : Square or vice versa?). Thus, you have to have "a good taste," or, to be more reality grounded, you have to weigh your design choices against current use cases and possible future changes. When you deal with constraints on a type, you don't need hierarchy at all. If you add two values of some variable type in a function, assure function's type to have Num constraints for the type of these two values. Then pass there anything that has Num implemented and be fine. The inheritance in typical OOP program fixes solutions of historical use cases in place and prevents finding more general solutions when new use cases arise. The solutions for new uses cases most often get bolted on instead of being organically implanted. Basically, it is OOP that provokes such concatenative names. When you step outside, you find yourself in no need of these.
- kaba0 4y agoWho said that you have to use inheritance for shapes? I do know that it is an often used example, but similarly to Animal/Bird it has no real world relevance. I would even argue that inheritance is not the most important feature of OOP, but objects are. Inheritance is useful, for example GUI Nodes are famously good fit for it, but object encapsulation is the essential feature, missing that would pretty much disallow large swathes of programs from existing.
- shanebellone 4y ago"Classes are much harder to reason about than other type systems." Strange, I find classes intuitive. Objects lend themselves to physical system analogues; making objects easier to reason about in complex systems. The paradigm specifically helps me build light mental models which in turn helps me retain the associated codebase. Anyone else have a similar experience?
- recursivedoubts 4y agoI find classes extremely intuitive.
- thesz 4y agoI find classes extremely unintuitive. I find type classes and (generalized) algebraic data types to be extremely intuitive.
- recursivedoubts 4y agoI have met a few people like you, and I wish you all well in your programming careers.
- kaba0 4y agoI find both intuitive and one is better for these kinds of jobs, the other for other kinds.
- DeathArrow 4y agoThere are countless articles showing how OOP fails to model the physical world.
- shanebellone 4y agoStraw man. The point of contention regards ease of reasoning not completeness or ability to model the physical world.