r/Clojure • • Dec 29 '21

πŸ“– Data-Oriented Programming book: First draft

After 18 months of development, I am glad to announce that I finally completed the first draft of my book: Data-Oriented Programming.

I wanted to thank all the people from the Clojure community that helped me in the thinking and the writing process.

The book got sold decently (2.8k copies) despite being in MEAP state (Manning Early Access Program).

The book is my attempt to formulate the underlying principles of Clojure approach to data and illustrate how to apply them in another language.

Here are the 4 principles of Data-Oriented Programming:

  1. Separate code (behaviour) from data

  2. Represent data with generic data structures

  3. Data is immutable

  4. Separate data schema from data representation

For those who already bought the book or are interested, I released the book's source code to https://github.com/viebel/data-oriented-programming. The publication is expected for March 2022.

If you guys aren't sure about buying the book, contact me on Twitter @viebel, I'll DM you a preview.

91 Upvotes

22 comments sorted by

View all comments

6

u/EvocativeBanjo Dec 29 '21

I bought the MEAP version of this book about a month ago - really enjoyed it! Thanks for distilling these ideas for a JavaScript developer like me 😝

3

u/viebel Dec 29 '21

Thank you!
What ideas were easy to apply in JavaScript and what ideas were more challenging?

3

u/EvocativeBanjo Dec 29 '21

I also watched some of your talks on YouTube- I enjoyed your down to earth approach and collaborative spirit! I found the multi method concept really interesting and I developed my own implementation in a toy functional programming library I’ve been working on.

Prior to your book, I was reading Composing Software and Joy of JavaScript, so I’ve been in a functional programming kick! I found the idea of using just plain objects to be a bit of an interesting idea, gonna have to see how I can mesh this with DDD.

3

u/viebel Dec 29 '21

Could you share your implementation of multimethods?

4

u/EvocativeBanjo Dec 29 '21

Sure! Here’s the link to my repo: https://github.com/astridlyre/fp 😊 I’m still figuring this all out! The pertinent file is src/multimethod/multimethod.ts