4 ms·
As I understand that is the core design feature of any strongly typed language.
by jve 10mo ago
As I understand that is the core design feature of any strongly typed language.
- matt_kantor 10mo agoI believe they're talking about gradual typing[0]. [0]: https://en.wikipedia.org/wiki/Gradual_typing https://en.wikipedia.org/wiki/Gradual_typing
- scotty79 10mo agoNot really. Strongly typed languages don't usually support not having any types in your code (or any amount of gradual typing). At least not with any convenient syntax. There's usually some one clumsy "dynamic" type that doesn't interact with the rest of the system well and you'd be crazy to start writing your code using only this dynamic type. I can't just write C++ like: any a = 1; a = "Hi!"; I also can't tell JS this shouldn't be allowed. But I can tell this to TS, at any stage of evolution of my program.
- fulafel 9mo agoNitpick: In the "static, dynamic, strong, weak" quad, C/C++ are considered weakly but statically typed because you can nonchalantly bypass the type system. In this case you'd need to be pretty explicit about the bypassing but you could write int a = 1; strcpy((char *)&a, "hi"); (and it'll even kind of work in this instance since "hi" fits in an int, if on your C/C++ implemnentation int happens to be sized 3 bytes or more)