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
You can pass data to top components from the child ones using the useContext. Use it only if you have data where you want to pass data from multiple child components to the parent one, if you just want to use from one component you are good with states.
Yes I’m aware, was just giving a suggestion. I even linked to its documentation where all that information is available.
To be fair couldn’t care less if Im voted down or not, if I could I’d have an option to just hide that vote bullshit it’s just visual garbage in the UI. Basically a remnant from centralised social networks from the web2 era.
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)
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.
Slap some buttons down and have them do math. I made an NPC generator for every RPG I ran in VB as a teen. I felt like I was a hero putting out something that looked “good” for the time.
About 20 developers on one repo in my case, we use a rebase merge strategy with fairly small feature branches so I think that helps keep merge conflicts down. Another thing is our codebase is LARGE, so changes don’t often conflict.
I see… No one cares here and everyone just merges randomly. We have about 20 people working on one repo as well but a lot of times it’s the changes to the same file 😭
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.
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.
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.
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.
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
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.
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
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.
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”.
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.
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.
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.
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?
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.
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.
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.
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.
Well, the whole managers who take client input is a bit of an iffy situation: you see, the whole think suffers from the “chinese wispers” problem (the longer the chain between those who require something and those who implement it, the more the message gets distorted and the implementation is off from the actual requirements).
So not only do companies whose core business is not Tech value more technical people who can talk directly to the business (it keeps the rate of misunderstandings smaller and improves need-to-solution turnaround), but even companies that sell IT services (i.e. consultancies) value more people who understand both the technical side and the client (which are the businesses the work for) side - for example an IT “consultant” from the likes of Accenture needs basically that kind of skillset, as well as some salesmanship.
The ones were that is really not valued at all are the B2C Tech companies (i.e. companies that make products for consumers).
My own experience doing software engineering for Investment Banks is that, at least in the IT area I worked in (mainly the “frontoffice”, which deals with things like providing trading solutions directly to business users such as traders), having both sides was very valuable and in fact frontoffice hiring managers prefer techies who “know the business” (it’s usually an absolute requirement for the more senior techie positions) and was the one that paid the most out of all IT areas in there.
Also don’t forget that the being self-directed is also very important: you might not see that because you’re in smallish companies were people have to wear many hats (i.e. do a bit of everything) and the only the ones who can “sort things out” survive, but in really large companies people are a lot more narrowly focused and when everybody does just a narrow set of things you’ll find a lot more the low initiative kind of programmer who won’t really do even the most basic of self-management and needs to be fed very precise tasks to execute rather than be given a problem and figuring out the rest. Many managers in there do value people who can basically be instructed to “solve this problem” rather than need to be constantly fed instructions.
I can understand the whole burning out if on a large project on your own - personally for me it’s a time thing: by the 2 years mark I start getting bored and looking for new challenges. Fortunatelly projects in bigger companies, because of having a lot more people, even though they’re huge compared to solo developer projects, tend to last around 2-3 years or less and actually most projects are of the “add/adjust functionality on an existing system” kind rather than the so-called “greenfield projects” (i.e. done from scratch) and those are more measured in weeks of a few months.
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.
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 …githubusercontent.com/…/117236177-33599100-adf6-… A diagram such as that is basically a shorthand to learning the mechanics of git, a sense-maker.
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”?
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.
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.
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.
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.
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.
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.
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?
You’re the one making the claim it’s not possible and I’m saying yes it is with good experience and talent since I’ve seen it. I’m not agreeing with you at all?
Please point me to where I said that then. Given that my stance is just that it’s not very plausible, I would be very interested to see where I supposedly claimed it wasn’t possible.
Now you’re just being a pedant. Why argue with me about the differenc between 6 days and 2 days? Why have this ludicrous accusation that the other guy definitely doesn’t have a good mental model of react and you definitely do? Your entire argument is hinged on calling out the guy for claiming he thinks react was pretty easy to pick up. Why are you arguing with me then when I’m saying it’s possible if your position is that it’s also possible too if not “plausible.” Although I really don’t take much weight in your assesment at this point. I tried to give my two cents on the scenario in which I see people pick up react quickly while you’re busy calling out this random dude for it not being plausible. Again, it’s pretentious. You’re not an authority, I have 4 times the experience with react professionally with 2yrs as technical manager and training react devs. I know wtf I’m talking about. There are plenty of people who can learn it in a week whilst you’re talking about [ok not years but suggesting that he won’t have it down and it takes longer to get a model] and a few I’ve seen do it quicker. I think you’re mixing up actual Dev experience with understanding a UI framework.
Where did I say it takes years? I literally said earlier in my response to your very first comment that I think 2 days vs a week can make a big difference in understanding.
Ok I’ve edited the singular mistake in reading you talking about 2 years and attaching that to your other point in your previous comment. Way to pick out the singular thing whilst ignoring every other point I made. I’m still saying two days is absolutely possible and achievable for a chunk of devs with experience. What the fuck are you even arguing against?
You turn around and shit all over the OP and call him pretentious for saying he learned it quick and accuse him of not really understanding react with literally no evidence. I’m saying you’re a giant egotistical prick for saying that.
And wtf is wrong with your reading comprehension? You’re literally missing the other half of my sentence, that yes a bunch do it in a week and I’ve trained people who do it quicker. That’s my entire fucking point that you can’t seem to acknowledge.
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.
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.
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
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.
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.
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.
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)
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)
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.
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.
Geeksforgeeks, I agree because of the paywall. I’m a beginner and I guess I don’t see the problem with W3Schools yet. What are better resources beyond the official documentation?
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.
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.
programmer_humor
Hot
This magazine is from a federated server and may be incomplete. Browse more on the original instance.