Data Type - Static Typing

Card Puncher Data Processing

Data Type - Static Typing

About

Static typing, otherwise known as type enforcement, is when a variable got a type that will never changes during runtime.

The variable (container) is declared to hold only a specific type of value, such as number or string.

Static typing is typically cited as a benefit for program correctness by preventing unintended value conversions.

This kind of language are called typesafe

The counterpart of static typing is Weak typing that allows a variable to hold any type of value at any time.

Pro/Cons

Pro:

  • IDE - Feature support from auto-completion to refactoring and everything in-between.
  • Type error discovered at build time

Cons:

  • You need to define your type and manage dynamic type yourself (cast)

Example





Discover More
Card Puncher Data Processing
(Data) Type - (Datatype|Type of data)

Variables, parameters, and function may be typed (static typing) and return values that are typed (as do a database column). The type of a variable or expression defines the characteristics of the values...



Share this page:
Follow us:
Task Runner