|
|
|
|
|
by yulaow
1460 days ago
|
|
I lost it when at my previous job I found a 20 multiline super complex type defined by another dev, asked him to describe it because I was in a tight deadline and had not time to parse whatever he was defining. He starts with "it's pretty simple" and then used like 10 minutes to describe me what he meant while writing on paper the various pieces getting confused two times. At the end of the day it could be simplified in a one line union type of a few strings which would cover 99% of the usecases and the other 1% was something we had never used and would never use. I really wish people would focus more on keeping types as simple as possible instead of using that complexity just because the language allowed it. |
|
Typescript is just one of those languages where things can get carried away but then reigned in again with a nice complexity gradient.