type

In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a type (for example, integer, floating point, string) to every term (a word, phrase, or other set of symbols). Usually the terms are various language constructs of a computer program, such as variables, expressions, functions, or modules. A type system dictates the operations that can be performed on a term. For variables, the type system determines the allowed values of that term. Type systems formalize and enforce the otherwise implicit categories the programmer uses for algebraic data types, data structures, or other components (e.g. "string", "array of float", "function returning boolean").
Type systems are often specified as part of programming languages and built into interpreters and compilers, although the type system of a language can be extended by optional tools that perform added checks using the language's original type syntax and grammar. The main purpose of a type system in a programming language is to reduce possibilities for bugs in computer programs due to type errors. The given type system in question determines what constitutes a type error, but in general, the aim is to prevent operations expecting a certain kind of value from being used with values of which that operation does not make sense (validity errors). Type systems allow defining interfaces between different parts of a computer program, and then checking that the parts have been connected in a consistent way. This checking can happen statically (at compile time), dynamically (at run time), or as a combination of both. Type systems have other purposes as well, such as expressing business rules, enabling certain compiler optimizations, allowing for multiple dispatch, and providing a form of documentation.

View More On Wikipedia.org
  • 543

    Dan

    • Messages
      14,198
    • Resources
      13
    • Media
      118
    • Solutions
      2
    • Reaction score
      3,909
    • Points
      7,698
  • 1

    sirsparkalot

    From Wales
    • Messages
      3
    • Media
      4
    • Reaction score
      1
    • Points
      3
  • 1

    Antares

    - From London
    • Messages
      3
    • Reaction score
      0
    • Points
      31
  • 1

    ipf

    - From Lancs
    • Messages
      7,852
    • Media
      252
    • Reaction score
      6,958
    • Points
      18,688
  • OFFICIAL SPONSORS

    Electrical Goods - Electrical Tools - Brand Names Electrician Courses Green Electrical Goods PCB Way Electrical Goods - Electrical Tools - Brand Names Pushfit Wire Connectors Electric Underfloor Heating Electrician Courses
    These Official Forum Sponsors May Provide Discounts to Regular Forum Members - If you would like to sponsor us then CLICK HERE and post a thread with who you are, and we'll send you some stats etc

    YOUR Unread Posts

    This website was designed, optimised and is hosted by Untold Media. Operating under the name Untold Media since 2001.
    Back
    Top
    AdBlock Detected

    We get it, advertisements are annoying!

    Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

    I've Disabled AdBlock