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. trento+Gh7[view] [source] 2024-08-27 04:03:00
>>kpw94+4h7
"is it more natural read for people familiar with writing functional programs? (am I permanently "broken" due to my familiarity with imperative programing?)"

As just one person who has written a great deal of functional code, it reads well to me. I think because I am used to reading it "inside out"? Reading lisp-likes is probably helpful.

Take 'color' for example. It opens with a 'cond', with three branches. First branch is if the idx-th position in word is the same as letter, return green. Second branch is if the word includes the latter at all, yellow. Otherwise we're grey.

That took me a few seconds to grok. Just one anecdote for you. Don't think you're broken but reading/writing this kind of code even a little bit will change the way you see code IMO.

◧◩◪
3. exitb+WG7[view] [source] 2024-08-27 10:28:50
>>trento+Gh7
This is the function that confused the person you respond to, ported to Python:

    def color(word, letter, idx):
        if word[idx] == letter:
            return GREEN
        elif letter in word:
            return YELLOW
        else:
            return GREY
I know which one I'd prefer to grok at 2AM with alerts going off.
◧◩◪◨
4. mirolj+dL7[view] [source] 2024-08-27 11:17:54
>>exitb+WG7
> I know which one I'd prefer to grok at 2AM with alerts going off.

At that time I'd just opt for sleep. Or sex. Or drink. Reading code doesn't belong to things one should do at 2AM.

◧◩◪◨⬒
5. auggie+hM7[view] [source] 2024-08-27 11:26:43
>>mirolj+dL7
And yet we've all done it.
◧◩◪◨⬒⬓
6. mirolj+hU7[view] [source] 2024-08-27 12:36:04
>>auggie+hM7
No. We didn't. At least not we all.

That's just a myth spread by a few workaholic programmers. Luckily, there are enough 9-5 programmers to clean up the mess created by those 2AM committers.

◧◩◪◨⬒⬓⬔
7. auggie+kM8[view] [source] 2024-08-27 17:23:37
>>mirolj+hU7
I'll invoke a no true Scotsman argument here.
[go to top]