• relevants@feddit.de
    link
    fedilink
    arrow-up
    1
    ·
    11 months ago

    React, Vue, Solid, … are a lot more complex than your average JavaScript library, because they contain so many abstractions and basically require a separate “way of thinking” in addition to what you know from JS itself. There’s a separate state and UI model, hooks are a foreign concept at first, and component memoization and re-rendering takes some getting used to as well.

    Now, I only have two years of experience with React, but ten in JavaScript overall, and I will say that using React/JSX required the biggest “mental model shift” for me. That’s not to say that it’s difficult to work with or particularly hard to learn, but it takes time to understand and really internalize this language-within-a-language library.

    The way you’re asking that question seems to imply that because the API of some Python libraries can be learned in two days, the same must be possible for React, and that seems rather dismissive.

    • DrQuint@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      11 months ago

      This post got the issue exactly. To use either React or Vue, the first thing you (should) learn from them is about the render mechanisms, which are introduced under the concept of component lifecycles, which only exist because both render things using a Virtual DOM. This is NOT hard, not even close, but it’s also non-trivial and it’s not immediately learnable with just hands-on code experience. It’s also boring to go through it first, so “first thing” has a ton of quotation marks most of the ways you learn it. It’s the kind of stuff that explains why the code is the way it is, and it makes sense of the thing, but can be new and weird.

      I think a better way to relate to the issue is to ask people to recall how they learned git, specially those who tried to learn by doing. I’ve known SVN before I learned git, so when I had to sit down and actually understand it, some of the concepts were transferrable. But I’ve seen many, many people try to learn it and completely fumble to understand what the hell they were doing until they were presented with some visual representation such as https://user-images.githubusercontent.com/1256329/117236177-33599100-adf6-11eb-967c-5ef7898b55dc.png A diagram such as that is basically a shorthand to learning the mechanics of git, a sense-maker.