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

I never understand the appeal of templates, why not just use a regular programming language and make a function that generates html string like

    h("div", { class: "container" }, [
        h("p", {}, "oh hi!"),
    ]) // -> "<div class="container"><p>oh hi!</p></div>"
It's the same ergonomics as custom template languages as far as I know, loops, variables, functions etc, plus you can just call them directly in your server code, not having to worry about another syntax that's not even turing complete


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

Search: