4 ms·
When I see things like this I have a visceral reaction that I just can't get over. https://www.typescriptlang.org/play#code/MYewdgziA2CmB00QHMAUBtARARgAyYBoACH
by jjnoakes 4y ago
When I see things like this I have a visceral reaction that I just can't get over.
https://www.typescriptlang.org/play#code/MYewdgziA2CmB00QHMAUBtARARgAyYBoACHfY0zAXXgFsBDAB1QboCcJYBJMAFwEo+AKCA https://www.typescriptlang.org/play#code/MYewdgziA2CmB00QHMA...
- 3np 4y agoYeah, not wrapping your hook before sticking it in unknown interfaces is a recipe for visceral disease. They don't teach that in school these days? Practice safe interactions - say no to unprotected injections.
- 2h 4y agoCode looks fine to me. Classic blame the programmer mentality. Shame on you.
- 3np 4y agoHey, I think it's mutual responsibility on both API provider and user to engage in communication before mixing parts. Who to blame is less important when you have an abandoned/orphaned child processes to take care of :/ No kink shaming, tho.
- jjnoakes 4y ago> I think it's mutual responsibility on both API provider and user to engage in communication before mixing parts And I think it is the responsibility of the type system to at least catch if I'm passing too many arguments to a function.
- jjnoakes 4y agoTypeScript flags when I call a function that takes two parameters max with three arguments as an issue in many contexts, but not in contexts like this. I understand why they chose to do this, but I reach for better type systems any time I have the choice.