Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 1
Whar is type safe language?
why swift is given that any other type safe language is there
2 Answers
+ 11
Quoting from Quora:
"Type safe" usually refers to languages that ensure that an operation is working on the * right kind of data at some point before the operation is actually performed. This may be at compile time or at run time.
* right kind of data - This means that the language requires the compiler/interpreter to check if we are dealing with correct datatypes or not, or if the said data can be interpreted as a different type.
There are pros and cons.
Further reading: https://www.quora.com/What-does-it-mean-if-a-language-is-type-safe
0
type weak language example:
js...You simply declare a var x and let the browser do the work of confirming what kind of data the var x holds.(bool,integer,float,double etc)
type safe language example:
java...Try declaring something as simply var x (instead of say int x) and watch a tide of errors come up if you compile. 😂