• relevants@feddit.de
    link
    fedilink
    arrow-up
    9
    arrow-down
    2
    ·
    1 year 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
      3
      ·
      edit-2
      1 year 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.

    • Steeve@lemmy.ca
      link
      fedilink
      arrow-up
      3
      arrow-down
      2
      ·
      1 year ago

      There are plenty of Python libraries that are similar complexity to React, and not just for web development. Huge frameworks aren’t unique to JS, but depending on your background you can totally “learn” how to use them in two days, at least at a base level while you google how to do everything else (but let’s be honest, we’re doing that ten years in too lol).

      But my point was more that gatekeeping “learning” a new tool isn’t really a conversation you can win, because when do you actually consider it “learned”?

      • relevants@feddit.de
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        edit-2
        1 year ago

        How do you know what is similar in complexity to React? As far as I can tell you aren’t familiar with it.

        at least at a base level while you google how to do everything else

        Ah, there’s the problem. Your definition of learning doesn’t include having an appropriate mental model, which is key to actually retaining and internalizing the way it works. I don’t think it’s unreasonable to say that is a prerequisite for claiming to have “learned” something like a language or framework.

        • Steeve@lemmy.ca
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          1 year ago

          Your definition of learning doesn’t include having an appropriate mental model, which is key to actually retaining and internalizing the way it works.

          Glossing over the pretentiousness of your comment, this is not quantifiable. When do you consider someone’s “mental model” “appropriate”? You can form a mental model in two days, and that mental model can evolve. This is how learning works.

          • relevants@feddit.de
            link
            fedilink
            arrow-up
            4
            arrow-down
            1
            ·
            1 year ago

            Glossing over the pretentiousness of your comment

            And your stance of “I can learn x in two days, so how can people say it takes longer to learn y” isn’t pretentious?

            When do you consider someone’s “mental model” “appropriate”?

            “appropriate” isn’t a quantification of the mental model in itself, I am using the word as “having a mental model that is appropriate to the thing being learned”. A different mental model is required for React than working with vanilla JS and manipulating the DOM directly, so the mental model for one isn’t appropriate for the other.

            And yes, a mental model is quantifiable, to the extent that it accurately predicts what consequences design and implementation decisions may have on the behavior of the system.

            • Steeve@lemmy.ca
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              1 year ago

              And your stance of “I can learn x in two days, so how can people say it takes longer to learn y” isn’t pretentious?

              Yeah, I never once said anything close to that. I’m simply stating that considering something “learned” is subjective. Get this strawman shit out of here.

            • PreachHard@mander.xyz
              link
              fedilink
              arrow-up
              2
              arrow-down
              1
              ·
              edit-2
              1 year ago

              I have nearly a decades experience and react can definitely be learnt in a few days. I say maybe 5-6 on average if you dedicate yourself to it and have a good chunk of development experience already under your belt. My 18 year old apprentice had it mostly down by the end of an afternoon. Although he is exceptionally talented.

              • relevants@feddit.de
                link
                fedilink
                arrow-up
                2
                arrow-down
                1
                ·
                1 year ago

                I think there’s a pretty significant difference between a week and 2 days in terms of how much time you had to solidify your understanding.

                I also didn’t take that long to pick up the basics, but I could not say that I understood hooks within the first two days of working with React. There are just so many small details and limitations that can catch you by surprise if you don’t know why hooks work the way they do, same with the lifecycle of a component and what triggers a re-render. That does take a few days to fully understand in a way that you can utilize moving forward.

                It’s possible that I had a harder time because I was used to manipulating the DOM directly, and so managing all updates through state changes and being strongly discouraged from directly referencing UI elements felt very foreign to me. I don’t think that my stance would change if I had a different experience in the beginning though.

                • PreachHard@mander.xyz
                  link
                  fedilink
                  arrow-up
                  1
                  arrow-down
                  2
                  ·
                  1 year ago

                  Idk man, I lived and worked through all the changes to react and had a good amount of experience with state based programming before that. I definitely know several people who would laugh at the complexity of hooks and the react life-cycle. There’s some gotchas but nothing that’s out of this world.

                  So yeah I think it’s possible for a highly experienced developer to have React mostly down in two days. I just straight up disagree based on my experience. I suggested 5-6 for a reasonable average for someone with 5+ years of good experience in that general domain. My apprentice was mostly a python Dev too and he was better than my colleage of three years after a few days.

                  • relevants@feddit.de
                    link
                    fedilink
                    arrow-up
                    1
                    arrow-down
                    1
                    ·
                    1 year ago

                    How are you saying you “straight up disagree” and then you go on to agree with me that for someone without exceptional experience, 5-6 days is reasonable?