by simonw · 1y ago · 0 comments
The joy came flooding back to me! It turns out browser APIs are really good now.
You don't even need jQuery to paper over the gaps any more - use document.querySelectorAll() and fetch() directly and see how much value you can build with a few dozen lines of code.
Sorry to hear your situation but I found there's hardly any point in debating with your team on moving towards simplicity - just better to keep your head down and take that paycheck every 2 weeks.
My goal is to build a microstartup with a small team - and for that I am definitely going to choose the traditional JQuery/HTMX/Turbo setup with a server that renders templates. To hell with React.
This leads me to question why people still use jQuery instead of native JavaScript. From my understanding, jQuery primarily serves as a polyfill. So why jQuery and not native Javascript?
Most cases because it is not worth the refactoring to remove jQuery and in a few cases when it is in new project is because the person coding doesn't know to code without it.
Not even a shared API management service — dedicated to the app!
It’s insanity.
All of these things except Next.js are over 10 years old now (Next is 8). What makes you think they'll be out of date next year?
In JavaScript, it is not. So you claiming 10 years as a time frame in your response is in bad faith, because you certainly know that code written 10 years ago is 100% incompatible with the modern versions of the same frameworks.
These are not stable targets, which means your code is out of date next year.
The bottom line is your choice of tools is also a social thing. Rejecting the mainstream tooling can be appreciated by some, confuse others, and sadly developers with lower self confidence might even see it as a form of insult.
Well, that’s all I needed to hear. What’s the point of not sounding old-fashioned when the new fashion is worse? Considering the social point, why not be more critical when the efficient and reasonable thing is derided by others as old-fashioned? Why not expect those people to update their world view?
Case in point: this site versus Reddit. HN is 100x snappier. Just a few lines of un-minified plain JS. Reddit crashes the browser on my iPad
Embrace the cascade - check out ITCSS methodology.
Fluid typography and spacing - https://utopia.fyi
However, the frontend build systems are often complex to do complex state management. Sure, it's possible to reimplement it all and accidentally end up rewriting your own vanilla JS frontend framework, but beyond a point, that's equally as unfun as modern webdev.
It's not hard to shift the state management though, and when I find myself sat with a nice architecture that's formed without a complex frontend system, and with some really simple, uncluttered backend that could probably serve millions of requests a day from a homeserver and internet connection.... it gives me a profound feeling. It's a satisfying and familiar feeling from webdev I enjoyed around 2 decades ago as a teen. It feels like the old way of doing it.
Now, having designed, built and run systems from on-prem, through VPS & VMs onto serverless and static site stuff, doing it the old way again just feels better overall. Maybe it's nostalgia.
But then I feel the reason why we moved away from doing it the old way was because the complexity of the applications needed more efficient ways to make use of relatively limited bandwidth, storage and compute resources at the time. Now these things are all commoditised, and my home desktop and internet connection now has probably the same capabilities as a small datacentre back then... the dreamer in me wants to believe there's no reason why we can't all go back to the old ways of doing it now.
Not sure I fully understand the second bit. Given how much more powerful servers are now (both physical and abstracted) doesn't that vertical scaling mean horizontal scaling is less necessary? If horizontal scaling is necessary, depending on where in the stack you're scaling, the global consistency offered by modern cloud data stores make it more efficient than ever for lots of servers to exchange a session cookie for state and return fully rendered HTML.
..but then they kept adding. And adding. And adding. And adding.. and now where are we? Death by a thousand cuts. 10x the complexity for an additional 7% benefit
I recall working on systems where the frontend and backend lacked clear separation, such as through an API layer, and there were no defined contracts outlining these boundaries between different teams or disciplines. This often led to significant challenges and disorganization, necessitating numerous compromises, not just in UX and UI.
Such issues typically arise in projects involving many people and disciplines. Fortunately, libraries like React and frameworks like Next.js have significantly reduced this chaos by facilitating the development of a decoupled frontend and backend.
This was 10 or 15 years ago. Now, with a decoupled front-end and middleware/backend, it's much easier to refactor or even replace services and features. Additionally, it's much easier to integrate new teams and technologies.
I agreed it makes it harder in places. Like when I (as a be dev) have to write JS hooks, or the JS dev's on the team have to interact with the database.
I find I'd rather code in a RESTfull code base than a socket system. I miss the lines.
Here's a random example: https://dev.to/ingosteinke/using-jsdoc-to-write-better-javas...
In the bad old days, there were a handful of canonical tutorials you used to learn the basics (HTML, CSS, JS) of web dev. Is there anything like that now that starts from those three technologies to build an understanding of web apps?
It seems like it could fill a real need for beginners who want to start by grasping the DNA of the web, so to speak, instead of the complex/sophisticated tools that are popular (not that there's anything wrong with that approach, if you need those skills for a job or project immediately).
This is a weak argument. These technologies can be used along with a database for state persistence to make literally any website in existence. That’s before even mentioning that those three things are how React et al. even work in the first place. What is a React component if not a logical collection of HTML, JS, and CSS?
Many big companies and startups blindly jump into the React/Vue/Angular stack, along with other complexities like Vite, Webpack, SSR, Zzzzzzzz... etc, where things are tied so loosely with 100s of dependencies and with a fragile underlying platform such as NPM. The output produced is only very marginally different from what could be achieved by the traditional MVC frameworks like Django/Rails/Phoenix etc. What do we lose here? a breathtaking amount of productivity and time. In addition, all the complex layers brought in place to make React FEs work with the backend such as GraphQL etc, also only increase the number of places you will have to maintain.
With SPA and all the modern snake oil like "serverless", engineers only will have to make changes at several places and implement some extra adapter logic, and spend a lot more time writing crap, than actually getting things out the door. With something as simple as JQuery which still holds its ground today, coupled with helper libraries like HTMX, Stimulus/Turbo, you can replicate 90% of the SPA experience, and ship things insanely fast, and maintain logic and state only on the backend. Your user only cares about seeing new features and existing features being easy to use. They don't give a fuck about whether you're using React or plain JavaScript or JQuery at the end of the day.
Absolutely! However, I believe users aren't the issue. Hiring managers, HR, etc. absolutely give a fuck about whether you're using React or plain JS.
I have a friend that is a recruiter for a moderately sized company. She said that when they were looking for a frontend developer, if one's resume listed Angular and not React, then your resume was instantly thrown away. Not even a second of consideration was given.
I am not sure how common that is within the industry as a whole, but it wouldn't surprise me if it's quite common. It's shit like this that makes me absolutely hate our industry. I love programming, but I am really beginning to hate doing it for an occupation.
I come from the old school way too. I still publish applications in 2025 with just plain HTML, CSS, JS, and .Net backend. Nothing fancy. However, I am feeling compelled to learn React (against my will) sheerly for job prospects. My users nor my employer would benefit from React, but I've been considering using it sheerly for 'Resume Drive Development.'
Small companies are great - but in the general job market, when you propose an idea that is not inline with the higher ups in the company, it quickly becomes a matter of ego and hate, even if it is the right idea.
I usually don't make a SPA though, only using it for specific parts (with their own entry file).
It is a similar sort of confusion that comes from people thinking React is a Web framework. It’s actually a small library.
I know it's an unpopular opinion (and the React people swear it's not true) but React is absolutely a framework, not a library!
Adding React to a project fundamentally changes how that project is architected, and affects almost all of the code written for that project going forward.
Trying to use it just as a library very much goes against the grain of how it is commonly used.
I didn’t say you would like it. I just said a build system is not required, contrary to what you wrote. JSX is not an integral part of React, and it is practical to omit it for small cases where interactivity is needed. Contrast it with things like Vue, Qwik, Astro, etc.
> I know it's an unpopular opinion (and the React people swear it's not true) but React is absolutely a framework, not a library
On the contrary, I think it is a very widespread opinion (most of this site will probably claim the same, and opposing comments are often downvoted), but that doesn’t make it less wrong. People form their opinion from encountering various instances of React use in the wild and common patterns of using React, not from what React actually is. Those instances or patterns will necessarily be mostly bad because the barrier of entry to Web development is very low and with LLMs the amount of that bad code only multiplies as of late.
> Adding React to a project fundamentally changes how that project is architected, and affects almost all of the code written for that project going forward.
By that logic, something like fp-ts or Effect is a framework, rather than a set of tools for functional TypeScript programming.
An important quality of a framework is that “you are building within its realm”. Consider Django. You have project scaffolding and structure, batteries are included, and the way you use it is strongly prescriptive or you are fighting the framework.
By contrast, like the above-mentioned Effect, React prescribes little and can be used in vastly different ways and applications not limited to Web. React itself does not even depend on there being DOM or browser context of any kind, I think last I checked it actually had no Web-specific code at all, though I don’t know if RSC changed that. All DOM-related stuff comes from ReactDOM, which is another library.
> Trying to use it just as a library very much goes against the grain of how it is commonly used.
First, if most people use it wrong[0], then just go against that grain. It will not go against React’s grain, because it has not much grain to speak of. It is a library with a few restrictions about what kind of callbacks you pass it.
Second, React is most commonly used through frameworks, like Next.js and such. There are also many instances of people using React via CRA project templates, which again are not part of React proper.
[0] …and using a library as if it was a framework is most definitely wrong. If your use case is of the framework-fitting scale, you should either A) use a framework or B) be conscious of the fact that you will end up with a framework of your own and plan accordingly (by default those frameworks tend to suck).
Instead, you can adopt 2025 standards, including Web Components, JavaScript and CSS modules, and modern JavaScript (ECMAScript 2022, also known as ES13, and even ES15). Additionally, CSS Level 3 features such as variables and container queries, along with WCAG 2.2 guidelines, are all widely supported by the latest browsers.
Web Components definitely have their thorns, as well as the shadow DOM. They're still a lot more capable than people give them credit for. Nested CSS has also been great, but I still reach for SCSS because nested CSS is still missing a few syntactical goodies. However, LLMs really bridge the gap and allow me to quickly write decent small web components without worrying too much about the internals.
For web components, I utilize Lit for its syntactic sugar and because I appreciate the decorator approach. Since browser compatibility is typically not an issue in these projects, I leverage native CSS 3 features and avoid using SCSS as a polyfill for nesting, variables, and maintaining DRY principles.
I haven't heard of Mithril before. Thanks for sharing!