124 karma · joined November 20, 2019
Perhaps in the future UIs can be rendered with WASM, with the common rendering libraries being distributed as a separate WASM module (so users would not have to repeatedly download large files)?
If `getLinkedCats` calls an external API, then the calculation can instead be all in the same useEffect.
The number one mistake I see people inexperienced with React doing is using too many useEffect's in their code, which is both hard to read and hurts performance, since it results in more renders than necessary.
The only strategy I'm aware of is described in `Working Effectively With Legacy Code`, where you start by writing throwaway unit or E2E tests that give you "cover" for being able to refactor. These tests depend on the implementation or may use mocking just to get started. Then you refactor, and write better unit tests. Then get rid of the throwaway tests.
This approach scales because it doesn't create a queue in front of ops.
- ops is sufficiently complex - The incentive to deliver features means that ops corners tend to be cut
So the suggestion is to build a self service platform that encapsulates the complexity, while making it easier for developers to use.
As a result, I often try to fit my tests into these existing systems rather than starting with the test and refactor the code under test to fit that shape. The only resource I've seen for dealing with this issue is the advice in the book "Working Effectively with Legacy Code", to write larger system tests first so you can safely refactor the code at a lower level. Still, that's a daunting amount of work when it's ultimately much easier for me to just make the change and move on.
In theory, if TDD really reduces the number of bugs and speeds up development you would see if reflected in those higher level metrics that impact the customer.
The question I ask myself is "what do I want?". It is a tough question. I consider my present and future needs, as well as how I feel. When I have thought about my answer, then it becomes clearer how I want to spend my time.
I'm a web developer now (Ruby on Rails), and I rarely do TDD. The feedback loop is quicker, but I still end up not doing it, and feel guilty for it.
This author seems like he wants to overcome this fear of how others may respond, and do the thing anyway. I'm reminded of the stages of emotional liberation:
First stage: Emotional slavery: we see ourselves responsible for others’ feelings.
Second stage: “Obnoxious”: we feel angry; we no longer want to be responsible for others’ feelings.
Third stage: Emotional liberation: we take responsibility for our intentions and actions.
[1] - https://about-nvc.tumblr.com/post/98642157391/from-emotional...