• Potatos_are_not_friends@lemmy.world
    link
    fedilink
    arrow-up
    98
    ·
    10 months ago

    I feel bad because while I don’t reach for react (I usually pick Vue or vanilla), people’s comments about react is really depressing.

    There’s a LOT of shitty react code. And when you see beautiful react implementation, it’s like a work of art.

    Unfortunately, react projects have been given to by bootcamps grads with 6 months of experience and it’s like the blind leading the blind…

    I wonder if it’s like PHP. Lots of people shit on it because they had to futz around in a garbage project written by garbage developers, fully unaware that it can be elegant in the hands of a professional team who cares about code quality.

    • tsonfeir@lemm.eeOP
      link
      fedilink
      arrow-up
      36
      ·
      10 months ago

      PHP is great for building APIs to use with React or Vue. I’m happy I have so much back end experience with both good and bad code.

      My motto: if a Junior dev can’t figure out what I’m doing after two weeks of training, I’ve failed.

    • killeronthecorner@lemmy.world
      link
      fedilink
      arrow-up
      27
      ·
      10 months ago

      I wonder if it’s like PHP. Lots of people shit on it because they had to futz around in a garbage project written by garbage developers, fully unaware that it can be elegant in the hands of a professional team who cares about code quality.

      You can apply this reasoning to any [web] technology. The reason it’s so visible for react, and previously PHP, is simply popularity.

    • sheogorath@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      10 months ago

      Yep, finding people who understand React is hard. The majority of people who say they’re an expert in React are either coding bootcamp fresh grads or someone who’s entrenched in writing shitty React so by having them join there’s basically no difference in skill with a fresh grade hire or a fourth year college student intern.

      • Osnapitsjoey@lemmy.one
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        10 months ago

        What’s wrong with bootcamps? Honest question, as I’ve been learning to code from a python book and an “expensive” udemi course that was on sale for 20 bucks

        I’d never tell people I know how to program though. I’m definitely still learning

        • sheogorath@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          10 months ago

          Sometimes, if all you know is how to use a hammer, everything will look like a nail.

          That’s the impression that I got from working with several bootcamp graduates. Most people who enroll are usually people who think that there’s a lot of money to be had being an SWE. However because usually bootcamps are 3-6 months max you’re just being taught how to use a specific tool to accomplish a general use case that’s already been solved many times. However, as an example in my workplace, we deal with a lot of R&D PoC projects and develop our own internal solutions due to security or law requirements from our clients. So if you’re stuck when working in one of our projects due to something, there’s no post related to that in StackOverflow.

          In one case, during development I found a bug in one of the third party libraries that we use and after creating an issue in their GitHub, even the library’s maintainer is stumped. We decided to create a new internal library that solves the specific problem we’re having.

          If you’re a bootcamp graduate working on that kind of project, it can be shocking.

          Having a college degree can help set up your mindset work in a software engineering project.

          Although it’s not necessary, because I’ve known a lot of great dev with no CS degree. But it’ll take a lot of time working in projects with a lot of different cases. Maybe it’s just that my workplace doesn’t really have a suitable kind of project for people with not a lot of experience. However lately we’ve hired a lot of fresh grads with good grades and it’s been a breeze when onboarding them to our engineering standards.

          We’ve had several hires from bootcamp but there’s only one who’s a good engineer.

          Take this with a grain of salt though, as lots of people can testify that they had a good experience with bootcamp grads. So maybe I’m the one who’s unlucky. YMMV.

          • Osnapitsjoey@lemmy.one
            link
            fedilink
            arrow-up
            1
            ·
            10 months ago

            Ah. See, I’m using bootcamps as a intro type of learning. I’ve also been just doing my own thing by learning how to make scrapers and all that (even though that’s kind of cheating because it’s just scrapy) but I’m trying to learn the fundamentals of the language so that I don’t need to just Google “how to do this” I want to be able to just do it

        • ramjambamalam@lemmy.ca
          link
          fedilink
          arrow-up
          1
          ·
          10 months ago

          Not necessarily “wrong” but a weakness is that they tend to focus on concrete language syntax and skimp on abstract software design, and data structures and algorithms. The result is a programmer who knows how to write code, but may struggle on larger projects or more complicated problems, compared to a computer science or software engineering graduate.

          Of course I’ve met developers from applied courses and boot camps who are driven, passionate, and gifted who have gone on to make excellent system designers and software architects, but generally speaking, knowing how to code alone does not make one a software developer.

    • DrQuint@lemm.ee
      link
      fedilink
      arrow-up
      8
      ·
      10 months ago

      The problem with some of the comments here is that even “properly” written React CAN hit a performance bump, and optimization is a rather rare skill no matter the programming context (kinda due to little time given to it, so everyone is out of practice).

      But I don’t know which ones are the ones talking about that, and which ones are just people annoyed at anything Node in general.

    • kameecoding@lemmy.world
      link
      fedilink
      arrow-up
      9
      arrow-down
      2
      ·
      10 months ago

      I find react stupid because of JSX, Vue is much cleaner easier.

      ofc you can create a mess with any tool or framework

    • AtHeartEngineer@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 months ago

      If you like vue, try svelte(kit). Not that it’s better, but another tool in your toolbox. Svelte stores are pretty nice.

  • bitsplease@lemmy.ml
    link
    fedilink
    arrow-up
    65
    ·
    10 months ago

    Tbf, “learned a language” is a hard thing to pin down in any case.

    I’ve been building enterprise software with python for almost a decade now. I still occasionally find stuff in the stdlibs that I didn’t know about, or even sometimes some subtle feature of the language that I never had reason to explore until now.

    If someone asks me if I “learned” python, id say hell yeah - but there’s always still plenty to learn

    That being said, no reasonable definition of learned includes what you could do in 2 days, even as an experienced dev lol

    • tsonfeir@lemm.eeOP
      link
      fedilink
      arrow-up
      18
      ·
      10 months ago

      Exactly. I’m 20 years in and I’m still like “I had no idea this was a feature… cool!”

      • phorq@lemmy.ml
        link
        fedilink
        arrow-up
        19
        ·
        10 months ago

        “cool”: that sinking feeling that there’s so much you could go back and optimize, but that you probably will never have the time to…

    • Aceticon@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      10 months ago

      It’ basically the Dunning-Krugger curve - you’re well enough into the last part of it so you are well aware of how much there is to learn about it and how you will never know all of it, thus you don’t have and never will have the same kind of cocksure belief that “I know this shit” as somebody who knows just a bit but not yet enough to understand how much there is to know.

      It’s all perfectly normal, IMHO.

        • Aceticon@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          10 months ago

          More precisely, the more you learn the more you are aware of all you have yet to learn.

          You do know more after you’ve learned something, but that also includes the realisation it’s but a drop in an ocean of things still tomlearn.

    • jarfil@beehaw.org
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      edit-2
      10 months ago

      Define “reasonable”…

      Something like 20 years ago, I learned PHP in 2 days… meaning, I could write better PHP than anyone else on the team.

      (not to diss on the team, one was a Java guy who left shortly afterwards, the others were a couple interns, while I had the power of something like 10 years of coding experience… and a PHP cheatsheet-booklet)

      • bitsplease@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        10 months ago

        That sounds less like you learned the language to a high standard, and more that you were already a good programmer in general terms and everyone else on your team barely knew what they were doing.

        Ultimately if you can write good code in one language, you can probably also do it in another (especially with access to cheat sheets), but I still wouldn’t call using a cheat sheet having “learned” a language.

        Of course it’s all relative and subjective - which is the whole point , one person may consider just being able to write syntactically correct statements as having “learned” a language. Where others might expect a deep knowledge of the language features, standard libraries, and best design practices (this is the side that I personally lean, which I maintain can’t be done in 2 days)

    • jecxjo@midwest.social
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      10
      ·
      10 months ago

      To be fair, i did cover the Fortran 95 spec in a weekend, but i was motivated to tutor aerospace engineerings as there were far more females there than in Electrical Engineering and Computer Science.

      • floofloof@lemmy.ca
        link
        fedilink
        English
        arrow-up
        7
        ·
        10 months ago

        The point is that learning a spec is not learning how to program in the language, just as learning how a violin works is not learning to play the violin. And writing your first few programs is like learning to play Twinkle Twinkle Little Star and The Happy Farmer on the violin. You’ve kind of learned the violin, but you’re not getting into any professional orchestras.

        • jecxjo@midwest.social
          link
          fedilink
          English
          arrow-up
          3
          arrow-down
          1
          ·
          10 months ago

          Oh i know, was joking mostly. At that point i had half a dozen languages under my belt and for tutoring purposes i was good to go.

  • RGB3x3@lemmy.world
    link
    fedilink
    arrow-up
    62
    ·
    10 months ago

    React definition: React (also known as React.js or ReactJS) is a free and open-source front-end JavaScript library for building user interfaces based on components.

    Guys, I’ve learned React in 1 minute!

  • Ullallulloo@civilloquy.com
    link
    fedilink
    arrow-up
    34
    ·
    edit-2
    10 months ago
    import React from 'react';
    import ReactDOM from 'react-dom';
    
    ReactDOM.render(
    	<div>
    		<h1>My Site</h1>
    		<p>Welcome to my cool site. 😎</p>
    	</div>,
    	document.getElementById('root')
    );
    

    Me too. I’ll take my salary now, please.

    Edit: Lemmy stripped out my rickroll. :(

    • WackyTabbacy42069@reddthat.com
      link
      fedilink
      arrow-up
      10
      arrow-down
      1
      ·
      10 months ago

      Sucks that your rick roll got taken from you. I understand how hard it must feel, so please know that I’m never gonna give you up, never gonna let you down, never gonna run around and desert you

  • Steeve@lemmy.ca
    link
    fedilink
    arrow-up
    28
    arrow-down
    6
    ·
    edit-2
    10 months ago

    React is a library, when do you consider a library “learned”? If they already knew JavaScript why couldn’t they “learn” React in two days?

    I’ve been using Python regularly for a decade and I’m continuously using new libraries and learning new things, I can’t think of when I would have considered Python “learned”.

    • tsonfeir@lemm.eeOP
      link
      fedilink
      arrow-up
      31
      ·
      10 months ago

      “Learned” means you can make code for production that other people won’t go “wtf are they doing, this isn’t how react works”

      • Steeve@lemmy.ca
        link
        fedilink
        arrow-up
        22
        arrow-down
        1
        ·
        edit-2
        10 months ago

        That’s just how we look at eachothers’ code, and even our own code that we forgot we wrote lol.

        • Zikeji@programming.dev
          link
          fedilink
          English
          arrow-up
          8
          ·
          10 months ago

          Whenever I have to dredge up an old project to make a change or just to check something, I’m hit with the temptation to rewrite the entire thing. I’m constantly learning, and I subscribe to the notion that there are endless ways to do something and none of them are right. Hell, I’ve brought 3 fairly large Vue projects to term and all of them were done the “right way” at the time, but completely differently. There’s what, 3 different approaches in Typescript for components?

          • Aceticon@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            10 months ago

            Being faced with maintaining your own code in Production months after moving on and after having forgot about its structure is one of the best learning experiences for a programmer, IMHO.

            It’s a great way to learn at an emotional level (through self-inflicted pain and suffering ;) the real point of a lot of good practices that previously looked like “a waste of time” and design principles that before “made no sense”.

            Personally that’s one of my requirements when hiring technical types above Junior level.

            • Zikeji@programming.dev
              link
              fedilink
              English
              arrow-up
              1
              ·
              10 months ago

              I’ve rarely actually had much trouble coming back to a project I started / played a large role in after a few months (or even years). I’ve experienced what you describe on other projects though, especially if they’re way outside my field of expertise.

              Somewhat off topic, I’m searching for a new job soon - are there any good guides or information on design practices you’d recommend? I’m self taught with no college education, and a majority of the work I’ve done has been for SMBs on (mostly) solo projects where I determine the direction to take. I like the flexibility of working for SMBs, however there are a lot of cons as well. I sometimes worry I’m shooting myself in the foot listing just under a decade of experience, but none of it “junior level on a team” where I’d pick up some of those skills.

              • Aceticon@lemmy.world
                link
                fedilink
                arrow-up
                4
                ·
                edit-2
                10 months ago

                Working directly with “the business” (such as end users in an SMB) is actually a highly valuable skill for a programmer, because ultimatelly we’re paid to make the software to be used by normal users as part of their business and people who combine programming skills with (proven, genuine) experience in working directly with users and stakeholders in the business side delivering software for their needs, are quite rare.

                This is especially valuable in any large company whose core business is not Tech but makes heavy used of Technology and has custom systems serving their business side, such as, for example, investment banks - the user and business oriented programming areas (not just frontend but basically anything that’s tightly coupled to the nature of the business of the company) value “understanding the business” and “figuring out the software that needs to be done to serve user and the business needs” as much or more than technical proeficiency.

                (It’s all nice and neat to, say, be a “guru” who came up with his or own programming language, but actual companies whose actual business needs have nothing to do with programming languages, couldn’t care less, though such techie “chops” definitelly impress young and naive techies)

                I don’t think “junior level on a team” matters if you have almost a decade experience - in my experience by that point nobody gives a rat’s arse about what you did as a junior unless it’s something you’ve never done since and are trying to leverage in an interview - but having done projects professionally as part of a team does matter a lot, because big projects can’t be done solo in a reasonable amount of time and hiring manager do want people who have proven they can work well as part of a team. Only way I can see to make up for this if you don’t have it is to participate in larger Open Source projects.

                Also being self-directed and capable of working without lots of supervision is highly valued: somebody whose input is “there’s this (non-techie) thing we need solving” and whose output is the implementation of the solution is worth his or her weight in gold, not just in the kind of small company which can’t afford dedicated technical managers (to go around supervising the less self-directed kind of dev) but also in larger companies as it saves lots of time and problems all around when a programer can just take ownership of figuring out the details of the problem and delivering the solution.

                Maybe you might’ve been ignoring some of your greatest strengths by looking only at the technical side of your experience.

                • Zikeji@programming.dev
                  link
                  fedilink
                  English
                  arrow-up
                  2
                  ·
                  10 months ago

                  Wow, thanks - your response offers quite a bit of fresh perspectives and insight I hadn’t considered. Yes, my main pain point was my ability to work on a team - I have done so but not at scale and mostly in the micro-managing kind of way. But I’ve been letting that impact my motivation by a good deal.

                  I also hadn’t realized being able to convert layman input into usable output was a valuable skill for larger companies, assuming they’d have project managers to handle that. I wonder how difficult it would be to take on a more managerial role - that has been another pain point, I find I get burnt out on large projects fairly fast, but that’s usually me doing all of the heavy lifting.

                  Thanks for the feedback, I appreciate it. I think I’ll try and revise my resume some and start looking with some fresh perspective.

    • jecxjo@midwest.social
      link
      fedilink
      English
      arrow-up
      13
      arrow-down
      1
      ·
      10 months ago

      Because anyone worth their salt knows that the superficial hello world example covers the tip of the iceberg. So to say you learned it in two days means you either don’t get that you barely scratched the surface or you dont get what other developers really need when they hire someone with knowledge in a specific framework.

        • tsonfeir@lemm.eeOP
          link
          fedilink
          arrow-up
          4
          arrow-down
          1
          ·
          10 months ago

          You mean print “hello world”; doesn’t work in JavaScript? Well whatever, I bought the book I can put it on my resume right?

        • jecxjo@midwest.social
          link
          fedilink
          English
          arrow-up
          1
          ·
          10 months ago

          I’m saying that the work they would be doing in two days isn’t the same as solving an actual problem. The way to really learn a language/framework/library is to actually use it in a real project. You run into pitfalls, you get compile errors and have to figure out how to debug in said tech, you find out how extentions to the tech work so you can create your own. Making a Todo Front End isn’t going to cover the vast majority of the stuff I’d expect one to know or experience when you say you “know” a language/framework/library/etc.

          • Steeve@lemmy.ca
            link
            fedilink
            arrow-up
            1
            ·
            10 months ago

            If you have to run a real world project before you can consider a tool “learned” none of us would have jobs lol

            • jecxjo@midwest.social
              link
              fedilink
              English
              arrow-up
              1
              ·
              10 months ago

              You don’t have to actually do a real project. It’s more about doing a task that requires you to create outside the hand holding.

              After 15 years of OS and embedded systems development I learned web dev by creating a SaaS for my HOA’s property manager to communicate with tenants. Node, React, MongoDB, docker, iOS and Android apps. Did the project look good? Nope. Did I have to dig into manuals and debug for weeks, yep. But I easily stepped into a new role in an industry I had never worked in because I really learned the tech stack. Actually using the app wasn’t necessary, just that I actually had to create things requiring me to design around the technology I was learning.

              Pick a problem in your life and solve it. Doesn’t need to become something you sell or publish or even use after you’re done learning. But the point is to actually use your skills.

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

      • Steeve@lemmy.ca
        link
        fedilink
        arrow-up
        3
        arrow-down
        2
        ·
        10 months 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
          10 months 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
            ·
            10 months 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
              ·
              10 months 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
                10 months 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
                10 months 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
                  ·
                  10 months 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.

    • 30p87@feddit.de
      link
      fedilink
      arrow-up
      1
      ·
      10 months ago

      Like programming languages, it depends on the context. “Learned” in a casual conversation would mean that one can write programs/libraries and achieve what they want in that language. “Learned” in a more professional manner, like a resume, would mean you can write good, maintainable code and know much of the language underlying stuff and other tools. But practically, in my experience, on a job, knowing a language/library means being better than or equal to your boss if they’re a dev.

      The boss of my father, for example, is gonna challenge you with his knowledge until you agree you’re wrong, if you claim you “know” something. To him, “knowing” would mean you read the docs, source code and used it for many years, so actually know all quirks known to mankind of that language/library. Which isn’t really humanly possible.

      • Steeve@lemmy.ca
        link
        fedilink
        arrow-up
        3
        ·
        10 months ago

        Hard disagree on “learned” for the resume. As long as you know enough to get you through the interview you can learn the rest on the job!

  • Notnotmike@beehaw.org
    link
    fedilink
    arrow-up
    18
    arrow-down
    1
    ·
    10 months ago

    Probably the hardest part of React, for me, was getting used to the callbacks. Passing data up to the parent component using a function. It’s a little difficult to get used to if you haven’t encountered it already

    • tsonfeir@lemm.eeOP
      link
      fedilink
      arrow-up
      10
      ·
      10 months ago

      Just shove it in the state! I watched a few react videos over the last TWO WHOLE DAYS, it works!! ;$

    • frezik@midwest.social
      link
      fedilink
      arrow-up
      2
      ·
      10 months ago

      I had gone through Structure and Interpretation of Computer Programming before, and feel like that gave me all the foundational stuff I needed to understand what React is doing. The new third edition is in JavaScript, and while I haven’t read it, I imagine that would be an even better match.

      • zorlan
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        10 months ago

        I think you’re being down voted because context should be used sparingly. You can pass data back up the parent chain through prop functions.

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

        If there’s a parent component that has some data that it expects to always receive from its children, then that data should be in the parent’s state and the children should receive it and maybe some relevant methods as props. Even if it’s an unknown number of children. Don’t muck with useContext for basic inheritance stuff, you’ll mess with the render cycle for no good reason.

        Now, if we’re talking about a very distant “top” component, that’s fine, it’s what it was made for. Although many people end up using stores if it’s some data with broad impact (like user data)

  • ______@lemm.ee
    link
    fedilink
    arrow-up
    13
    arrow-down
    1
    ·
    10 months ago

    I learned about how much I didn’t understand react on my 2nd dev job. I had like 2yoe with react previously. There’s a lot about it. Mostly tricks. hacks and work arounds for it’s abysmal performance.

      • ______@lemm.ee
        link
        fedilink
        arrow-up
        8
        ·
        10 months ago

        There many ways of doing things in react and some are faster than others. I would abuse state and use effect at my old job but at this job my sr dev doesn’t allow me to use useffect unless the situation warrants it.

        • tsonfeir@lemm.eeOP
          link
          fedilink
          arrow-up
          3
          ·
          10 months ago

          Ahh yes, abusing state can be temping. Just a little tweak here, it’s ok… no one is looking… oh crap!

          • TitanLaGrange@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            edit-2
            10 months ago

            I’m relatively new to React (about 8 months in with React Native). Can you give me some examples of abusing state?

    • Potatos_are_not_friends@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      10 months ago

      I’m not at all a React fan, and prefer vanilla or Vue.

      But what is happening where you’re hitting abysmal performance?

      Are you blaming the implementation or the tools because while I can achieve faster performance with vanilla… In no way is abysmal a word I’d used.

  • jarfil@beehaw.org
    link
    fedilink
    arrow-up
    11
    ·
    10 months ago

    Bah, 2 whole days? I learned React in 1 day!.. then another, and another, and then I got a book, and a few years later… I learned how to fix whatever ChatGPT spits out in React in 2 days!

    • tsonfeir@lemm.eeOP
      link
      fedilink
      arrow-up
      20
      ·
      10 months ago

      This person also lectured me on using AI to write code. Saying it was better than a human (in 2023), and that it made him senior level. They practically mocked me when I told them ChatGPT was pretty bad at coding.

          • jarfil@beehaw.org
            link
            fedilink
            arrow-up
            3
            arrow-down
            1
            ·
            10 months ago

            Hey, I used to be a “Full Stack Developer”… then I took an arro… went part blind, had a couple heart attacks, got burned out… and still learned how to fix the ChatGPT stuff in 2 days! 😄

            …and am currently on disability 😬

      • Hazzia@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        10 months ago

        I’d say something about them being the type of person to think that just because the car’s running it means the engineering is top-tier, but then again I’d be surprised if he actually bothered really testing the code before saying that shit.

        Either way, they sound like a genius and like one day they’re going to become the CTO of a hot new startup that will eventually replace Amazon on the Big Tech leaderboard.

  • Auzy@beehaw.org
    link
    fedilink
    arrow-up
    11
    arrow-down
    1
    ·
    10 months ago

    I thought I learned it… Then I got screwed for ages until I worked out how UseEffect worked.

    To be clear though, I still suck, and am probably doing a lot wrong

    • tsonfeir@lemm.eeOP
      link
      fedilink
      arrow-up
      7
      ·
      10 months ago

      That’s the true spirit of development. I’m probably still doing it wrong, but it functions most of the time and no one seems to notice my bugs! Paycheck!!

        • aksdb@feddit.de
          link
          fedilink
          arrow-up
          1
          ·
          10 months ago

          In a recent post mortem we notified customers of a bug we found and mentioned how long that was in production (since it could have affected their data).

          One of them asked us, why there was such a long “delay” (their word) until we found and fixed it…

        • T (they/she)@beehaw.org
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          10 months ago

          I always use MDN if I need to check anything JS related. For React, I don’t see why use anything else other than the official documentation. If you’re learning I’d suggest Full Stack Open or even Odin Project which are courses that at least bother to explain a little of best practices.

        • DNAmaster10@lemmy.sdf.org
          link
          fedilink
          arrow-up
          2
          ·
          10 months ago

          Generally I’m not against w3 schools for quickly checking the syntax of something or how to use a specific method, but I always try stay clear of their larger code examples.

          I was learning PHP a couple years back for some hobby side projects I was working on. They provide some code here about how to connect to an SQL database. I ended up using this code for almost a year on some publicly hosted sites.

          The code they provided isn’t secure, though. It can output database errors to the client, and give away information about your database which a random user shouldn’t have access to.

          Additionally, the beginning few pages for their SQL insertion examples doesn’t mention anywhere that you should be using prepared statements. There is a page slightly further down, but for the average person learning the language, there’s no reason for them not to just copy parts the extremely insecure code and use it in their projects.

          W3 schools imo is great for quickly checking up on something, but generally it’s probably better to avoid their examples and look up the language standards somewhere else.