Earlier quoted context omitted.
htmx sucks: https://htmx.org/essays/htmx-sucks/
So it is bad?
The Grug Brained Developer (2022)
81–90 of 603 posts
Re: The Grug Brained Developer (2022)
#82Re: The Grug Brained Developer (2022)
#83This has by far the best discussion of the visitor pattern I've yet to come across.
I don't work in typical OO codebases, so I wasn't aware of what the visitor pattern even is. But there's an _excellent_ book about building an interpreter (and vm) "crafting interpreters". It has a section where it uses the visitor pattern. https://craftinginterpreters.com/representing-code.html#the-... I remember reading through it and not understanding why it had to be this complicated and then just used a tagged u…
Re: The Grug Brained Developer (2022)
#84Re: The Grug Brained Developer (2022)
#85Re: The Grug Brained Developer (2022)
#86Earlier quoted context omitted.
How does someone know twenty C++ developers and zero C developers though?
Born in the 80s.
Re: The Grug Brained Developer (2022)
#87Earlier quoted context omitted.
I don't work in typical OO codebases, so I wasn't aware of what the visitor pattern even is. But there's an _excellent_ book about building an interpreter (and vm) "crafting interpreters". It has a section where it uses the visitor pattern. https://craftinginterpreters.com/representing-code.html#the-... I remember reading through it and not understanding why it had to be this complicated and then just used a tagged u…
It's an engineering tradeoff. https://prog2.de/book/sec-java-expr-problem.html - Not the writeup I was looking for but seems to cover it well. > Why burden ourselves with indirection and complexity when there's a more straight forward way? Because each way has its own tradeoffs that make it more or less difficult to use in particular circumstances. https://homepages.inf.ed.ac.uk/wadler/papers/expression/expr... - Wad…
However, this is just not something that I typically perceive as a problem. For example in the book that I mentioned above, I didn't feel the need to use it at all. I just added the fields or the functions that were required.
In the first link you provided, the OCaml code seems to use unions as well (I don't know the language). I assume OCaml checks for exhaustive matching, so it seems extremely straight forward to extend this code.
On the other hand I have absolutely no issues with a big switch case in a more simple language. I just had a look at the code I wrote quite a while ago and it looks fine.
Re: The Grug Brained Developer (2022)
#88and clojure.
mmmmm.