4 ms·
> HTML inside JS is just inherently weird. ... The two languages just doesn't jive syntactically that's because you can't escape the notion that DOM must alway
by keymone 9y ago
> HTML inside JS is just inherently weird. ... The two languages just doesn't jive syntactically
that's because you can't escape the notion that DOM must always be represented as HTML and nothing else. [v]DOM is a very well structured entity, and it so happens that our programming languages love structured entities and manipulating them.
- jordache 9y agoWho said anything about DOM? You/Me/We are all talking about HTML code.. I'm not talking about the mental model of writing DOM manipulation code. React still has user write actual HTML syntax.
- keymone 9y agoDOM is what we're talking about. The fact that it's commonly represented by HTML and that somehow influenced how we ought to create/manipulate it in our code is exactly the problem. React has users write HTML-like syntax sugar that turns into createElement calls and i don't like that one bit. Hiccup[1] lets me write idiomatic Clojure code that represents DOM tree using convenient data literals and provides all necessary functions to manipulate it - and that i like. [1] https://github.com/weavejester/hiccup https://github.com/weavejester/hiccup