zlacker

[return to "Clojure Desktop UI Framework"]
1. kpw94+4h7[view] [source] 2024-08-27 03:53:02
>>duckte+(OP)
I'm sure Clojure is a great language for some tasks...

But, looking at the examples (picked the Wordle one since I know that game): https://github.com/HumbleUI/HumbleUI/blob/main/dev/examples/...

I find it extremely hard to read. Even small snippets, say line 56 to 74 which define this "color", "merge-colors" and "colors"... then the "field" one lines 76 to 117 is even harder.

is it more natural read for people familiar with writing functional programs? (am I permanently "broken" due to my familiarity with imperative programing?)

I wonder what the same Wordle example would look like in, say pure Flutter.

Also wonder how would that code look with external dependencies (say hitting a server to get the word of the day), and navigation (with maintaining state in between those pages)

◧◩
2. forget+518[view] [source] 2024-08-27 13:26:29
>>kpw94+4h7
This one's pretty clean for Clojure code, due to the simplicity of the data model, in the most conventional sense, as the state of the program is just the word, the guesses, and the grid of colored characters for the guesses.

External dependencies you manage like in most other applications nowadays, you don't hit external services in the "guts" of your code unless you really need to, for performance, testability and to keep the less reliable parts of your code isolated, you keep the interactions with external services as close to the "main" of the application as you can.

When things break down is with more complex data models of the application, not even as much because of the language itself but because Clojure programmers actively reject using record types and interfaces, and just pass dictionaries around. You wind up with some code that, bafflingly, gives the impression of being very simple and neat, but you can't tell what it's actually doing.

[go to top]