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

I can't see any way that writing a verbose json format that is just pseudo-html is a solution instead of being another layer of problem on top of the original. Also the argument against selectors is nonsensical unless we're suggesting that xpath is wrong. The only reason selectors are for styling is because that is the approach taken by browsers and so you are tunnel visioned into believing that is the case. They are not "for" styling, they are selectors use "by" styling. I similarly don't see what drawing parallels to C has anything to do with it.

I'd also like to point out that in a good portion of JS projects HTML and JS have a symbiotic relationship so the notion that you have to scrub out all the HTML as "best practice" is entirely incorrect in my eyes, thus the failing/winning example makes no sense without context. Is that HTML pre-baked into the page by the server? Then it makes complete sense to be that way. Are you hand generating it from strings? Not ideal, but there are tons of far more elegant ways to solve that already and they don't require you to still be writing HTML in your JS (even if it looks like JSON it still has a single purpose and is wedged directly into your code).

At least existing templating solutions call out to external templates in locations where the HTML "should be".



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: