4 ms·
There's something attractive about this example but i'm struggling to figure out why i think that. What is it that makes this attractive? + There's a signal
by CraigJPerry 6y ago
There's something attractive about this example but i'm struggling to figure out why i think that. What is it that makes this attractive?
+ There's a signal to noise ratio that's off the charts
+ You've not cheated to achieve succinctness; there's no blackbox.nowDrawTheRestOfTheOwl()
- I don't think that's "pretty" code
- i don't find it easy to parse, i had to read your example with my index finger pressed against the screen as i traced through it - i didn't have to do that with the Typescript further example down-thread
- filoeleven 6y agoJust curious: what’s your level of fluency with Clojure/lisp syntax vs C-style syntax? I found that learning to read the lisp-style indentation (which is purely by convention but has widespread acceptance and tooling support) was a pretty fast process with a solid payoff. It becomes easier to jump between levels of detail, and I now find it to be more readable than C-style syntax, even though I only write JS for work. For example, in the code above, “what it does“ is made clear by reading downward without looking very far to the right: it draws a button with a click handler and a label. There is a guarantee offered by immutability that says “anything deeper than my current level cannot affect things outside of itself.” That may sound like a lie, since the :onClick handler updates an atom, but knowing that a dereferenced atom (@count) has a stable value during the lifetime of the function call resolves it. I don’t know how strong that guarantee is with other lisps; I think Clojure’s immutability plays a key role though.
- CraigJPerry 6y agoYeah i agree the readability is purely a lack of familiarity on my part rather than some fundamental difficulty in the syntax. If anything, the clojure syntax has fewer rules to understand - from my very limited knowledge of it.