2 ms·
So you are correct that purely programmatically its a bit wonky to construct an XML document using a bunch of strings and then pass that to the client and pray
by moocow01 13y ago
So you are correct that purely programmatically its a bit wonky to construct an XML document using a bunch of strings and then pass that to the client and pray that that your XML (HTML) is well formed enough.
I think the reason for why HTML construction is done the current way that it is is that it goes back to when most web companies had "software engineers" handling the system and "web developers/designers" who spruced up the data coming out of the system with HTML. The designers didn't know much deep programming per say but they knew HTML and would create HTML templates in plain text with placeholders to expose anything dynamic. Those templates would then be handed off to engineering whose sole concern was getting the system right and didn't really want to care about HTML. This workflow is also what gained PHP a lot of traction originally.
So ultimately I think stitching together HTML with strings makes the system a lot more accessible to semi-technical folks and its honestly probably a lot faster to do development by typing out HTML rather than building XML objects.