|
|
|
|
|
by Shrezzing
1078 days ago
|
|
>I usually use 'any' types everywhere until my code is fully working and then, just before I open my PR, I have to painstakingly define types and replace all the 'any' references everywhere.... It feels like the type system is the error-prone part and my code is the reliable part This is akin to throwing water over an oil pan fire, then being frustrated at the water for your house burning down. You need to either use the Typescript way throughout your dev process, or not use Typescript. Both of those options are valid, but you're currently doing half of both, resulting in unnecessary frustrations. |
|
A better metaphor would be; I want to boil some chicken and I have a pan full of boiling water... Then just as I'm about to put the chicken inside, the head chef stops me and tells me that I need to pour oil into the pan.
I protest; "But sir, there's no need, the customer asked for boiled chicken, not fried chicken..."
"Do as I say" says the head chef.
So I reluctantly pour a tiny bit of oil on top of the water, then I add the chicken. It splashes around a bit, no big issues, and the chicken comes out OK.
The customer got the boiled chicken they ordered, and they're satisfied.
"See, it all worked out... Aren't you glad you listened to me?" says the head chef.