6 ms·
This is one reason that I’m always skeptical of dogma. My only tool is a hammer… But that said, many new techniques (I clearly remember when OOP was the “new p
by ChrisMarshallNY 5y ago
This is one reason that I’m always skeptical of dogma. My only tool is a hammer…
But that said, many new techniques (I clearly remember when OOP was the “new paradigm”) can offer radical improvements to the status quo.
I use OOP all the time, but I also don’t do data processing engines. Most of what I do is GUI and/or device control/communication. For these types of things, OOP is still very much a mainstay, and probably always will be.
I won’t sniff at DDD, but get really tired of being lectured about the way I do things; just because it doesn’t involve “buzzword du jour.”
BTW: I remember a guy at a conference, telling me about exactly this problem with OOP, in the late 1980s. That was back when OOP was a relatively new kid on the block, and he was arguing against using it.
He was correct, but it did not apply, in my use case. The massive improvement in complexity management and quality, offered by OOP, far outstripped any speed advantages of classic procedural programming (which is what he was arguing for).
- beigeoak 5y agoHow much time do you allocate to HN? I see you almost every day in the comments.
- mytailorisrich 5y ago> This is one reason that I’m always skeptical of dogma Yes, this is because too often people follow buzzwords instead of trying to understand the concepts. The issues OO design aims to solve are still valid and still the issue people want to solve. Encapsulation, single responsibility principle, even the concept of object/class (i.e. interacting with data through a set of specific methods) are good design principles, there is no reason to throw them away. It makes sense to use data-oriented design in applications that are data processing intensive, and this is nothing new, but that is orthogonal with using OO principles. Likewise, immutable data can have benefits. This does not mean the concepts above are no longer valid. It means using them with immutable data.
- taffer 5y agoPersonally, I have come to the conclusion that object-level encapsulation is not a good design principle, but rather an antipattern because it complects data with code [1]. OOP tries to manage global mutable state by partitioning and encapsulating it into objects. However, the only way to prevent two unrelated objects from manipulating the same part of the state is to create a tree, i.e., a strict hierarchy between all objects in the system. This combination of data and code in a strict hierarchy means that all data access patterns are baked into this dependency tree, making later, unforeseen changes to the software extremely difficult without taking shortcuts in the dependency tree or having to refactor the entire application. If, on the other hand, you treat your data as just data, preferably flat and immutable, and keep the code that acts on it separate, then you won't run into this problem. You will be able to change the parts of the code that act on the data structures independently. [1] See Rich Hickey, Simple Made Easy: https://www.youtube.com/watch?v=oytL881p-nQ https://www.youtube.com/watch?v=oytL881p-nQ
- ChrisMarshallNY 5y agoAgreed, but, for me, I am not really a data programmer. I tend to work in state and identity (classic UI and communications). For these, that characteristic is actually an advantage. Nowadays, centralized data processing is the big deal for software engineering (as it was, fifty years ago). I'm just a humble app developer, and I'll license stuff that real data programmers do, if I need it.
- urthor 5y agoExactly, the biggest single advantage of OO is the ability to create and manipulate insanely complicated data structures simply and easily. Because it's a way to define a whole bunch of methods AND assign all aspects of thinking about the state of the data to those methods to the author... it's a brilliant tool for designing some insane complexity. Which is exactly what you need for MVC paradigms. There are multiple tools and they are for different jobs, imagine that.
- vendiddy 5y ago