by paulddraper · 10y ago · 0 comments
It's easiest to keep everything in one templating system and language. (Note: I said easiest, not most robust or ideal.)
Options:
1. Isomorphic code. This requires either NodeJS or compile-to-JS tooling.
2. Client-side-only: bad for SEO and usability.
3. Server-side-only: You either write several lives of boilerplate every time line your example, or use intercooler and write a single-liner.
For smaller sites, the number of parts often isn't huge, so boilerplate isn't a big deal.
Generating code in a Turing-complete language use a program written in another Turing-complete language can get messy.
Just because something is turing complete doesn't mean that a generator has to be able to generate anything possible.
If boilerplate is an issue, scaffolding / code generators can be a quick fix.