DEV Community

Discussion on: The TypeScript Experience

Collapse
 
ecyrbe profile image
ecyrbe

In contrast, other languages like Rust, Haskell, OCaml, Elm, and F# have a sound type systems, like the HMTS (Hindley–Milner Type System), that do not require type annotations, and the types are always inferred correctly.

I beg to differ. Typescript has one of the best type inference out there. You can write almost everything but function parameters without any type annotations in typescript.

To take one of the examples, Rust requires a lot more typing. (Coming from a rust developper).

One Guy saying that he dislike typescript because he could not type it's return type because he wanted to return different types. He did not need to. Typescript would infer the return type without any issue.

Some of the issues raised come from obvious misuses of typescript.

Collapse
 
tbm206 profile image
Taha Ben Masaud

TS cannot infer the type of chained/composed functions; e.g. with lodash/fp/compose. That's pretty lacking if you ask me

Collapse
 
ecyrbe profile image
ecyrbe • Edited

It's not an issue with typescript but with library authors of definitly typed librairies.
Take a look at fp-ts that handles chaining just well.

Collapse
 
jwp profile image
JWP

Lodash is not TypeScript. Any missing intellisense you expect is an issue with a bad Typedef file. It has nothing to do with Typescript.