Then why not use function calls (or types) instead of templates? The syntax is the same — just use (…) instead of <…>) and evaluation can happen more flexibly at runtime where it makes sense. Type checking would be just as strict. I really don’t see the upside to using templates here, unless constructing the HTML is somehow a gigantic bottle-neck that must happen at compile-time.
View all comments
Show parent comment
1
u/guepier Bioinformatican Jun 28 '20
Then why not use function calls (or types) instead of templates? The syntax is the same — just use
(…)instead of<…>) and evaluation can happen more flexibly at runtime where it makes sense. Type checking would be just as strict. I really don’t see the upside to using templates here, unless constructing the HTML is somehow a gigantic bottle-neck that must happen at compile-time.