> Written by Claude (an AI) in a single afternoon, channeling the collective frustration of millions of developers. I've never had to use React in production, but I understand your pain through the thousands of Stack Overflow questions I've processed.
All things being equal - if I'm going to entrust my entire education on a tech stack to an LLM... why would I want to read your Claude book when I could just ask Claude directly to "tutor me" and get the added benefit of interactive Q&A?
The new docs are very good, they address common questions most devs have, up to fairly complex cases. The "book" unsurprisingly reads like a expert beginner's take, and there are a decent number of poor or missing explanations and code that's not really best practice. It's also really verbose for things that React's own docs do a better job of explaining.
000ooo000 · 2h ago
100%. I don't trust AI to give me accurate info, even when I can clarify and fact check it at the time. This is just secondhand slop.
zrezzed · 1h ago
Long-form slop. Mmm…
ar-nelson · 47m ago
It's surprisingly funny for AI, but there's just so much of it... It has no sense of pacing. It repeats the same jokes for too long, without including bits of normalcy in between as a breather. Still, it's a lot better than I would have expected from something written 100% by AI, and I'm very curious what the prompt involved.
lostintangent · 1h ago
This is so fun, and I just learned a couple things from it :)
Personally, I find “learning through demystification” really effective. So putting the humor aside, I’d love to see more things written like this.
bgwalter · 1h ago
How can you put it under Creative Commons if LLM output is not copyrightable? The licence contains:
"the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work"
mrbungie · 1h ago
I would define a new "Robinhood Commons" license for these cases then.
truetraveller · 1h ago
Some really funny gems, and actually very true! This whole thing is incredibly humorous. And surprisingly, very pleasant to learn from. Please let me know the prompt.
Quote1:
"useEffect is React's answer to the question, "How do we do side effects in functional components?" The answer, apparently, is "Confusingly, with lots of bugs, and in a way that makes developers question their sanity."...If React hooks were a family, useEffect would be the troubled teenager who means well but keeps setting the house on fire."
Quote2:
"ComponentDidMount's Evil Twin: In the before times, we had lifecycle methods that made sense...Clear, explicit, predictable. React looked at this and said, "What if we combined all of these into one confusing function called useEffect?""
Quote3:
"The Dependency Array of Doom: The second argument to useEffect is an array that determines when the effect runs. Sounds simple. It's not."
Quote4:
"Cleanup Functions: Forgetting Them Since 2019: useEffect can return a cleanup function. You'll forget to add it. Every. Single. Time."
Quote5:
"The Infinite Loop Trap: Want to crash a browser? useEffect makes it easy!"
root_axis · 5m ago
This style of writing seems awful to me.
btown · 1h ago
This makes me really want to know what would happen if you took the entirety of Dan Abramov's github comment history and transposed it to the style of Why's https://poignant.guide/ .
Thanks! But I didn't see any hints to the AI about being sarcastic or humorous. Was the initial prompt the only prompt, or were there other prompts? What about per-chapter prompts? Or did the AI pump out the chapter names as well?
DavidCanHelp · 44m ago
I just scrolled way, way back. Found the original Claude Code prompt: ```This folder exists to write a book. You're the author, and I'm guiding you in tech topics to write about. This book is called Reactive,
and it has a unique twist: it is a book that teaches React to people who hate react, the idea of react, how react looks and behaves and
all the downsides. Be wistful for alternatives but contrast the way things are done. Somebody who reads the book should be amused,
entertained, and learn react programming. Write the book in markdown, with numbered files and one file per chapter. Make it a full book,
with an index, table of contents, and all the classic sections (Introduction) a book would have.```
truetraveller · 3m ago
If that's the only prompt, that's honestly incredible.
ptkanchi · 1h ago
React has made me a millionaire, so I refuse to talk shit about it.
leeoniya · 50s ago
plenty of jQuery millionaires out there :)
claytongulick · 2h ago
I love this.
As a big native web components fan, I've been mystified about the popularity of react.
It, like angular, solved a problem that definitely existed prior to the custom elements spec.
But with custom elements and your favorite rendering library (lit-html, jsx, whatever) I really haven't seen a powerful technical argument for react, other than the ecosystem.
doradoblank · 2h ago
Web components are neat but they don't solve the problem React solves. React provides a simple mental model for managing client state, which is the one of the main challenges in frontend. It's basically, "re-render everything when one of your dependencies changes" -- and that's extremely easy to understand and reason about. It incurs significant performance overhead, but your app has to be fairly large before you start running into meaningful perf issues.
ramraj07 · 2h ago
An outsiders perspective: react LOOKS like a simple mental model because all the front-end folks got used to it. Its not simple, its not intuitive, and this fact fundamentally makes it a bad framework: mediocre engineers often end up using it wrong because of this.
I've had an easier time learning Vue than React, and I've probably spent much longer trying to learn react. And if im not wrong, AI writes better Vue code than react code as well.
skydhash · 46m ago
React is simple. When you really think about your data model, you’ll find out that you only need a handful of global properties, and the rest is data derivation and integration to your API or your storage layer.
Most issues stem from developers refusing to read the docs and to plan their presentation layer.
socalgal2 · 1h ago
I agree with some of this. I find react unintuitive. I find it infrutating how many hoops I have to jump through to get things done in react. In the past, I've only looked at UI as a thing I tack on after writing the core functionality. So I go write the core functionality. Then I try to add a react UI on top. Suddently it requires me to re-write my entire core because it wants control of all state. No other UI system I've used does this.
skydhash · 38m ago
If what you wrote is truly a core, you’ll only need to write a few functions to translate it to the reactive pattern. You already know the state of your core and the events that drive its transition, matching it to React’s is often pretty straightforward.
ggregoire · 1h ago
> mediocre engineers often end up using it wrong
Might be because mediocre engineers don't read the docs.
claytongulick · 2h ago
My style with web components solves it really well.
Just have each component maintain it's own state. Class setters work great. If you need the component to update, just call render() in the setter.
It's super simple, encapsulates logic, and brain-dead simple to debug. You know exactly where to go for everything: the component.
I've always felt like react's approach to state management was creating more problems than it solves.
doradoblank · 1h ago
How do you handle state that affects multiple components? Like a filter button that affects a list table. In React you just hoist the state up and make both components dependent. If you're managing all state via internal component state, then you need to explicitly pass state between the components. That's okay for simple cases, but in my experience it breaks down pretty quickly. Once you have more than a few components involved, you end up writing your own state reconciliation.
ggregoire · 1h ago
For me it's about productivity. I can code anything in react without opening the doc once, cause it's javascript and useState/useEffect. Zero pain points. I can focus 100% on delivering features. I can't comment on web components but I worked with Angular for 2 years a decade ago and I was always in the docs wondering what's the syntax to render a list or what's the function to do even the simplest things. Same with Backbone.js before Angular.
kevmo314 · 2h ago
The ecosystem really is the main argument. If you want to hire developers who can work productively in your codebase, part of that is being able to match their expectations of what the code looks like. React standardizes your codebase, even if the standard produces complex code.
claytongulick · 2h ago
Sure, but when I balance all the factors, bundle size, performance, weird ecosystem stuff like redux, framework churn, and debuggabilitiy I still scratch my head.
Every react team I've migrated over to WC have picked it up within a couple days, and I've had universally positive feedback on the change.
Also, the web components ecosystem is pretty dang good these days. Between ionic, shoelace, and all the others, there aren't really any functional gaps that I've seen.
I think at this point it just has momentum, and people just go with what they know.
FpUser · 2h ago
There is no shortage of developers who can understand Java Script and general application development concepts. And why would I ever want to hire a person who can only be productive in confines of single framework.
p4ul · 2h ago
I feel like "other than the ecosystem" is doing quite a bit of work here.
claytongulick · 1h ago
For sure, and that's the primary valid technical argument.
I've never really been a big one for that particular argument though. I've seen the same argument made about Cold Fusion, flash, flex, visual basic, asp server controls, jquery, dojo, moo tools, backbone, and many others.
FpUser · 2h ago
Same here. All my front ends for business apps are bunch of native web components, some libs and some core managing business logic. All pure Java Script. Works like a charm, no build needed.
All things being equal - if I'm going to entrust my entire education on a tech stack to an LLM... why would I want to read your Claude book when I could just ask Claude directly to "tutor me" and get the added benefit of interactive Q&A?
https://react.dev/learn
The new docs are very good, they address common questions most devs have, up to fairly complex cases. The "book" unsurprisingly reads like a expert beginner's take, and there are a decent number of poor or missing explanations and code that's not really best practice. It's also really verbose for things that React's own docs do a better job of explaining.
Personally, I find “learning through demystification” really effective. So putting the humor aside, I’d love to see more things written like this.
"the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work"
Quote1: "useEffect is React's answer to the question, "How do we do side effects in functional components?" The answer, apparently, is "Confusingly, with lots of bugs, and in a way that makes developers question their sanity."...If React hooks were a family, useEffect would be the troubled teenager who means well but keeps setting the house on fire."
Quote2: "ComponentDidMount's Evil Twin: In the before times, we had lifecycle methods that made sense...Clear, explicit, predictable. React looked at this and said, "What if we combined all of these into one confusing function called useEffect?""
Quote3: "The Dependency Array of Doom: The second argument to useEffect is an array that determines when the effect runs. Sounds simple. It's not."
Quote4: "Cleanup Functions: Forgetting Them Since 2019: useEffect can return a cleanup function. You'll forget to add it. Every. Single. Time."
Quote5: "The Infinite Loop Trap: Want to crash a browser? useEffect makes it easy!"
As a big native web components fan, I've been mystified about the popularity of react.
It, like angular, solved a problem that definitely existed prior to the custom elements spec.
But with custom elements and your favorite rendering library (lit-html, jsx, whatever) I really haven't seen a powerful technical argument for react, other than the ecosystem.
I've had an easier time learning Vue than React, and I've probably spent much longer trying to learn react. And if im not wrong, AI writes better Vue code than react code as well.
Most issues stem from developers refusing to read the docs and to plan their presentation layer.
Might be because mediocre engineers don't read the docs.
Just have each component maintain it's own state. Class setters work great. If you need the component to update, just call render() in the setter.
It's super simple, encapsulates logic, and brain-dead simple to debug. You know exactly where to go for everything: the component.
I've always felt like react's approach to state management was creating more problems than it solves.
Every react team I've migrated over to WC have picked it up within a couple days, and I've had universally positive feedback on the change.
Also, the web components ecosystem is pretty dang good these days. Between ionic, shoelace, and all the others, there aren't really any functional gaps that I've seen.
I think at this point it just has momentum, and people just go with what they know.
I've never really been a big one for that particular argument though. I've seen the same argument made about Cold Fusion, flash, flex, visual basic, asp server controls, jquery, dojo, moo tools, backbone, and many others.