What is dynamic typing?

To explain two completely different technologies as simple as possible, let's start again. The first thing a programmer faces when writing code is declaring variables. You may notice that, for example, in the C ++ programming language, you must specify the type of variable. That is, if you declare a variable x, then you definitely need to add int - to store integer data, float - to store floating-point data, char - for character data, and other available types. Therefore, C ++ uses static typing, just like its predecessor C.

dynamic typing




How does static typing work?

, , . . , . .

. x (int x;) int - Integer , – 2 147 483 648 2 147 483 647. , , – , , . , , strcat(), char, x . int , .





?

, , . , « » .

, – JavaScript. . - web-, . . . , - .

?

, , , . . , - . , , , . , , . , Python.

, . , .





«» «»

, – «» . , . - . , «» , . «» - .

, . JavaScript. , . – , : «x» + 1.

, , . , , . .

, , . JavaScript , . , .

?

, , . , . .

, , .

  • Delphi – Variant.
  • AliceML – .
  • Haskell – Data.Dynamic.

?

, . IT-. , . , , , , , . , .

  • - . , .
  • , - «» .
  • , , .
  • . , , , , . , .
  • , -.
  • , . .
  • , . , .

  • C++ - . . , .

dynamic typing languages




  • Java – , - . . -, . Java , .

static and dynamic typing in programming languages




  • Haskell – , . , , . .

static and dynamic typing




  • Python – , . , . .

dynamic and strong typing




  • PHP – . -, , -. .

static and dynamic typing




  • JavaScript – , - -, . , .

dynamic typing is better than strict typing




-

  • , . .
  • , . , .

Static and dynamic typing are used for completely different purposes. In some cases, developers pursue functional advantages, and in some - purely personal motives. In any case, in order to determine the type of typing for yourself, you must carefully study them in practice. In the future, when creating a new project and choosing typing for it, this will play a big role and give an understanding of the effective choice.




All Articles