back

by theanonymousone·2y ago·view on hn ↗
Many people praise the PHP-native model of mixing HTML with server-side code (Dynamic HTML if I remember correctly), and rightfully so for many use cases.

But I wonder why no other languages has implemented this model, not even Python which is used for almost everything.

Templating is not the same thing as the language in the template is normally not the complete host language, and JSP is quite old and did not even support Java 8 the last time I tried :/

3 comments
DHTML was HTML mixed with JS/VB type scripting[1] not server side stuff like PHP :)

1. https://en.wikipedia.org/wiki/Dynamic_HTML

Thanks for the correction. Maybe something like dynamic web page was on my mind: https://en.wikipedia.org/wiki/Dynamic_web_page
The React server side components crowd seem to have figured it out!
Is .NET Razor Pages not also using this model?
Nah, Razor is a template engine. Laravel's equivalent is Blade. They're templates in the same that the templates is compiled into a string with parameters then the string is output to the response.

What top post is referring to is the ability to control what is output to the buffer (raw characters) and what is scripted (<?php ... ?>). The closest equivalent would be classic ASP (not asp.net)

As a side note, I once tried to do a hello world in Razor because of its Wasm capability and found the documentations unbelievably horrible. Admittedly I am not a .Net developer.