Why-did-you-update – Warnings about unnecessary React updates
github.com
github.com
[0] https://github.com/markerikson/redux-ecosystem-links/blob/ma... .
[1] https://github.com/markerikson/redux-ecosystem-links
[2] https://github.com/markerikson/react-redux-links/blob/master...
Not only do you get a big performance boost, but your code is greatly improved.
Depends on the size of your data. AFAIK handling immutable data has a performance penalty on smaller datasets. Before I go immutable I first assess whether I really need it.
[0] Vanilla JS immutable types heavily optimize this. Immutable.js does as well, although there's obviously more overhead.
There's a few different reasons why handling data immutably in a React app is a good thing. The main one is that it allows straightforward implementation of `shouldComponentUpdate` by simply doing shallow equality checks against props and state to see if anything has changed. (I wrote a Reddit comment yesterday explaining why that works well, at https://www.reddit.com/r/reactjs/comments/666uin/can_someone... ).
For example, say you have an action that fetches a bunch of blog posts, then refetches later. If all the items are identical since the last fetch, you want to avoid rendering. So that means that whenever you deal with data updates, de-duplication has to occur at some point, preferably early on in the data layer when the surface area is minimal.
That de-duplication would need to "intern" data; i.e. if you fetch the new blog posts, check each of them if they are exactly the same as what's already cached (time stamps or version numbers could be used to save deep equality checks), and keep the existing object if that's the case.
Of course, you will still end up with lots of identical objects (different identity, but same content) purely because mutations generate them. For example, a user goes to a text field, types a character and then hits backspace. Now you've produced three different objects: version 0 (original data), version 1 (character added), version 2 (identical to v0, different identity). This will correctly re-render each version, of course. But let's say you had some other component (like a preview) that only updated every second. It would receive v0, v1, v2; at this point the delta of v2-v0 is zero, and there's no need to re-render; but a shallow equality check would cause it to. So de-duping needs to be built into all sorts of places you might not anticipate.
For alternative re-rendering troubleshooting, read https://medium.com/dailyjs/react-is-slow-react-is-fast-optim...
You have some data (props and state) that defines the current state of your program. This data is passed to a rendering function, which creates a virtual DOM representation of the component based on the data. After this has happened, the virtual DOM is diffed against the previously built virtual DOM to see if we should tell the browser to render the real DOM based on the new virtual one.
So the general cycle works like this:
Data was updated -> virtual render -> diff new virtual DOM vs old virtual DOM -> real render if necessary.
However, both constructing the virtual DOM as well as diffing the DOMs takes considerable amounts of time. That's why React offers a short-cut to avoid it, if necessary: shouldComponentUpdate. This lifecycle method is called after your data updates and before the virtual render takes place, allowing you to short-circuit the process if you already know that your data didn't change in a way that changes the resulting DOM.
So with the short-circuit, there are two general pathways. If you know the data didn't affect the DOM:
Data was updated -> return false in shouldComponentUpdate -> nothing more happens.
If you know the data affects the DOM or you're not sure:
Data was updated -> return true in shouldComponentUpdate -> virtual render -> diff new virtual DOM vs old virtual DOM -> real render if necessary.
The value of the tool is that it monkey-patches some React internals to notify you when you have missed a chance to use shouldComponentUpdate properly.
This library basically encourages you to use React's "PureComponent", which automatically does that calculation to see if the props have changed for you, thus giving you a huge speedup since only the components that need to update will.
- PureComponent was only added relatively recently.
- While shallow equality comparisons are relatively fast compared to deep equality comparisons, they still burn CPU. There's also a number of reasons why props could have changed, such as object literals being declared in the parent's `render` method, or the component receiving other components via `props.children`. In those cases, the "pure" comparison will fail every time, and be useless.
- There is no "default" per se. Application components explicitly extend a React component base class - either React.Component, or React.PureComponent.
https://facebook.github.io/react/docs/react-component.html#s...
I'm quite happy that this is being utilized by so many people :-)
While in development mode it warns of changes to the Redux state, without having to commit to something like Immutable.js.
Ironically, it's used within fraternities all the time as a self parody. I was in one for years and never heard anyone say it in a serious matter. Essentially fraternities use it to troll people that already dislike the subculture.
Not judging the merits of the software but rather promoting inclusiveness.
Are people really that uncomfortable with the idea that the words they use affect people?
We have real problems to care about. I have had people at work team up to give me a beating (got away by getting hold of a weapon and finding a corner, 15 years ago).
I've seen girls been judged harder, backstabbed by project managers (she did a great job). I tried to defend her.
And so on.
SJW however are all about telling me what words to use or not. They are happy to get people evicted from PyCon for nothing more than they have provably done themselves. They make it hard to have a normal conversation because all of a sudden a word you use is offensive (sorry, not a native speaker so I don't know every connotation.)
In this case it even seems obvious that someone is poking fun at the very thing. Basically they are on the same side only someone must use the opportunity to try to derail and others must upvote it so it ends on top of the comments :-|
Agreed! Here's the thing, though: it takes such a tiny amount of effort to solve this particular problem.
What happens instead is people get outraged and a whole debate ensues, when literally all that needs to change is a couple words in a readme.
No! No! No!
Removing everything that anyone might find annoying is not a tiny effort.
And it is not one that I even want to participate in!
Even for stuff that still annoys me like unneccessary swearing I don't even care about it after I finish reading because I find this correctness more harmful than the alternative.
When I know that people have historically and are now getting treated unjustly (denied legal protections, murdered, discriminated against, etc) due to gender, race, religion, etc, I wonder how someone could possibly get offended by "bruh". There's some perspective that is missing there.
Bruh itself is not even directly offensive, it's just loosely connected to fratboys which is loosely connected to frat culture. What is there to be offended about?
What you are suggesting is that people should change their behavior to avoid the outrage of the mob. Now, historically, do you see the problems with mobs, do you see the contradiction in supporting mob justice with your aim of inclusivity?
Do you have the same opinion about the use of AAVE?
You're trying to make other people follow your social standards when the easier thing to do would to be not offended by innocuous language.
I'm not bullying anyone. My "cultural prescriptions" are just not using language that excludes people.
If people are so attached to that language that they won't stop using it even though they know it makes people feel unwelcome, then people will be excluded no matter what. I'd rather exclude people who care so little for the feelings of others that they can't bother to not use a word, rather than people whose only transgression is to not be part of an in-group.
Yes. They are. You are trying very hard to tie up anyone who has a different sense of humour than you.
And if we don't stop you know next time you come to tell ys that our straightforward explanation isn't good enough because "he" or "she" was mentioned somewhere.
We have accepted writing (s)he or he/she.
But you will never ever stop will you?
And if we don't stop people like you next time we know we are expelled from PyCon because we told a joke.
https://www.youtube.com/watch?v=ryYETmi9lNA
"Because anything that has a status has a kind of power, and power always corrupts. It must be allowed for it to be subjected to ridicule, when that is not possible anymore, you get nasty situations, a dictatorship or something. That's why ridicule is important."
"Furthermore, an insult is to some people a truth they are rather not confronted with. And this could mean that we can't talk about this or that because someone might be offended."
Obviously insulting people directly is bad and no one on HN would allow that all. If the readme said everyone was a shitty developer because they had unnecessary updates, that's clearly not very nice.
But the readme has a couple of non-directed words used in a completely harmless way. If we police this sort of text then we may as well just shut down the internet entirely. People will be too scared to say something because society decided to take offense to the english language.
The thing is, if you don't like it and get stuck on lingo, there's a good chance you're going to be left behind by the future. Your complaint is a symptom of falling into the out-group of the cutting edge, into becoming part of The Previous Generation.
I don't think people should have to stick to any "business speak" when working on open source software. You're doing it for fun, and for free, who cares?
Does this matter in personal open-source projects? Not really, forking is a thing. When working with others / at a job, sure.
[1] https://www.youtube.com/watch?v=Hbda1PpQmAk
[2] https://en.wikipedia.org/wiki/Cowsay
[3] https://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_...
(P.S. TIL about `$ fortune | cowsay -f head-in`. Hahaha I hadn't seen that before.)
People have been making jokes since the beginning of time.
Have you talked to anyone in a sorority? Its a fraternity for females and they share the same speech quirks.
>. It has nothing to do with insulting frats, just that particular language which is "frat-ish".
That's nice, do you also take offense to things like ebonics because they seem "black-ish"?
I think you're being unintentionally insensitive because you're blind to your own prejudice
I'm not sure what you mean by your last statement. All I was saying is that I'm not trying to insult frats, it's just this language is associated with frats and its how people describe it. I don't think there's anything wrong with it, different groups will always have dialectical quirks like that.
It's in the same category as reddit's "the narwahl bacons at midnight" crap that was all over that site years ago to me. I just find it nauseating.
This is how the "get off my lawn" mentality happens. Older generations don't just become cranky and cantankerous — society shifts out from under them in ways that go against the norms they're accustomed to while they hold the line on the way they perceive that things used to be.
Note I'm not saying that this is the direction things are ultimately going to shift toward. Just that this example is symptomatic of how generational culture shifts happen.
I've already noticed this in myself, and I'm just past thirty. I just don't "get" Snapchat, for example. It's perhaps just one thing right now, but culture changes aren't independent of one-another. You hop off the bandwagon but it keeps going and only ever becomes harder to hop back on.
I'm not sure this is. And if it really bothers (the collective) you that badly:
git clone && rm README.md
There is nothing wrong with wanting something to stay just "in".The relative tone of this thread and its popularity has me convinced that many are willing to change their culture to match random demands regardless of the objective merit of those demands. Hell, without even critically examining the merit of those demands.
"This language is alienating!"
Says who? And why? Why is this a statement to be taken at pure face value by someone who isn't even claiming to be offended?
I find that lack of principled objection to be horridly offensive, but that's just me.
Not everyone gets every joke after all :)
Close the tab man, it's a click away. We will enjoy the work while you can be at peace. He is not invading your safe space.
Now let us back to important things like deliver software thanks to contributors like him.
No, it's not. It's just users that take free advantage of whatever that person is offering gratis.
And perhaps some more that he'd like to work with him on this -- the rest that don't like his language can take a hike.
By what definition created by who?
- https://qz.com/797559/gender-bias-job-listings-language/
- http://writingcenter.unc.edu/handouts/gender-inclusive-langu...
- https://mit.uloop.com/news/view.php/206562/On-Inclusive-Lang...
* That "bruh" is sexually "excluding language"
* That an actual reasonable person feels "excluded" from using this update monitoring tool based on humor in its readme.
So far, you have done none of those things. Your links argue that sexually exclusionary language 1. exists and 2. is a problem. Nothing more.
What definition:
- language that feels unwelcoming to people (all three articles)
- language that studies show excludes people (Quartz article)
Who:
- people affected by exclusive language (MIT article)
- people who research exclusive language (Quartz article)
> * That "bruh" is sexually "excluding language"
It's gendered language, which all the aforelinked sources list as exclusive
> * That an actual reasonable person feels "excluded" from using this update monitoring tool based on humor in its readme.
We don't need to prove the same case over and over for every single word. Gendered terms have been shown to be exclusive + "bruh" is a gendered term = bruh is exclusive
..in certain contexts, where maximum inclusivity is the actual goal, if not the law.
Why is maximum inclusivity the goal here, again? Why must it be?
My earlier assessment appears to be correct. No person can be pointed to that actually feels excluded by this, and so all this sturm und drang is about hypothetical straw people.
This conversation is no longer interesting.
No, you just ignored the studies showing that this is excluding people.
BTW, tokenization is also discriminatory: https://www.forbes.com/sites/amanialkhat/2016/02/29/amani-al...
Starting points:
- Humor
- Context
for the context I come from a background that makes it possuble for me to get offended by a lot of things.
I still choose not to care anymore and it is actually way better.
if you like the idea and not the verbiage, change it.
if you like the idea and dont mind the verbiage, no issue.
if you dont like the idea, then you dont need the tool
It's humor. Lighthearted humor, and it's pretty hilarious to see everyone here get completely puffed up and bent out of shape about it, entirely because It Doesn't Conform To The Language Convention You're Supposed To Use Here.
Professionals push back towards professionalism, which should be free from micro-culture in jokes. The profession is international, and there are many indulging in this who do not have the perspective to recognize the actual cost of insularity.
More to the point bro-grammer crap is explicitly barrier-raising. Clique-based behavior, however graced with knowing winks, led directly to the current crisis of culture in the Valley in general, and start-up culture in particular.
As such it is most definitely at best in the category of funny-once.
And the joke played out long ago.
Because I have a definition that states you use the best tool for the job at hand, rather than choosing (yes, choosing) to complain loudly about poorly-described-and-argued ancillary matters which don't directly impact the operation of said tool.
I reject the idea that "professionalism" means that the cheeky, mischevious humor that has basically defined the hacker spirit for decades must be stamped out or suppressed.
Words matter. There are plenty of studies that show e.g. certain language in job listings discourages women from applying: https://qz.com/797559/gender-bias-job-listings-language/
When it can be reasonably proven that this is actually happening in this case. A reasonable start would be finding a real (as opposed to straw) person who feels "excluded".
If "bruh" is legitimately "excluding people from the community" in this context (And let's be honest here: a job posting is not equivalent in any way to a readme on a git repo), then by all means, let's have the conversation.
If it isn't? This is all just noise. Worse, actively harmful and distracting noise.
echo "This is available on most of the servers that run the internet" | cowsay -f head-in
I think the programming profession has always been a pretty relaxed culture.Even if the tone is being used facetiously -- especially when it is being used facetiously -- we must be clear in communicating what behavior is and isn't acceptable. Failing to do so makes women feel uncomfortable, and teaches impressionable young coders (the college kids that typically have time to write sarcastic open-source one-off projects) that this kind of thing is okay.
Honest question, are you a woman? I generally agree that our industry has to do a lot more work to make everyone feel included and utilize all the talent available. But I disagree that using the word 'bruh' should be discouraged, or that it correlates with inappropriate behavior. Especially if it's anecdotal, its just correlation, not causation, and shouldn't be read into.
(Unless 'bruh' has a meaning other than 'bro', short for 'brother', that I don't know about).
If it has no negative meanings, I wouldn't want to be part of a cultural movement to create a negative connotation on the word. People grow out of using such words themselves.
Given the absence of anyone claiming to be in the first category, I'm forced to conclude it's the second. Let's make sure a problem actually exists before going out of our way to solve it, hm?
(As a passing observation, I might also add that any conversation which features the magical expression "virtue signalling" is unlikely ever to be a valuable one.)
As for virtue signaling, it is a thing that exists[2], and writing off any conversation where one points out that it's happening is probably doing themselves a disservice. Much like any other kind of social signaling, it doesn't even necessarily happen consciously.
[1]: https://www.destroyallsoftware.com/talks/wat
[2]: https://www.thesun.co.uk/living/2701968/virtue-signalling-me...
In my experience of conversations featuring the phrase "virtue signalling", I can only say that by the time that term is introduced, they are already worthless bullshit, or very shortly afterwards they are at considerable risk of becoming it. I'm sure it's a real thing that really happens, but I'm not certain that pointing it out ever actually does any good.
(Somewhat amusingly, your second link contained topless nudity just to the right of the main image, at least for me. I guess that's what happens when you link to The Sun, which is broadly regarded in the UK as a newspaper of ill repute.)
If there was something funny about it I'd find it much easier to ignore, but all it's communicating is that you identify with a particular subculture in our industry that I find to be immature. It's just a turn off and a bad first impression.
That said, if I needed it I'd probably still use it regardless.
You don't see me writing about how a certain gender or ethnic group are dumber than others (as a country man on HN I feel I am on the receiving end of that sometimes though).
For the definitions used here though, no: I have realized that once we start living by some of your rules you just invent more.
So I'm OK with not complaining about swearing and hope that others are OK with me writing a straightforward he/she or (s)he instead of spending valuable time on not offending people who are trying to be offended.
These aren't white supremacist dog whistles. I think your response is totally appropriate if the package included "14/88" and "HH". It's over the top and betrays your own biases against men when pointed at "bruh" and "gainz".
Teaching that what, exactly is ok? Using the word "bruh"? In all seriousness, how old are you?
Plenty of people use that word, and it's not just guys. Is it on the immature side? Yes, but it's not really condoning whatever behavior. Unless you have data backing that assertion, you are just projecting from a mere readme file.
>gainz
These terms come from the fitness world. At first glance, it seems you're implying that the fitness world is full of gender discrimination etc.
FWIW bro (brah, bruh, etc.) is commonly used gender neutrally, much like dude.
I'm all for inclusion but I would hardly consider facetiously using brah and gainz as offensive or misogynistic.