4 ms·
> I like languages that let you decide how much you need to "prove it." I love that too. Are there any other languages than TS that have this as a core design
by scotty79 11mo ago
> I like languages that let you decide how much you need to "prove it."
I love that too. Are there any other languages than TS that have this as a core design feature?
- jve 11mo agoAs I understand that is the core design feature of any strongly typed language.
- matt_kantor 11mo 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 11mo 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 11mo 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)