3 ms·
Don't build your frontend in React at all, unless absolutely necessary. Look for simpler ways. Check if your website really needs to be a web app. Check if your
by zelphirkalt 4y ago
Don't build your frontend in React at all, unless absolutely necessary. Look for simpler ways. Check if your website really needs to be a web app. Check if your website actually has many interactive widgets. Even if interactive widgets are present, check, whether you could go with a simpler approach of serving static web pages and serving a frontend framework only on pages, where the interactive widgets are located. This will save loads of time for pages, where simple template rendering as offered by most traditional web frameworks in proper backend languages is sufficient. Then you can add interactive widgets later on.
- nigamanth 4y agoThis is very useful, I feel like people just want to use React for all the "coolness" of using React. People should just use React when their application requires react.
- moffkalast 4y agoAnd it only requires React when it's gonna be worked on by hundreds of constantly rotating people that need to find where's what quickly. Typically a large corporate setting.
- nigamanth 4y agoYeah, I don't have a problem with people learning React and maybe creating a project with that sole purpose, but creating a project that could be enhanced by using another library or just static HTML files will save time and resources, which in my opinion are the 2 most essential things in a programmer's life.
- jillesvangurp 4y agoIt's the classic hammer & nail situation. If react is all you know, every problem looks like it's a great fit for react. Replace react with just about anything else that was once popular and you'll find some programmers are out there still trying to wack nails with that hammer. Technically, react is already a bit conservative and maybe past its glory. I don't think it's actually that cool anymore. I've lived through a few hype cycles in technology and this one is starting to feel a bit stale. The whole community seems stuck in a "maybe this will work ... nope" loop where they keep on "fixing" statefulness of their apps, untangling the unholy mess of CSS from their business logic, fixing performance issues, etc. That's been going on for nearly a decade now. Of course the notion of using chat-gpt to "fix" state handling is a bit ludicrous. Sounds to me like a "maybe this will work?" type of thing. Chatgpt is the new hammer here. And it looks like there's a wide category of nails it can wack. The right ambition level is figuring out just how big those nails are. I'd say, a more valid question to ask would be if something like chat gpt could generate a complete working UI and backend given a few prompts. I don't care if it's done in react or angular or whatever. As long as it works and the AI can iterate on it.
- dysoco 4y agoI don't think React classifies as "cool" anymore, it's been in the game for many years and has become sort of de-facto for frontend development. Everyone does React because everyone else is already doing React; both from a developer who's trying to keep up to be more employable, and from a company who's deciding on a tech stack that's gonna facilitate hiring.
- mhfu 4y agoI like to use React for it's component system. Those components don't even have to be reusable, I just like working with them, it's way easier to separate and organize code and it makes me more productive when I have to find and change anything. I don't like huge html files. If I need static sites, things like Nextjs and Astro are great for that.
- zelphirkalt 4y agoWhere do huge HTML files come from? Using traditional templating engines does not at all mean, that you will have huge HTML files. Traditional templating engines like Jinja2 allow splitting up templates in very modular ways. Separate template files can be organized neatly into directories and subdirectories as well. Templates in general can reside in their own "templates" directory and do not need to be mingled with the code. It is very clear where to look to find things. The idea is, that you have modular statically rendered pages and then on some pages also serve a frontend framework for interactive components. I know that at least VueJS was able to be run like this. In the end, even with React or whatever other framework of its kind you use, you are still serving some HTML and some script tags, which may or may not include React, VueJS, or whatever else is the thing at the time. I am guessing, that React can work the same way that VueJS can, by simply including it on some rendered page templates, but I have not tried it.
- dymk 4y agoWhat does this comment have to do with the topic of the article?