Show HN: I Wrote a Book on Java
The book "Data-Oriented Programming in Java" emphasizes organizing programs around data for simplicity, highlights recent Java features, and offers a 50% discount for early access readers until October 9th.
The book "Data-Oriented Programming in Java" aims to provide insights into effective development practices in Java, focusing on organizing programs around data. It emphasizes the benefits of treating data as plain data, leading to simpler and more understandable programs. The author notes that Java has evolved significantly, incorporating new features that support data-oriented programming, such as records and pattern matching. However, the book is not centered on tools but rather on foundational principles of programming. It advocates for the idea that "representation is the essence of programming," suggesting that accurately capturing domain data can streamline system development. The book is currently in early access, and readers can receive a 50% discount until October 9th using a promotional code.
- The book focuses on organizing Java programs around data for simplicity and clarity.
- It highlights recent Java features that support data-oriented programming.
- The author emphasizes foundational programming principles over tool usage.
- The concept of "representation is the essence of programming" is central to the book's philosophy.
- A promotional discount is available for early access readers until October 9th.
Related
- Many commenters congratulate the author on their achievement and express excitement about the book.
- There are discussions about the relevance and implementation of recent Java features in the context of data-oriented programming.
- Some readers share their experiences with similar programming concepts from other languages, like Clojure and F#.
- Questions arise regarding the book's completeness and the implications of early access for readers.
- Several users express interest in how this book compares to other existing literature on data-oriented programming.
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.
The (likely debatable) list of features in 23 that a.) remain preview/incubator and b.) appear relevant to a work on data oriented Java programming are:
Primitive Types in Patterns, instanceof, and switch (Preview) – JEP 455
Implicitly Declared Classes and Instance Main Methods (Third Preview) – JEP 477
Flexible Constructor Bodies (Second Preview) – JEP 482
Vector API (Eighth Incubator) - JEP 469
Scoped Values (Third Preview) – JEP 481
[1] https://mail.openjdk.org/pipermail/amber-spec-experts/2024-A...
"So, to be clear: there will be no string template feature, even with --enable-preview, in JDK 23." - Gavin BiermanI had two friends who both wrote separate books on JS. One early book on Angular and the other was about jQuery. Both had a hard time with the critical reviews they received on Amazon and it really dissuaded them from doing any more technical writing.
I love your approach and hope you keep writing and don't let the trolls get to you! Our industry needs more people who have this "soup to nuts" approach and take into account how nearly every language has changed dramatically over time.
Again, congrats and keep writing.
One of my personal photos I keep around was taken long ago in what was the biggest bricks/mortar bookseller. I was looking at the selection of books on Java available at the time. O'Reilly was the dominant publisher, and thus had several offerings on the wall. Most of the books were at least 2 inches thick. (If you were ever involved with writing a technical book in the early 2000s, you'll understand the publisher metrics at the time were based on the width of the spine on the shelf.)
Among the many Java manuals of significant girth was a small, THIN book with the title "Java -- the Good Parts". :-{}
https://frequal.com/Flavour/book.html
It describes how to make single-page apps in Java, using the Flavour framework. No plugins, no extensions, and 99.9% pure Java. Plenty of sample code and links to relevant podcast episodes and demos.
A confusing sentence I noticed in the first chapter:
> ...then the only thing cost was some time, if they do it wrong, the cost is usually a bug.
I am guessing you mean "only cost was some time" (without the "thing")?
As for the topic, my hypothesis is slightly different — adopting functional approach to programming — even in imperative languages — leads you to the best patterns (or as you put it, "makes it inevitable") when combined with "evolutionary" architecture, and DoP is certainly one of them.
However, for a majority of software, in my experience, data "attributes" are really "leaf nodes", only to be consumed for display, and types do not really matter much there (eg. I don't mind `firstName` being a simple string). What we want to get right is types we do operations on, and most critically, relations between different data models. Accepting "evolutionary" principles in architecture also means that you welcome change and build for it, so getting any definition of data right from start is not an imperative.
But the topic certainly seems intriguing, so I look forward to learning more from your book and seeing how you apply it in a more imperative/OO way and what language features you found critical to success there.
Congrats again and good luck!
I see that the book is incomplete. I didn't know that early access for books was a thing, very neat. It might be pertinent to note in your post that it's still being written, with an estimated release window of Spring 2025.
I'm very much a "consume it when it's ready" person, so I'll keep this on my watch list.
There's another book by a similar title
https://www.manning.com/books/data-oriented-programming
Care to elaborate how yours is different?
The first chapter is pretty nice. Record types, switch statements and other new features will hopefully push Java programmers to think in terms of types more often.
Now I'm waiting for two things:
1. Manning allowing me to grab it (forgot password email notifications seems to hang)
2. More chapters :-) ... no, really, just let it roll. Don't rush.
https://www.amazon.com/Hands-Django-Beyond-Brandon-2016-03-2...
Can anyone explain current caveats and/or limitations with current licensing?
PS. All the best with the yacht! xD
One question: a lot of the Java enterprise ecosystem is based around entities (Hibernate and the like). Do you give guidance for how to work within that context? Can I use data oriented programming there?
Will checkout the book.
there's another related book from one person active in the Clojure ecosystem. Though the book examples are in JS.
also, thank you for taking the step forward on doing your own small part in changing the 'AbstractFactory' thinking that's pervasive in the Java world.
I Lost T