5 ms·
If the language can tell me when it executes the code that the type is wrong then I consider that type safe. Less usefully type safe than at compile time but sa
by zaphar 15y ago
If the language can tell me when it executes the code that the type is wrong then I consider that type safe. Less usefully type safe than at compile time but safe nonetheless.
If the language treats a string as a number in some cases without an error then that is most definitely not type safe.
- xyzzyz 15y agoWhat's the reason why you don't consider (Common) Lisp to be type safe then?
- zaphar 15y agoI prefer prefer strong statically typed languages. Just because php is at one extreme end of the spectrum of my preferences for type safety doesn't mean that other things can't be closer but not quite on my end of the spectrum yet.
- roryokane 15y agoThe standard term for the feature that allows treating a string like a number is "weakly typed". You like "strongly typed" languages.
- ScottBurson 15y agoLisp is type safe by that definition, so I'm not sure what your problem was with it.
- seanmcdirmid 15y agoDynamically typed is still typed. That the error occurs at run-time means the typing is dynamic. If the error did not occur at all (int was unsafely coerced into a string), then that would be untyped or weakly typed. Static type safety is desirable, dynamic type safety is almost essential. But they are both type safety.