3 ms·
> Maybe because it's easy to decouple data from operations on that data, even if stateful You can use objects in C++ and Java without mixing code and data (by
by monsieurbanana 2y ago
> Maybe because it's easy to decouple data from operations on that data, even if stateful
You can use objects in C++ and Java without mixing code and data (by having data-only and code-only classes for example).
I haven't fully read it, but there's a book from a clojure developer about about this: https://www.manning.com/books/data-oriented-programming https://www.manning.com/books/data-oriented-programming
The book itself uses Java, not Clojure.
- netbioserror 2y agoI know Java programmers use static-method classes, which are just like modules in newer languages. Which just further illustrates the point. It's a hack on top of a language that requires everything to be defined inside of a class. That layer of abstraction on top of things that could be much simpler kills understanding. It massively complicates answering the question "What even is a class?" for a learner. I also realize C++ has simple structs, and classes can be avoided entirely, but that's definitely not the way the language is taught. Maybe I needed to "git gud", but learning Lisp enabled a career building valuable products currently in production. Java and C# were a roadblock on the way to my current productivity.
- monsieurbanana 2y agoI didn't expect that much negativity regarding my comment, I never implied you need to "git gud". I'm happy in my Clojure job and I would rather not work with OO languages, and that's definitely not how they're taught, but if/when you're forced to use them you can choose not to follow the traditional way and instead write them in a more functional/data oriented way.
- netbioserror 2y agoI didn't intend a negative tone and that's hard to convey in text.
- smokel 2y agoSorry for going off-topic, but why is this comment being downvoted? The comment provides an alternative view on things and even links to a nice book. One may not agree with the perspective, but that's no reason to downvote. Perhaps it's the user interface (a special upvoting wand would be most welcome for those of us whose fingers are too fat). Or have we reached the stage where script kiddies deploy downvoting bots if they didn't like a comment in another thread?
- markc 2y ago>The book itself uses Java, not Clojure. Almost all of the code examples in the book are in JavaScript (not Java) though a significant feature of Sharvit's approach is that it decouples Data Oriented Programming from any specific language. As a Clojure geek, I highly recommend the book as the way to achieve some of Clojure's core virtues in other languages.