4 ms·
(I work on React.) Note that this is based on React 15.6.2, an older version of React. In React 16 we rewrote almost the entire codebase so that one may be mor
by spicyj 9y ago
(I work on React.)
Note that this is based on React 15.6.2, an older version of React. In React 16 we rewrote almost the entire codebase so that one may be more interesting to look at, depending on your goals. I guess – just don't blame us for some of the strange code patterns in 15 (like that random TopLevelWrapper) that we've since gotten rid of. :)
- ricardobeat 9y agoOut of curiosity, who should we blame? Team change?
- spicyj 9y agoI mean, sure – I added TopLevelWrapper so it's still my "fault", but it's not as relevant any more since most people are on React 16.
- felipellrocha 9y agoBlaming is the least productive thing when it comes to these things. Maybe the developer wrote that at midnight after a long day of work, and at that time it sounded like a good solution...
- Klathmon 9y agoI've found most times it's not even that, but that the "bad code" was in most cases the best possible code that could have been written within the needed constraints. You need a fix for problem "x". You can either write the ugly hack by next weekend knowing that it's going to be replaced by the big rewrite you have coming up in 6 months, or you can spend 1 month refactoring code to make a "proper fix" that will last another 5 months until the code is rewritten... Of course when you have an audience, they get to read into this however they feel. Some will point to the hack as an example of how awful the codebase is and how bad the developers are, others will point to it and proclaim (wrongly) how dirty hacks are never a bad thing if they work, still others will talk about how much better their idea their idea would have been even though it didn't fit your exact constraints. In my experience, very very few successful developers are "dumb" or "bad at programming" or whatever insults you see thrown around all the time. Most of the time it's just someone making the best of a shitty situation weighing several constraints while still keeping the product working.
- hinkley 9y agoYou don’t identify the party to shame them, you identify the party as part of the Five Why’s. And then additionally to reassess your trust level when someone says they are “done” or offers you advice. Developers bank a lot on this kind of trust and shutting down these so-called “blame” exercises blinds the team. Don’t. People who don’t at least try to write better code every chance they get have a pretty poor understanding of “best” in a given situation. They will grow very slowly if at all, and their best isn’t good enough. And if it turns out you were the negligent party, don’t you want to know that? Don’t you want to recollect how you rationalized that piece of work and adjust your behaviors? Above all else, don’t count on a rewrite. It is a Once in a Blue Moon affair and if often goes wrong. It’s the worst kind of crap shoot. The worse things are the less likely the rewrite will work. Rewrites require you to recall the entire featureset and if the project is off the rails then nobody knows all of them, so any part you touch is likely to miss something important. Edit: the rest of a thought
- Kiro 9y agoWhy do you want to blame anyone? The point is that they fixed it.
- acemarke 9y agoI wouldn't even say "fixed", exactly, because that implies it was broken. I _would_ say that the rewrite allowed them to build a different internal implementation that solved some architectural limitations with the approach they were using for reconciliation, as well giving them a chance to clean up some legacy APIs that had been deprecated.
- pomber 9y agoIf anyone wants to read how this changed and understand the main call hierarchy in React 16, I try to explain it in https://engineering.hexacta.com/didact-fiber-incremental-reconciliation-b2fe028dcaec https://engineering.hexacta.com/didact-fiber-incremental-rec...
- fowl2 9y ago> In React 16 we rewrote almost the entire codebase !