Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think I like Clojure's Hiccup/Reagent a bit better. It gives you a structure that's basically the same as vanilla HTML, but it uses vanilla Clojure data types and keywords to do it.

Doing this makes testing trivial, and you also don't need to worry about closing tags as much. As far as I can tell, the compilation is fast enough to where the overhead of translating to HTML doesn't seem to take any amount of time.

Plus I just really like Clojure :)



Yeah, I really enjoy Hiccup's solution. Writing declarative structures for declarative "code" (html) in a declarative language (Clojure) just makes everything mentally work right for me.

Whenever I had to write JSX I have a lot of weird internal "switching" going on in my head.


Compilation of HTML. Now this is something.


Is that really any different than JSX? I'm assuming that JSX doesn't just directly do `"<div>" + user.name + "</div>"`. Presumably it maps it to some kind of data structure and eventually compiles that into something that can be rendered.


JSX is compiled into plain old Javascript react code. Or at least it used to, but I don't know if it still does - I don't use react these days:

https://legacy.reactjs.org/docs/introducing-jsx.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: