I have been working with React for a couple of years now and I have seen stupid practices that developers do while working on a React App. In this article, I will list some of these stupid stereotypes and try to explain why they are wrong.
Without wasting time lets start judging😋
The one that knows React but not JavaScript:
- Sometimes people ignore learning JS and rush into React.
- Remember💡, React is a JS library and you have to make sure you are thorough with it. One step at a time does help.
- I would recommend learning these JS concepts and some DOM APIs mentioned in this comprehensive list.
The one who Uses JQuery with React:
- I have seen a bunch of people using JQuery along with React for DOM manipulations😑.
- It's just pointless, React's main goal is to handle all the DOM changes.
- All you have to do is update the state, render the VDOM and React will take care of all the DOM changes.
- If you used JQuery and React together, then you should expect some bugs that are hard to debug🙈 as both libraries might update DOM elements at the same time.
- Still, If you'd like to continue using JQuery here's a guide integrating it the right way.
The one who complains that React Apps lag
- React technically is blazing fast, but everything can become slow if implemented the wrong way😏.
- Think of it, React takes care of all the DOM manipulations. To achieve it, it needs to compare the whole DOM tree and update it, which is a very tedious task🥴.
- The more the number of DOM elements in your App, the slower the APP will be.
- Team React has been doing their part of keeping React performant as possible. React Fiber was a major change!.
- But as a developer you have to do your part right, here's a guide to optimize application performance. 'Avoiding Reconciliation' is one of my favorites🤩.
Mr. LibOverflow😷
- These are the guys that just try to get around writing code
- They will use tonnes of component libraries just to get their task done.
- Adding too many packages to your app can increase the overall build size.
- You should keep track of the build size, or else the initial app loading would be slow🐢.
- Webpack bundle analyzer should help you analyze which package you should be ripping off.
- Also external packages are like Magic in your code. Nobody reads how they are working.
- At times they might blow up and you might not understand what happened, KEEP THE MAGIC TO MINUMUM, KNOW YOUR CODE!🤓
The one that thinks Redux is must
- You need to understand that React is a View Library💡.
- How you manage your state is none of its concern.
- I don't suggest Redux to beginners, as the learning curve gets steep.
- There are tonnes of other state management solutions out there, each with their pros and cons.
- Or you can just simply use React hooks and context.
- If you are using GraphQL, I would suggest Apollo. I liked their caching algorithm.
Thank you for reading, I hope you liked this post😄. I'd love to hear your thoughts on this, so please feel free to comment!
Top comments (38)
Thanks for the article.
Just one small inconsistency. In last group of point you say:
and
So in one you are stating that React doesn't care and in second that you have build in tools for that.
React was a lib, and React was dedicated only for the view part. Was, not is, now React is a framework, because you can do fully flavored app only using it (lack of routing is not a point against this statement). Also React has own state management tools, and even React team constantly is saying you should use them, and also constantly saying some critic words about Redux and Mobx.
For other points, React is kinda DSL, so learning only it creates DSL programmers, this means that such kind of developer has problems with understanding the language below React - JS, it can have very bad implications. Like not optimal, or just copy/pasted code. Learning JS should be a rule here.
For using React with JQuery, this is a violation of every principle of React. As React is a way to achieve declarative UI. Where data flow is top-down, and DOM is representing the data. JQuery exactly targets DOM and manipulate it directly, so React loose ability to be declarative too, as JQuery plays a role of Trojan horse.
Thanks for the comment!
I do agree things are seem a bit contradictory for state handling.
It might also seem like React has became more like a framework. But i'd also like point out the fact that, React doesn't forces you to use its state management tools (like a framework might do). I mean it's there, you can use it, but you are still open to try better solutions.
Can't agree anymore
This is a highly inappropriate statement.
I encourage you to do some research on what ableist language is and then avoid using ableist terms.
There's no need to demean folks who do any of these things. The DEV community encourages a safe space for learning and this post works against that.
First of, apologies if that sounds rude.
"stupid practices" that developers do
I'm pointing the "practices to be stupid", I don't think so I called the folks stupid nor did I meant that.
PS: I might still be wrong here, English is not my first language. Also I hope you're not taking the sentence personally 😅
See:
Impact is contextual from person to person. Still feel free to report abuse or reply with a sentence that could be replaced in the article. I'm open to edit the article and replace potentially harmful language.
I've already linked a sentence. Start off by reading about ableist language and then remove it from your article. After that, work on making this article less about insulting to people who may be like these "stereotypes" you've listed and more about teaching people how to become better developers.
Very Helpful, Thank you!😇
I have my trigger words, but saying an act is "stupid" or "foolish" is different when a person directly calls you "stupid." Personally, I would write that something is a "bad practice," but that's just my style. I come from a jQuery and Vanilla JS background, so I appreciate someone guiding my way, even with strong wording. I would think it's insulting to assume that "stupid" should be a trigger word for those who have disabilities. I worked with an programmer who was an amputee who used the word, "lame," although I would never use that word myself around him (and try not to in general). Obviously, he meant it to say something was "foolish." I have children, so I substitute the word "silly" for "stupid," but when I'm speaking with my wife, we use the word "stupid," for example, to describe some kind of harmful or useless policy.
I love this article: skepchick.org/2014/02/insults-slur...
Seriously, there are so many people who abdicate their responsibility to own their reactions. The world, the weather, the randomness of our universe, etc. are not going to take into consideration one's feelings - so, the very obvious answer is to own one's reactions and realize one's freedom from "trauma" or "pain" comes down to cultivating one's ability to control one's perceptions. Nice people are nice, no doubt, but when someone "offends" you, realize where that offense took place: within you. If you truly "give no fucks," no one can hurt you, and that's when you have true power. Telling someone to learn how to talk differently so that you don't have hurt feelings is the most powerless position to be in.
You seem to really think your opinion is important since you’ve replied at least three times here to say the same thing over and over again. Which is that you think people should be able to say whatever they want and that whoever they’re saying it to should just deal with it. Being kind is free, by the way.
Looking over your own comments on this article, it's almost like you're describing yourself. Weird how that works, right? It's fascinating to observe our own behaviors and wonder why we do the things we do... "Know thyself"
Yes! Isn't that beautiful? That we can have freedom to say whatever we want? Some even felt it was so important, that they made it one of the rights governments seek to protect above all other rights. Seems brilliant to me. All should have the same freedom, but it seems odd that some would use that very freedom to tell others with the same that they shouldn't use it. But, that's freedom! Just gotta ignore those people, I suppose...
Yes, they should. What if you didn't like the sound of birds, or the wind? What if a bird was chirping really loudly and the wind blowing fiercely while you were dealing with insomnia? That would suck, but you wouldn't realistically think that those things should heed your pleas to go silent, right? I mean, if you could control that, you'd end up feeling very alone... If all could be controlled by your command, you'd be more alone than you can even imagine.
Also a tender mercy of life, yes! The issue, as it is with all words, which are symbols for subjective abstract concepts, is that what being "kind" means is different for each person. Nick Lowe, for example, famously sang...
You've gotta be cruel to be kind, in the right measure
Cruel to be kind, it's a very good sign
Cruel to be kind, means that I love you, baby
(You've gotta be cruel)
You gotta be cruel to be kind
Look. Right to free speech was not created for the internet. It was created so the government couldn't silence you. I'm not debating with you whether or not people should be allowed to be abusive on the internet. There's nothing to debate. Sites have Code of Conducts for a reason and that reason is so everyone can peacefully and safely exist together on the internet.
I don’t know what would be your native language in which saying that people makes “stupid practices” is not insulting. May I assume calling this article “stupid” doesn’t bother you?
Yes it won't bother me if it was stupid.
Feel free to report abuse if you think this article is stupid.
Seriously, don't let these people get to you - insult, offense, etc. are not something done to us, but something we allow based on our reactions. I like to illustrate this with a short story:
I once taught a Sunday School class to some teenagers. I was writing on a chalkboard with chalk, and it broke. I let slip the word "damn" when it happened, and a girl took offense to it. I asked her, "does the word 'darn' offend you?" She said no. I said "why? There's only a difference of one simple letter between those two words. What makes one offensive and one not? What if I had said 'kurwa' (a Polish swear word she had no knowledge of) instead? Would that offend you?" She said no. And I proceeded to tell her it was a much more "offensive" word than "damn" or "darn." I tried to help her realize, the mental state she was in was what made the word offensive, not my using it.
So many have ostensibly given their power to other people, and then demand those other people behave a certain way, further illustrating that they will continue to give that power to them. So mind-blowing. So stupid and ignorant. :P
Thanks! This really helps me deal with ignorant and unnecessary hate. Although, I always try to be a reasonable person and understand if I was wrong at any point. People really need to stop bothering other people with their ways :/
"The DEV community encourages a safe space for learning and this post works against that."
Not sure what this means, but if it means churning out developers who can't program their way out of a paper bag, then I'm against it. While there's no need to be overly-rude, there's also no other way to put it: some people do some really stupid stuff. The word "stupid" doesn't have to be demeaning, just like saying someone is "ignorant" isn't demeaning when one understands what the word means, and how to use it.
The word "stupid" is completely acceptable and normal people use it quite regularly. Don't let the bullies get you down.
Thanks!, I also thought it wasn't such a big deal.
To clarify, I don't think using "stupid" in this context was a good idea. It was unnecessarily negative. But don't be shamed about using the word in general. It is not a dirty word or an "ableist" word.
There is nothing wrong with trying to avoid writing code, in fact that's pretty healthy. I agree with the rest, although I am not a react dev.
No code is the best way to write secure and reliable applications. Write nothing; deploy nowhere.
github.com/kelseyhightower/nocode
I am aware of the fantastic work of nocode and vanilla.js, without such effortless work, something would be possible 😂
WTF😂
Blank paper tells the best stories
I absolutely agree with you.
Now am fully encouraged to learn react. Have been discouraged based on the things have been told about state management e.t.c this post just guide me through.. thanks so much.. #reactweek
I'm glad it helped :) Feel free to connect in case of any doubts learning React/JS linkedin.com/in/rohan-salunke
Alright thanks alot
"KEEP THE MAGIC TO MINUMUM" - are we straining at a gnat but swallowing a camel? I mean, even just using React itself means you're already down the "magic" path quite a ways. When it comes to working in a browser, anything other than basic HTML, CSS and JavaScript is "magic." The lines of demarcation between CSS, HTML and JavaScript are maintained quite a bit more in libraries like jQuery than they are in something like React. I'm not here to hate on React, even though it makes my eyes bleed, I will hate on the idea that there's some proper quantity of magic. If you're going to have a religion, live it? If you're going to use something as black-box as React, you might as well "full send" that shit. ;) Correct me if I'm wrong: at the software level, isn't anything other than ones and zeros an abstraction (read: magic)?
This is the most interesting comment so far! I do agree that there is gonna be some sort of magic in the code, no matter what you work on. But in my opinion and as per my experience building enterprise applications, not quantifying the magic in your code usually blows up. I remember back when we simply imported 'lodash.js' as whole, we considered it as a utility library, but relatively it was HUGE🤯. In a nutshell, all I meant was a: At least a shallow understanding about the magic that your'e supposed to use always helps!
Thank you for sharing these, it's been an eye opener for real
Thanks!😇
Don't be one of these React Devs that call what they don't like "stupid". English language is rich, you could use more appropriate expressions.
The article is much based on facts and not my liking, I've also provided necessary arguments regarding what makes it stupid. Stupid is just stupid, will be stupid, no matter who likes it or not its just Stupid!
Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more