Good points. I especially appreciate your pragmatic point about making a tech debt ticket.
This is more of using a bad a data structure I feel. There should not be an anonymous union type as a return
Yea I must admit that I used the string union type because I think it’s fun (and a type that is only available in TypeScript and Haskell from what I understand), but I could have used an enum to illustrate the same point. And I feel like this kind of defensive programming is even more important for enums since values can be added at any time.
But yea, never is a fun type and very valuable here.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good points. I especially appreciate your pragmatic point about making a tech debt ticket.
Yea I must admit that I used the string union type because I think it’s fun (and a type that is only available in TypeScript and Haskell from what I understand), but I could have used an enum to illustrate the same point. And I feel like this kind of defensive programming is even more important for enums since values can be added at any time.
But yea, never is a fun type and very valuable here.