I learned “pure” JS back in 2013, when HTML5 was brand new, and I still don’t get most of the stuff going on nowadays.

  • SavvyWolf@pawb.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I stepped out of webdev like 5 years ago. Now every time I try to get back into things to work on an open source project or whatever I just give up because I do not understand things.

    Everything seems to be based on React which is some kind of magic templating library that does everything? And also dynamically updates thing in response to changes and talks to the server?

    I much prefer the days of just using vanilla js to manipulate a DOM and talk to a well defined API.

    • gornius@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      The thing is, they look like too much for a simple app with near none interactive elements.

      But once app starts growing, concepts like reusable components, reactivity and state management become such an important tool.

      Imagine tracking shopping cart’s total value. With these frameworks it’s just one store containing total value, exposing the value as reactive state. Once the value changes, all components using directly or indirectly that value update immediately. In vanilla you would have to keep track of every instance where that value is used manually.

      Additionally, if you decide keeping total value of cart in frontend is stupid (because it is), you just modify your store to provide only readonly value, and create setters that require you to pass item or item id. Then that setter would hit up backend keeping your cart’s total value, add an item, and backend would return new total, which would now be set as that store’s new total value.

      These frameworks are kind of SOLID principles applied to chaotic world of user interfaces.