Skip to main content
added 15 characters in body
Source Link
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

In some languages, you don't have to specify the data type.

Dynamically-typed languagesLanguages that support type inference can usually inferfigure out the data type from your usage. For example,

var name = "Ali" 

is internally typed as a string, because the value is surrounded by quotes.

Some languages don't require you to declare the variable either; the variable is created when it is first used. However, it's considered a best practice to specifically declare your variables, for a number of important reasons; mostly because doing so better expresses your intent.

In some languages, you don't have to specify the data type.

Dynamically-typed languages can usually infer the data type from your usage. For example,

var name = "Ali" 

is internally typed as a string, because the value is surrounded by quotes.

Some languages don't require you to declare the variable either; the variable is created when it is first used. However, it's considered a best practice to specifically declare your variables, for a number of important reasons; doing so better expresses your intent.

In some languages, you don't have to specify the data type.

Languages that support type inference can usually figure out the data type from your usage. For example,

var name = "Ali" 

is internally typed as a string, because the value is surrounded by quotes.

Some languages don't require you to declare the variable either; the variable is created when it is first used. However, it's considered a best practice to specifically declare your variables, for a number of important reasons; mostly because doing so better expresses your intent.

Source Link
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

In some languages, you don't have to specify the data type.

Dynamically-typed languages can usually infer the data type from your usage. For example,

var name = "Ali" 

is internally typed as a string, because the value is surrounded by quotes.

Some languages don't require you to declare the variable either; the variable is created when it is first used. However, it's considered a best practice to specifically declare your variables, for a number of important reasons; doing so better expresses your intent.