Comment

Comment by flossly

Kotlin has optional OOP on the JVM. I still use it, but sparingly. Barely ever classes inherit from other classes in my code; I use interfaces, mostly to be able to fake services for testing.

Most of what I write are functions and data objects (records, basically).

One pattern I use is classes with one function, where the constructor takes the functions dependencies, and the function only takes non-dependency parameters.

parent flossly 9 days ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton