top | item 41629449

(no title)

raju | 1 year ago

Let me start by saying (as someone who has written a few technical books of his own)—Congratulations!

I am sure you (assuming this is your first book) are learning that this is a labor of love, and I wish you the very best in this endeavor. You should be proud!

I was exposed to "data oriented programming" thanks to Clojure—wherein maps/sets are the constructs used to pass data (as plain data) around, with simple functions that work with the data, as opposed to the traditional OO (hello ORM) that mangles data to fit some weird hierarchy.

Java's recent innovations certainly make this a lot easier, and I am glad someone is looking at propagating a much needed message.

I will take a look at the book, but I wish you the very best.

discuss

order

mrbonner|1 year ago

I am also very interested in how this work in practice. With OOP at least you know the shape of your data structure as opposed to the hash map as a mere container type.

geophile|1 year ago

I am an OOP programmer going back to the late 80s (including the cfront days of C++), and a serious user of Python since 2007.

In Python, I sometimes try data-oriented programming, using lists and dicts to structure data. And I find that it does not work well. Once I get two or more levels of nesting, I find it far too easy to get confused about which level I'm on, which is not helped by Python's lack of strong typing. In these situations, I often introduce objects that wrap the map or dict, and have methods that make sense for that level. In other words, the objects can be viewed as providing clear documentation for the whole nested structure, and how it can be navigated.

kccqzy|1 year ago

Clojure has spec. That allows you to know a specification of what the data structure contains.

akavi|1 year ago

You can get strongly typed "shaped" data without objects[0], even in Java: Records[1].

~Unfortunately, I believe they're mutable (and cannot be made immutable).~ Edit: I was wrong, they're immutable.

[0]: I'm using "object" to mean "data bound to methods", since the concept of aggregate data in general long pre-date OOP (eg, C's structs)

[1]: https://docs.oracle.com/en/java/javase/17/language/records.h...

davedx|1 year ago

With TypeScript you have types to tell you the shape of your data.

goostavos|1 year ago

Thanks for the kind words :)

>learning that this is a labor of love

I underestimated both the amount of labor and the amount of love that would be involved. There were more than a few "throw everything out and start over" events along the way to this milestone.

Clojure definitely had a huge impact on how I think about software. Similarly, Haskell and Idris have rearranged my brain. However, I still let Java be Java. The humble object is really tough to beat for managing many kinds of runtime concerns. The book advocates for strongly typed data and leveraging the type system as a tool for thinking.

>Java's recent innovations certainly make this a lot easier

Yeah, it's an exciting time! Java has evolved so much. Algebraic types, pattern matching, `with` expressions -- all kinds of goodies for dealing with data.

jwr|1 year ago

> Clojure definitely had a huge impact on how I think about software

I could be called a "Clojure programmer", because I make a living from an app written Clojure and ClojureScript. While I always appreciated the incredible JVM, I always looked at Java the language with disgust and contempt, interfacing with it only as was necessary, but recent work on Java makes it much more attractive. I was impressed by the functional interfaces, modern design with mostly static methods, JSR-310 (date and time) is absolutely great — overall, Java has improved a lot over the years.

It has come to the point where I gasp might consider writing some Java code :-)