4 ms·
Wasted 10 years programming because of OOP. Better late than never. Just use function and what you need is really just Data structure + Algorithm. DDD, Design
by revskill 4y ago
Wasted 10 years programming because of OOP.
Better late than never. Just use function and what you need is really just Data structure + Algorithm.
DDD, Design patterns,.. or complicated things just born to fix the OOP methodology.
- bbzealot 4y agoI don’t see your point. DDD is not inherently tied to OOP: the whole strategical part isn’t about code at all, and the tactical part is applicable to FP as much as to OOP. WRT design patterns, they exist in functional programming as well, they’re just different.
- vasergen 4y agoDDD is not hightly coupled to OOP, the problem is that most popular books (red and blue one linked in Fowler's blog for example) were written in time when OOP was very popular and authors also used languages that propagates OOP. If the authors would used purely functional languages then people wouldn't assume it is about OOP.
- bbzealot 4y agoFair point, even though IMHO it's not that hard to apply the concepts from these books to a FP context. Nowadays there are even resources about DDD specific to the FP world, such as Domain Modeling Made Functional by Scott Wlaschin [0]. [0] https://pragprog.com/titles/swdddf/domain-modeling-made-functional/ https://pragprog.com/titles/swdddf/domain-modeling-made-func...
- aryehof 4y ago> what you need is really just Data structure + Algorithm Lets hope your not in charge of building that new complex air traffic control system, bank lending system, or large inventory management system. Did you learn nothing of over a decade of large projects using data-flow modeling (structured analysis)?
- cjblomqvist 4y agoCan you elaborate? I'd love to have have more arguments for why FP is not the holy grail it's sometimes made out to be!
- aryehof 4y agoEmail me if you want to chat about it. I'm loathe to write a treatise here sorry.
- ernst_klim 4y agoThe core illusion of OOP is that it makes the design of large-scale system simpler by hiding away the complexity behind the facade of objects exchanging messages. When in fact you can have architecturally separated modules without objects just fine, and all objects bring is the complexity of finite state machines talking to each other via complex message protocols. Sometimes you indeed need some virtual dispatching, but most of the time procedure is a better abstraction, and function is even better. Instead of making complex parts of the system simpler, OOP usually makes simple parts complex. Hence the need for frameworks. In functional or procedural worlds people just take libraries and glue them together. In OOP world it's nearly impossible because of how complicated object protocols are, so if you have objects from different libraries, you'll most likely need to write lots and lots of facades. Hence OOP evolved towards megalibraries which have it all. > Lets hope your not in charge of building that new complex air traffic control system, bank lending system, or large inventory management system. Many of these are doing fine being written in procedural style though.
- al_mandi 4y ago> In OOP world it's nearly impossible because of how complicated object protocols are, so if you have objects from different libraries, you'll most likely need to write lots and lots of facades. That's not a direct result of OOP. Languages can have extension functions or type classes or delegation to address this. And it's not like the problem magically goes away for procedural code.
- al_mandi 4y agoFunctions are design patterns to simulate jumps after all.
- ernst_klim 4y agoIt's the opposite, lambda is the ultimate GOTO.
- mikro2nd 4y agoGenuine question: What OO languages have you worked in?
- wruza 4y agowhat you need is really just Data structure + Algorithm And Context (at least in my humble experience). Lately I got rid of OOP too and now all my functions accept `params` as a first argument which contains settings and the state of an object/subserver/etc. I find the ability to group functions into different files useful though (it’s js so I cannot do that like one does in c++).