HNHacker News
TopNewBestAskShowJobs

goostavos

5,885 karma · joined February 24, 2012

Software engineer and overall pretty swell guy.

Checkout my book! https://www.manning.com/books/data-oriented-programming-in-java

chriskiehl.com

submissionscomments
goostavos··on Octopuses seen hunting together with fish
And they might have dreams!

One of the coolest things I've encountered at an aquarium was a sleeping octopus wildly shifting its colors. It seems truly alien to behold -- like it shouldn't be possible.

My googling after the fact says that who knows why they actually do it or what's going on, but, I really like the thought of them having little octopus dreams.

goostavos··on Show HN: I Wrote a Book on Java
Sure! The core dividing line between the two books boils down to how they approach representing data in a program. Yehonathan's book advocates for immutable data stored in untyped data structures (for instance, Map<Object, Object>). My book takes the opposite approach. It advocates for building around immutable data that's strongly statically typed. It aims to capture the stuff in our domain using algebraic data structures.

This modeling difference has pretty far reaching implications. They lead to very different kinds of code bases, and thus very different books.

Here are the repos for the two books. Poking around those should give you a good overview for how radically two things both called "data-oriented" can differ :)

* https://github.com/chriskiehl/Data-Oriented-Programming-In-J... * https://github.com/viebel/data-oriented-programming

goostavos··on Show HN: I Wrote a Book on Java
Will do!
goostavos··on Show HN: I Wrote a Book on Java
Oof -- embarrassing! At least I know what I'll be thinking about as I try to fall asleep tonight.

Thanks for pointing out the typos and wonky wording! Will fix!

goostavos··on Show HN: I Wrote a Book on Java
It does! Chapter 4 specifically tackles modeling with sum and product types. They're used all throughout the book after that.
goostavos··on Show HN: I Wrote a Book on Java
Writing is still in progress :)

No firm date for the final publication yet.

goostavos··on Show HN: I Wrote a Book on Java
I have a long convoluted answer to this.

I love that talk (and most of Rich's stuff). I consider myself a Clojure fanboy that got converted to the dark side of strong static typing.

I think, to some degree, he actually answers that question as part of his talk (in between beating up nominal types). Optionality often pops up in place of understanding (or representing) that data has a context. If you model your program so that it has "15 maybe sheep," then... you'll have 15 "maybe sheep" you've got to deal with.

The possible combinations of all data types that could be made is very different from the subset that actually express themselves in our programs. Meaning, the actual "explosion" is fairly constrained in practice because (most) businesses can't function under combinatorial pressures. There's some stuff that matters, and some stuff that doesn't. We only have to apply typing rigor to the stuff that matters.

Where I do find type explosions tedious and annoying is not in expressing every possible combination, but in trying to express the slow accretion of information. (I think he talks about this in one of his talks, too). Invoice, then InvoiceWithCustomer, then InvoiceWithCustomerAndId, etc... the world that microservices have doomed us to representing.

I don't know a good way to model that without intersection types or something like Rows in purescript. In Java, it's a pain point for sure.

goostavos··on Show HN: I Wrote a Book on Java
I can highly recommend excellent Domain Modeling Made Functional by Scott Wlaschin for an F# book that touches on a lot of the ideas which back data-oriented programming (namely, representing your domain as strongly typed data).
goostavos··on Show HN: I Wrote a Book on Java
I've thought a lot about this quite a bit. In my day to day life, which is a cog in the machine at $Megacorp, I regularly work on embarrassingly old versions of Java (hello JDK 8!). So, not having the latest and greatest language features is a topic close to my heart. As such, the book takes a very tool agnostic approach. If we cover something that's only available advanced JDKs, we also cover what to do if you don't have it.

Data oriented programming is about building around the data in your domain. The latest tools are nice, but they're just tools.

goostavos··on Show HN: I Wrote a Book on Java
>Once I get two or more levels of nesting, I find it far too easy to get confused about which level I'm on

Author here, I agree with you. I have the working memory of a small pigeon.

The flavor of data orientation we cover in the book leverages strongly typed representations of data (as opposed to using hash maps everywhere). So you'll always know what's shape it's in (and the compiler enforces it!). We spend a lot of time exploring the role that the type system can play in our programming and how we represent data.

goostavos··on Show HN: I Wrote a Book on Java
It has been awesome working with him.

There are few things as intimidating as having the Java language architect review your book on Java (haha). It's a much, much better book thanks to his involvement.

goostavos··on Show HN: I Wrote a Book on Java
This is the hardest I've ever been judged for a typo! haha.
goostavos··on Show HN: I Wrote a Book on Java
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.

goostavos··on Amazon tells employees to return to office five days a week
I hear a fair amount of this sentiment floating around. Not so much "I won't do oncall" but more so a deflation of moral -- if you want clock punchers, we can be clock punchers.

Setting a SEV2 to "pending" does prevent you from getting re-paged during the weekend when you're at home (where work, as I understand it, does not get done).

goostavos··on Amazon tells employees to return to office five days a week
This is not the first "we're starting a committee to figure out what to do about there being too many committees" I've seen in my ~7 years here. Makes me laugh every time.
goostavos··on Amazon tells employees to return to office five days a week
>empire building

I've been here about the same amount of time. Also L4-L6. I'll echo your "empire building" comment. That, above all else, seems to be the root of the evil. Managers need "scope" to get promoted. They get scope by building an empire. That leads to programs and initiatives and new processes without any connection to customer value. They only exist to be a line item on a promo doc. It is a topic of endless and open complaint that ICs get sucked up into some manager's "promo project."

The big shift seems to be that only a subset of people are talking about producing value. The majority are talking about being seen as producing value.

goostavos··on Amazon tells employees to return to office five days a week
If you're allowed to get out! There are some vicious managers out there. The worst among them will force a PIP if they so much as think you might be hoping ship.

Luckily, in my time here, it has seemed like managers with this egregious behavior tend to get forced out of the company. However, they do insane amounts of psychological damage while they're here. Some teams have faced real tyrants :(

goostavos··on Amazon tells employees to return to office five days a week
>entrenched management class

This exists among the ICs class, too. "The bar" is under active manipulation so that they sit higher amongst the sea of low performers.

goostavos··on Amazon tells employees to return to office five days a week
Stuff like that can almost always be traced back to that senior being told to "be visible." Show up! Have opinion on things (loudly)! "Scale yourself!" Other mumbo jumbo. It often leads to these weird misguided drive-bys where everyone is left confused.
goostavos··on Amazon tells employees to return to office five days a week
How do you all track sprints / progress / goals on your side of the fence?

At least in the orgs I've been in, it seems to me that everyone is always aware at any given time who the "coasters" are. We have to constantly work around them / isolate them from causing damage. Hell, even Forte should give some signals.

goostavos··on What If Ozempic Is Just a Good Thing?
Genetic gifts don't trump thermodynamics (unfortunately).

>Please reserve your moral judgments.

This thread seems needlessly heated. How is it a moral judgement to say that some folks don't put in the effort to control calorie input? Losing weight sucks. It's worse the bigger you are. But they're not gaining weight by magic. They're consuming more calories than they burn. It is as simple as that (yes, yes, yes -- gut flora, metabolism disruption, vernal equinox, micro-plastics, etc. etc. There are plenty of variables that change the efficiency of the mechanism, but none that override the core mechanism.)

fwiw, Ozympic sounds great to me if people want to take it. Also great if they don't.

goostavos··on What If Ozempic Is Just a Good Thing?
It's feels unfair that a single Halloween Oreo cookie is 70 calories. The caloric density of modern and delicious food is absolutely insane.

And so, aside from a rare treat, which mostly leaves me sad (because I only get to eat two), I eat things that aren't ultra-processed 5G seed oil based. And my weight remains controlled despite said 5G vaccines, seed oils, and gut flora disruption.

Ozympic seems like a net good if it helps people control their weight. It just always seems preposterous when people blame "ultra-processed food" as the root problem, rather than the over consumption of said food as the problem.

goostavos··on What If Ozempic Is Just a Good Thing?
Nose bleeds :(
goostavos··on A Java language cumulative feature rollup
It might be worth one more shot ^_^ I've (unexpectedly) found myself writing a book on modern Java practices (after years at $megacorp), so I think there's some stuff people miss about what's going on lately.

> the language was still stuck in the 90s

The folks who lead Java are doing an awesome job of tugging Java out of the E N T E R P R I S E 90s and into a more "modern" direction (all without breaking backwards compatibility). The long tail legacy will always be there, but the language is rapidly evolving and picking up new modeling and QoL tools.

>There are no easy ways to build abstractions so it's all annotation upon annotation or back to design patterns of composition / inheritance.

This is still a common belief, but it misses some of the cool stuff happening in Java lately. Sealed interfaces and records are amazing data modeling tools.

Those features snuck Algebraic Data Types into the stuffy "90s" enterprise language. Records (product types) and sealed interfaces (sum types) make modeling things pretty seamless. Sure, it isn't Haskell, but it's powerful and, compared to the old way of doing things, phenomenally terse and expressive.

>Do not even get me started with Gradle/Maven where declaring a custom task is a mini project.

Ok. Agree entirely here. Every Java build tool makes me want to pull my hair out. Honestly, even after years of using Gradle, I stil have no idea how to use Gradle. I poke things until it works.

>everything is mutable

Another thing that's changed / changing! Records are shallowly immutable by default. Value classes are on the way (currently a JEP). The collection interfaces are now "null hostile" when you go through the value-oriented constructors. There are lots of ways of controlling mutability in the langauge. Java has evolved into something that lets you control whether you want to talk about identity objects or value objects.

>anything can be null

I've found this is, generally speaking, not a huge issue in modern code. It can be mostly mitigated by convention in code you control. However, definitely an ongoing pain point when interfacing with 3rd party libraries. There are lots of @NonNull annotation processors, but I think they're mostly bad tools. Having null hostility at the compiler level would be a awesome next feature in java (fingers crossed).

>Most people stick with it because "achitects" (who coded last in 2011) like it and/or people have not tried any other modern programming language and stick with the tried and tested

FWIW, I use all kinds of cool "modern" languages (Purescript, Idris, Clojure, etc.). I also use run-of-the-mill stuff like Python. Even with that familiarity, I still think Java is a good fit for many projects. It's boring. It's reliable. Everybody can learn it. Everyone can be trained to write it well (i.e. in a "modern" style). The JVM is rock solid. It's a great language for stuff that just works and doesn't page you at night.

goostavos··on Amazon Still Has a Counterfeit Problem
The ads thing is unreal. "Customer obsession". I pay the extra 2.99 and still see pre-roll ads, but those apparently, according to customer service, don't count as ads. Oh, and part of the platform is under "freevee," which is an ad-based service, so "obviously" the fee for removing ads doesn't apply to that one. Prime started out great. I still like that I can pay money in exchange for watching something, but ham-fisting of ads fills me with contempt for the entire thing.
goostavos··on Show HN: I published a book to save you from my software architecture mistakes
Congrats on finishing the book! 400 pages in 5 months is insane levels of productivity. I'm very jealous!
goostavos··on Show HN: I published a book to save you from my software architecture mistakes
While I agree that people need to make mistakes (giving newbies room TO make those mistakes is an important part of mentorship imo), I couldn't disagree more with the idea that there's nothing to learn about architecture from a book.

A vast majority of the mistakes people make are avoidable ones stemming from ignorance. They're often missing the "why" part of architecture. "What does it mean for an architectural choice to be 'good'?" This can 100% be "book learned" and then mastered through the messy process of experience. You have to at least know the rules to play the game. Many people skip the "know" part.

goostavos··on Is running a more efficient way to travel than walking?
Add a weighted backpack and you can massively ramp up the calorie burning aspect of those shorter walks.

"Load carriage" is a thing the military has put some effort into studying. A 50lb pack turns a brisk walk into something that burns 100s of calories. Even an extra 20lbs on your back adds up. It might not feel like a lot, but the difference in heart rate for same perceived effort is shocking.

goostavos··on Isometric Projection in Game Development
My paranoia has grown from link hoarding to storing PDF dumps of sites that are really important to me. There've been so many times over the years that amazing resources just blip out of existence.
goostavos··on Isometric Projection in Game Development
Hearing that other people struggled with this problem gives me solidarity. It took me an embarrassing amount of time to get "click and drag thing" working in isometric [0]. Rendering differently sized sprites was a whole other thing.

Figuring it out without google was immensely satisfying, though. Reminded me what I love about programming.

[0] https://chriskiehl.com/article/home-theater-calculator

← PreviousPage 3 of 28Next →