Hacker News new | ask | show | jobs
by samwillis 1099 days ago
JS frameworks are like coffee, some people like them milky and full of sugar, some people like them like them lean and black, some are obsessed with making the "worlds best coffee" at home every morning, and some drink whatever brown water comes out of a vending machine.

We all like our coffee different, just as we all have favourite features and designs of frameworks. There is no correct, or best, framework, only personal preference and what's good enough for the job in hand.

Svelte is a Flat White with locally roasted coffee beans from an independent coffee shop.

React is a Starbucks Vanilla Late.

Vue is a Starbucks Caramel Machiato.

Angular is the Vanilla Late from your staff canteen, it used to be a bit rough, but seems to be better in recent years.

Not using a framework, is carefully weighing out the "correct amount" of beans, grinding them by hand, tampering it with the "correct force", and then making the "perfect" espresso.

5 comments

Big disagree on the not using a framework part: far too often that's not so much a lovingly honed craft but an echo of the "websites should work just fine without JavaScript" that has long been given up as a goal but still haunts decisionmaking as an ideal that now serves as an excuse to consider everything client side secondary citizen. "It's JavaScript, right? It's supposed to an unmaintainable mess." If you dig deeper you will often hear something like "And anyways, jquery 3 is still the latest major release so this is definitely state of the art"
It's definitely not a perfect metaphor but I enjoy working with vanilla JS or without a framework and I think it's very different from "no JS" (I mean... seems obvious given that it's JS).

You can technically do anything a framework does in your own JS, since they're all just opinionated JS libraries. You can make your own SPA or implement your own VDOM or SSG but it might take a long time and not be as battle tested. On the other hand you're also free to make your own optimizations that might work well for your needs without worrying about a huge framework.

People can lovingly craft really bad coffee, just as much as good. To them it may be exactly what they want, and that's all that matters.
I'm not saying that there's no good handcrafted bare browser code out there, and I guess some of the bad wasn't made without love at all. But I've just seen too much of the stuff that seems like it's still standing with half a leg in the age of internet explorer vs netscape, and that was perhaps crafted laboriously but certainly with more contempt than love to consider the loved stuff mow than a rare exception. I guess part of my gut reasoning goes like this: chances are the loved ones have been modernised three times over, while the contemptful implementations live on.

But I can't come up with any coffee analogy for that, there's just no mapping between those spaces that makes any sense.

Netscapé was the original distributor of industrial strength Java.
Alpine.js is instant coffee that's surprisingly decent?

Disclaimer: I <3 alpine.js

react is that dirt tasting coffee you get at the diner that everyone loves
Thank you ChatGPT
As someone dyslexic I'm not sure how I feel being compared to ChatGPT... it has better grammar and spelling then me...
I was curious how ChatGPT would actually compare these frameworks to each other in coffee metaphors, so here you go:

- Vue is like a latte. It's smooth, easy to drink, and has a nice balance of sweetness and bitterness. It's also very popular and widely available. Vue is a progressive, incrementally-adoptable JavaScript framework for building UI on the web. It has a good and intuitive documentation, a large community, and a simple syntax. Vue is also performant and fast, and supports component-based development.

- React is like an espresso. It's strong, concentrated, and gives you a lot of energy. It's also the most searched and used framework among the four. React is a JavaScript library for building user interfaces. It has a large community, a lot of resources, and a high performance. React also uses JSX, which is a syntax extension that allows you to write HTML in JavaScript.

- Angular is like a cappuccino. It's rich, creamy, and has a lot of foam on top. It's also very complex and requires a lot of skills to make and enjoy. Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. It has a fast server performance, an MVC architecture implementation, and a good documentation. Angular also has a steep learning curve and is very complex.

- Svelte is like a cold brew. It's refreshing, smooth, and has no bitterness. It's also relatively new and innovative in the coffee world. Svelte is a new way to build web applications. It's a compiler that takes your declarative components and converts them into efficient JavaScript that surgically updates the DOM. It has no virtual DOM, no frameworks on top of frameworks, and no framework at runtime. Svelte is also truly reactive, easy to learn and use, and supports component-based development.