|
|
|
|
|
by sk0g
1085 days ago
|
|
Some quirks I've noticed are typed objects not performing any validations, like for building DTOs. Structural typing so the newtype pattern is not possible without some awkward hacks. A general "disconnect" between compile time and run time behaviour, so once you start casting your errors are relegated to property access/usage time, which makes — IMO excessive — test coverage paramount in catching bugs wherever you have conditional logic. I would have gone with C# or Kotlin if I had the luxury of choice, but I'll get that with a deliberate career move maybe. |
|
That way you can define the type in a single place, have runtime validation for that type, but also be able to use the type in typescript at compile time.