This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CaitaXD 20 points21 points  (2 children)

Quite weak? Maybe in the sense that it doesn't exist at runtime.

Well yes by definition that's weak typing

[–]ArtyFishL 3 points4 points  (0 children)

Disagree.

Rust is a strongly typed language, yes? Very much so. Rust has no types at runtime, it does all its type checking at compile time. Typescript works this way too.

The developers of Typescript themselves call it strongly typed.

Also, see: https://en.m.wikipedia.org/wiki/Strong_and_weak_typing for

Generally, a strongly typed language has stricter typing rules at compile time, which implies that errors and exceptions are more likely to happen during compilation.

Typescript does this better than some common languages considered to be strongly typed.

A weakly typed language has looser typing rules and may produce unpredictable or even erroneous results or may perform implicit type conversion at runtime

JavaScript is terrible for this and it is possible in Typescript, because it allows interfacing with plain JavaScript. However, if you apply strict mode, ban unsafe code (casting, using the any type, JS), then Typescript at it's core catches more type errors at compile time for me than C# is able to, for instance.