|
|
|
|
|
by eropple
2491 days ago
|
|
I do mean enums/switch, yeah. Makes it easy to have your code yell at you when all cases aren't dealt with. The thing about making ADTs first-class citizens means that TypeScript stops being JavaScript, and one of the most valuable parts of TypeScript to me is that I can just look at it and know what the underlying JavaScript is. I kind of equate it to writing C on an old platform--it's going to be munged significantly but at a glance you can have a high degree of confidence that the code coming out the other end is going to be what you expect it to be. |
|