re: Should we explicitly type the output of all functions (TypeScript) ? VIEW POST


I'd suggest yes whenever possible. Anyone coming from a strongly-typed language will understand immediately what the extra code is doing, so I wouldn't worry too much about that.

The major benefit besides is not for us, but for the language itself, especially when you start working with more objects, as it will help your application be explicit while it passes objects and models around.

It also makes it easier to find type errors before runtime.


Yes, I've a tendency to think that's better to explicitly type the output.
Thanks !

code of conduct - report abuse