U
U
Umid2017-02-26 12:30:11
typescript
Umid, 2017-02-26 12:30:11

Why do we need static typing, and is it possible to do without it?

Good afternoon.
I started to study typescript, the question arose why static typing was needed, is it not so convenient and not flexible?
After all, you can simply declare a variable, and stick whatever your heart desires into it, even a string, even a number, etc.
And what can ignoring static typing (i.e. not using it at all) entail?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xutesayor, 2017-02-26
@DarCKoder

and put whatever you want into it

And in the end, you will have an application in which "whatever your heart desires is stuffed" and in which the devil will break his leg.
Static typing is needed to reduce the chance of error. If a function takes a number, then it must take a number, not a string or an array.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question