133 comments

[ 4.5 ms ] story [ 145 ms ] thread
This is a pretty useful utility. I have a number of other similar "why did this component re-render" tools listed in the "DevTools" section [0] of my Redux addons list [1]. I also have a large section of articles on React (and Redux) performance [2] in my React/Redux links list [3], which includes articles on measuring perf using various tools, optimizing re-renders, and more.

[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...

[3] https://github.com/markerikson/react-redux-links

Alternatively: Make all data immutable, then make all components pure. Finally, look for and fix breaking components, since those will point to code smells and anti-patterns (using context incorrectly, mutating data, non-unidirectional data flow).

Not only do you get a big performance boost, but your code is greatly improved.

Agreed! In the meantime I think that this lib is very nice. Fine tuning performance is an art and requires knowledge and time.
> Not only do you get a big performance boost,

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.

It's important to note that there's a difference between "handling data immutably" and "using the Immutable.js library". It's completely possible to handle plain JS data immutably _without_ using Immutable.js.

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... ).

You don't need to write shallow equality checks on each component if you're treating props/state as immutable. You can use React's PureComponent which automatically does this for you: https://facebook.github.io/react/docs/react-api.html#react.p...
Which does the exact kind of shallow equality checks I was just describing :) The point is that for shallow equality checks to work properly, you do have to handle data immutably - such as using `someArray.concat(item)` instead of `someArray.push(item)`, because otherwise passing in the same references is interpreted as "nothing as changed".
Shallow equality is not a panacea -- it doesn't avoid updates when the content is the same, something which can easily happen.

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.

Deeply frozen data is a good middle ground to have immutability without Immutable.js: during development, automated tests can catch code that would attempt to mutate, and you have the option to remove the deep freezing in the release version to have no runtime penalty once you're confident that nothing can mutate the data.
As far as React goes, the performance increase with immutable/pure components more than offsets the penalty of using immutable structures and having to "copy"[0] data to change it. Of course, it depends on the app, if your data is change-heavy, this will be less true.

[0] Vanilla JS immutable types heavily optimize this. Immutable.js does as well, although there's obviously more overhead.

Words like "bruh" and "gainz" send a signal that is probably better off un-sent.
That's right, we should always strive to assess technical projects based on how the author communicates.
I realize you're being sarcastic, but certain forms of communication anecdotally correlate with inappropriate behavior (harassment, offensive verbal remarks, stalking, gender discrimination).

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.

> Failing to do so makes women feel uncomfortable

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).

Shouldn't we err on the side of not excluding or offending people if there's a reasonable possibility that we would be?
Is anyone legitimately offended by the word "bruh", or is this whole thread just tedious virtue signaling which contributes absolutely nothing of substance?

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?

I don't find it offensive, but I did find it quite annoying, likewise "Wat?" and "AF", and I thought to myself that it was a shame that what appears to be a useful tool had a README littered with this twee, cliquey stuff that I find somewhere between boring, irrelevant, and annoying, and certainly never funny. I don't know if I'm a square, yet, but I'm definitely a curmudgeon, especially when I'm hungry.

(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.)

Fair enough, but that's humor. Not everyone gets everything. I'm pushing 30 and still get silly giggles out of things like Bernhardt's "Wat" talk [1].

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...

I like the "Wat" talk too, and it's maybe about the only time that "Wat" has really ever seemed appropriate to 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.)

I don't feel excluded or offended (although I completely understand that argument), but using language like that makes me less likely to want to engage with you because I find it immature. I find the way it contorts english grammar detracts from content and dilutes the message.

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.

But what offensive meaning does the word carry? I edited my comment to ask that, possibly after you replied.

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.

I don't know, shouldn't you? Isn't judging people so harshly for informal vocabulary used with a jovial intent and no obvious negative connotation (unless you dig deep down into particular Internet subcultures), an exclusionary and offensive practice?
Maybe we should err on the side of not offending the creator of some software we can now use for free?
Yes. Thats what we normally do.

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.

Your second paragraph has made a huge leap. It's not fair to say that allowing young men to talk like young men condones terrible behavior.

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".

>bruh

>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.

> 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.

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.

Correct. That's an incredibly important attribute of all technical projects.
(comment deleted)
It's probably a better indicator of their audience, the in-group. I don't know how old you are, but this is what it's like to become a square.

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.

There's no reason to go out of your way to create the feeling of an in-group and an out-group.
There's also no reason to go out of your way to demand that the author of a tool structure their readme doc according to your own personal opinion on social norms in the context of a damned update monitoring tool - especially for something as utterly inoffensive as "bruh".
damned open source update monitoring tool, where you can change the verbiage if you really don't like it.

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

The guy is providing a free tool coded on his own time without being paid. He can write the README the god damn way he wants.
This is a community, and they're using alienating language. The fact that they did it for free has nothing to do with whether or not we should discourage that behavior.
alienating language

By what definition created by who?

There's plenty of research and best practices on how language can be inclusive or exclusive. Here are some links if you're interested:

- 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 is an answer to a question I didn't ask. As I explained in the other reply, you'd need to simultaneously prove:

* 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.

> By what definition created by who?

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

(comment deleted)
Gendered terms have been shown to be 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.

Maybe you need to read a bit.

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.

Using minority rhetoric to criticize minority behavior is a classic reversal that is closely related to arguments for "reverse racism." It's not a good look.
>This is a community

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.

So ? The author doesn't owe you any behavior as long as it's legal. Freedom of speech doesn't mean he can do only things as long as they don't offend anyone.

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.

Without heating up the discussion. I think it depends. If you want you tool or else be just "a damned x whatever" then you can feel free to use whatever lingo you want. But if you would like to be taken seriously then a more appropriate language might be needed. And it's not to be uppity or anything, it's just that the broader the audience, the more understandable and out of your "in-group" it has to be. If that's what you want obviously. There is nothing wrong with wanting something to stay just "in".
But if you would like to be taken seriously

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.

And why? If your word choice means 50+% of the target population has no idea what you mean then it's a poor choice.
If the goal of the author was to do anything other than sprinkle in some inoffensive humor. ("wat", "performance gainnzzzz")

Not everyone gets every joke after all :)

What? Who demanded changes?
That you think this is intentional unfortunately probably reinforces GP's point.

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.

Disagree.

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.

Says who? Who determines what professionalism means?

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.

So where do we draw the line when that "cheeky, mischievous humor" actually excludes people from our community?

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/

So where do we draw the line when that "cheeky, mischievous humor" actually excludes people from our community?

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.

>So where do we draw the line when that "cheeky, mischievous humor" actually excludes people from our community?

First, who said the goal is not to exclude anyone?

It's totally fine for someone to want to exclude humorless squares.

You got flagged off for this, probably because of the thinly veiled insult, but I'd agree that there's nothing wrong with signaling that you'd rather not work with people with a deficiency of sense of humor.

If "wat", "bruh" and "performance gainzzz" (of all things.. we're not talking about slurs here) in a readme actually gets people to self select out of using an update checker, I find it very hard to see that as anything other than a positive for people who want to work, rather than debate sociology.

...not that I think that was an intentional goal of the author.

People tell me that my long hair is unprofessional.
You aren't actually disagreeing with him. He's pointing out what's happening, and you're arguing that it's bad. Those two positions aren't opposed in any way.

    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.
I'm pretty sure there are people working on "the cutting edge" of tech that are capable of communicating like adults and not a college fratboy. The vast majority, actually.
(comment deleted)
Chill breh, a lot of devs in SV were college fratboys. I don't see anything wrong with their vernacular leaking into development. You act like being in a frat is an insult.

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?

Because 1) it's seen as juvenile at best and 2) seen as off-putting towards non-bro people (specifically, women) who aren't in the "in-group". It has nothing to do with insulting frats, just that particular language which is "frat-ish".

Does this matter in personal open-source projects? Not really, forking is a thing. When working with others / at a job, sure.

(comment deleted)
> seen as off-putting towards non-bro people (specifically, women) who aren't in the "in-group"

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 don't disagree with you, I'm just stating why people make those statements. I would go even further than just frats/sorities, that type language isn't uncommon with college aged people.

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.

I don't think there's an "in-group" of frat-bro programmers who actually talk like this in real life. Everyone I've met has just been doing it as a joke. At least, this seems very common in the Ruby/Rails community. There's a whole ton of weird gem names, and people just being silly in general [1]. And it's not a recent [2] thing [3], by any means.

[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.)

I don't think it's an IRL issue really either. Recently there was that uber article. But in general I don't really see it or it's usually exaggerated.

People have been making jokes since the beginning of time.

Sure, put whatever you want in your README's. I don't care if that's the impression you want your projects to have. You're not offending me, I just have to hold my nose when someone feels the need to do the brogrammer speak thing.

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.

(comment deleted)
I think there's intentional irony in the use of those brogrammer terms which is going over the heads of those offended here-- further reinforcing the "square" diagnosis.

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.

Well then I'm 20 and a square. "Bro talk" isn't 'hip', it's just a way certain types/groups of people talk (frat bros / gym bros). It routinely gets mocked by people my age.
(comment deleted)
A lot of subcultural behavior is mocked and derided, but the fact is that subcultures produce their own language markers as shibboleths. This goes back at least 3000 years.
Yes, but that doesn't have anything to do with just age, which is what the parent was trying to assert. People do talk like this, but certainly not everyone. Outside of actual frats and sororities in colleges, this isn't common at all except in jest.
I don't know, I'm nearly 30, and I know a few people in their 30s or 40s who often talk like this as a joke. I think that's the tone of that README. It's just meant to be funny.
This is correct. Off-putting to non-males and other developers who wouldn't consider themselves a "bruh".

Not judging the merits of the software but rather promoting inclusiveness.

This has nothing to do with sex, sweet jesus!
Yes, it does... whether you can see it or not.
(comment deleted)
(comment deleted)
(comment deleted)
Not sure why parent is being downvoted. "Bruh" is a term with a bunch of connotations, including gender.

Are people really that uncomfortable with the idea that the words they use affect people?

My ideal HN would be one where this kind of thing could be discussed. It's sad to see stuff like your comment's parent down-modded when there could have been enlightening discussion.
My ideal world would be when people stop being offended by silly stuff. But watching university protests and safe spaces makes me realise this ideal world no longer exists.
(comment deleted)
Didn't downvote parent. (Update:have done it now to avoid having it at top of the discussion) But still find SJW more destructive than the people they are fighting.

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 :-|

> We have real problems to care about.

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.

it takes such a tiny amount of effort to solve this particular problem.

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.

You are bullying people into following your cultural prescriptions.

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.

(comment deleted)
> You are bullying people into following your cultural prescriptions.

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.

My "cultural prescriptions" are just not using language that excludes people.

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.

I think this argument in this video about jokes and people being offended sums it up.

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.

Jesus christ, it's being used in a comedic manner. Most of the devs looking at that repo wouldn't consider themselves a bro.
Your profile says your company website is http://www.shaggyfrog.com/ which is currently being parked and not used, does it send a signal that you are bad at what you do because you can't even handle your own website? Let's not make assumptions based on how the person talks, what if he likes to use those words but creates great and useful utilities?
No matter what someone has said, we don't get into personal attacks like this here.
I care about inclusivity, but I think you're making too much of some benign humor. Perhaps it is humor not to your tastes, but it's such a minor aberration (a couple words in a README) that I think it's unfair to judge the project based off of it. If, for example, the code outputted similarly unprofessional language into the console or something to that effect, I'd agree, but I think in this case it's really no big deal.
(comment deleted)
Is this a particularly US-centric thing? Because over here in Europeland, I don't think I have ever, like, ever seen a use of bro-speak that wasn't intentionally self-parodic. But people do seem to react strongly against it, so... I guess it's a real thing somewhere? If so, where?
It's mostly college fraternity/sorority subculture which is pretty unique to the US. A lot of people hate college fraternities for whatever reasons and that hate sometimes extends to their language.

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.

(comment deleted)
Oh. I thought it would question your unneccessary update of dependencies that didn't close any bugs or introduce new features but require you 3 days to change code according to a new API.
ha! Indeed I thought the same at first but then got excited anyway when I understood what it does.
If it took you 3 days to update React then you should definitely look at jscodeshift. It should have taken you a few hours at most regardless of the size of your codebase.
Everything I know about React I know from HN. Guilty, criticizing tech I've never used - but it's more about the whole constant update mentality than React in particular.
(comment deleted)
I worked with Node all the time and have not really found this to be a problem unless the package maintainer fails to publish a change log or fails to follow semvar correctly.
Not a front-end dev here, but I thought the whole point of a virtual DOM was to allow you to refresh the whole interface all the time and allow the library to only render the differences. Wouldn't this tool negate that purpose?
So recalculating the virtual DOM is fast, but it does have a cost. The easy way to combat this cost is to realize that if you're doing things right and using pure functions, you'll get the exact same UI if you're state hasn't changed. So if you know the state that feeds into a certain component hasn't changed, you can get much better performance.

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.

Why isn't PureComponent just default?
A few reasons:

- 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.

It is not a bullet proof solution. It has its use cases, but a couple pitfalls as well. Using PureComponent as a parent to many Component classes is generally not a good idea. If a child depends on a change from `this.context` it will not re-render unless the PureComponent declares `contextTypes`.

https://github.com/facebook/react/issues/2517

Not really. Diffing and rendering still cost a little, and pointless renders that results in zero differences often indicate a possible performance problem. This tool highlights such situations. If there is no difference after an action, it shouldn't happen.
Here's how React works, in very broad strokes:

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.

Good explanation, with one nitpick: the diff is done between the _old_ virtual DOM tree and the _new_ virtual DOM tree, not between the virtual DOM tree and the real DOM. That's why you can have a component that renders a single div, and then get the reference to the real DOM node and use jQuery or some other DOM-manipulating library to attach non-React-based DOM elements to the div. As far as React knows, you're just telling it to keep rendering that same div, so nothing needs to change.
Thanks for pointing that out, I've updated my comment to fix the mistake.
Author of the Benchling mixin / blog post, here. Thanks for including the credit and for making this technique more easily usable!

I'm quite happy that this is being utilized by so many people :-)