Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

At the risk of being ignorant/heretical: Why use this over "raw" templating (e.g. jinja2) at this point?


I’ve switched back to writing server-based code from writing React SPA. Text-based templates (I use jinja2) is my least favorite part of that.

It’s modeled after Django templates circa 2005, and that was designed with an idea that designers will write those templates, that they are not code.

I’m doing all this for 18 years, it was always programmers who wrote template code.

Why then we have such things as filters, in addition to functions? Untyped macros. Formatting template code is a struggle. Include tags are the worst.

The only thing I fear with regard to all these component libraries is performance. I actually wrote a PoC myself for such a library, but didn’t bring it to production quality.


My suggestion is to just try writing React for a week or two and experience the component based development. You never want to go back to templates again.


I've been writing react for years, and going back to templates, I wish I could never have to write a react rendering function again.

Components are overrated.

Their best feature is that they help build a fantastic ecosystem, which is the biggest react strength.

But for your own website?

Their cons and pros balance each other out, and all that is left is the terrible API that react exposes.

Eventually, you gain locally some reusability (provided you actually need it in your project, because there are not that many components that need reusability, and even less that couldn't be a template tag in django), but every single dev writes react code differently.

So you get a heterogeneous mess anyway.

My last SPA project (in vue), we had one component that was worth making reusable.

One. For a month and a half of work.

Turns out vanilla functions are quite reusable themselves already.


I love the idea of components. (been doing variations of it since 1999, starting with custom tags in ColdFusion) What I don't love is giving over to "full stack" development to gain the advantage of components (fortunately, there's options like server-side components, even when not using a JS-based framework, as well as partial-stack options like Inertia JS)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: