vunderba 11 hours ago

> 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?

  • mediumdeviation 8 hours ago

    Please for goodness sake just read React's docs.

    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.

    • iammrpayments 8 hours ago

      I find React docs really oversimplified and never tells you how it really works behind the scene to the point where it makes you feel like they are talking to a child, specially this section with all its illustrations: https://react.dev/learn/render-and-commit

      This kind of documentation makes it really hard to solve problems that will soon arise after you move past hello world.

      • andrewmcwatters 7 hours ago

        It's giving why the lucky stiff, but not in a good way.

  • 000ooo000 11 hours 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 10 hours ago

      Long-form slop. Mmm…

ar-nelson 9 hours 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 10 hours 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.

yashasolutions 8 hours ago

Honestly pretty good for AI generated content. It would benefit some extra human editing to fine tune the jokes and make it easier to flow but in itself it is pretty good and actually address some interesting point without being too serious about it, which is sometime refreshing.

bigstrat2003 8 hours ago

Dude, nobody wants to read a book of AI slop. If you aren't a good enough writer (or enough of a subject matter expert) to write a book yourself, then work at it, don't fake it by handing it off to an LLM. As it is, this doesn't just provide zero value, it provides negative value because it might mislead people into trusting it.

bgwalter 10 hours 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 9 hours ago

    I would define a new "Robinhood Commons" license for these cases then.

truetraveller 10 hours 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 8 hours ago

    This style of writing seems awful to me.

  • btown 10 hours 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/ .

  • DavidCanHelp 10 hours ago

    I actually captured the banter with Claude Code in https://github.com/cloudstreet-dev/React-is-Awful/blob/main/...

    • truetraveller 9 hours ago

      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 9 hours 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 8 hours ago

          If that's the only prompt, that's honestly incredible.

          • DavidCanHelp 8 hours ago

            Keep in mind the banter was a huge part of it, and this is claude code I was engaged with on the CLI.

claytongulick 11 hours 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 10 hours 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 10 hours 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 9 hours 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 9 hours 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 9 hours 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 10 hours ago

        > mediocre engineers often end up using it wrong

        Might be because mediocre engineers don't read the docs.

    • claytongulick 10 hours 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 10 hours 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.

        • gitaarik 8 hours ago

          That's why I wrote Lit State, a simple state management lib to use in combination with Lit, a simple web components lib. It works really simple, and it's simple to use. Much more intuitive than React.

          https://github.com/gitaarik/lit-state

  • ggregoire 10 hours 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.

    • iammrpayments 8 hours ago

      Completely opposite experience for me and when I used to write React I’d avoid useEffect like the devil.

  • kevmo314 11 hours 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 10 hours 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 11 hours 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 11 hours ago

    I feel like "other than the ecosystem" is doing quite a bit of work here.

    • claytongulick 10 hours 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 11 hours 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.

ptkanchi 10 hours ago

React has made me a millionaire, so I refuse to talk shit about it.

  • leeoniya 8 hours ago

    plenty of jQuery, WordPress, etc. millionaires out there :)