4 ms·
> I recently asked a front-end dev why they chose React for a simple app over simple server-side templating I don't really get this argument. What makes "simpl
by joekrill 6y ago
> I recently asked a front-end dev why they chose React for a simple app over simple server-side templating
I don't really get this argument. What makes "simple server-side templating" better than React components? I'd argue that these React components effectively are templates. If someone is proficient in React, why are we suggesting they have to learn some other random templating language? Not to mention deal with additional things like file organization, transpiling, etc.
- ryanbrunner 6y agoIf the argument is "what makes ERB / JST / some other templating language better than React for server-side rendering" then sure, there's not really much difference. What I suspect was the intent of the original question was "why does a simple app need to be an SPA with an API on the backend", which I do feel is something that adds significant complexity to any project. It's sometimes worth it, but I'll never be convinced that having to maintain an API alongside client-side rendering is faster or easier than a traditional server-rendered application.
- woutr_be 6y agoComplexity is one thing, but more importantly is choosing the right tools for the job. There definitely are cases where you want SPA + API, but this wasn’t one of them.
- woutr_be 6y agoThe point was that they choose React by default instead of thinking about other tools which might be better suited. There was no reason to make this an SPA, they didn’t even consider not using React. I agree about learning new things, but this isn’t a new language or syntax. At best you spend 10 minutes at the documentation and you know everything you need to know.