6 ms·
Author here. > First of all, what is load time? Load time is when server is generating HTML for request. I should have been more precise. > Most server side t
by tpetrina 8y ago
Author here.
> First of all, what is load time?
Load time is when server is generating HTML for request. I should have been more precise.
> Most server side templating engines are compiled, rarely string concatenated and even if that was true, how is that different on the client side? If JavaScript code dynamically creates HTML markup then it also (at some level) stitches string together or does it not
Templating languages generate string that is returned through an endpoint. Just because it is string interpolation doesn't mean it cannot have loops.
Also, by using the phrase "string interpolation" I am actually pointing out the discrepancy between the generator and the generated.
> Huge news announcements! The client side code has to "PICK UP" the response which the server sends to the client! OMG!!! Thank god in a SPA the client code doesn't have to "pick up" server side generated objects, right? (NOT)
It is not response, you have to give unique id's or smart class names and then find those elements using document.getElementById and attach to it. Having a SPA helps reduce the number of named things.
> OMFG. client-server communication is not a paradigm for static documents. PDF is static documents.
It's not a paradigm, but client asking server for a response is more suited for documents when you are returning HTML.
- ngrilly 8y ago> you have to give unique id's or smart class names and then find those elements using document.getElementById and attach to it. Having a SPA helps reduce the number of named things. Agreed. It's my biggest gripe with traditional server-side rendered apps versus SPAs.
- mercer 8y agoI don't really get the issue with that. For heavily interactive stuff, sure, you might want to use an SPA and all that this entails. But that's something almost everyone here seems to agree on. But for almost everything less than that, and that probably covers the majority of use cases, you'll have a few dynamic elements on the page, and it's just a matter of ReactDOM.render() + document.getElementById() for the handful of those.