3 ms·
>rather than focusing on "omg html in my js" you should focus on "omg presentation code in my business logic code" because that's when you realize where the rea
by jordache 9y ago
>rather than focusing on "omg html in my js" you should focus on "omg presentation code in my business logic code" because that's when you realize where the real boundary is.
Just no. many times presentation code is tightly coupled with some desired functionality that drives that presentation. HTML inside JS is just inherently weird. It's one level of counter-intuitiveness to have the HTML set to some variable and put away and referenced further by the var.
It's another level to have html in-line with JS method calls. The two languages just doesn't jive syntactically
- 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