Data Type - (Primitive|Native|Built-in)

Card Puncher Data Processing

About

A primitive data type is the basic data type that a language offers.

A primitive type is a type without any substructure. It is then data:

  • that is not an class/object
  • and has built-in operation (no object methods)

Most of the time:

  • a primitive value is represented directly at the lowest level of the language implementation.
  • primitives are immutable (cannot be changed).

They are also scalar.

List

Most primitive data type fall under one of this category:

Others:

Example

  • boolean,
  • byte,
  • short,
  • int,
  • long,
  • char,

Obsession

Primitive obsession is the overuse of primitive types to represent higher-level concepts.

Example with a bounding box represented with:

  • primitives
vector<pair<int, int>> polygon = ...
pair<pair<int, int>, pair<int, int>> bounding_box = GetBoundingBox(polygon);
int area = (bounding_box.second.first  - bounding_box.first.first) *
           (bounding_box.second.second - bounding_box.first.seco
Polygon polygon = ...
int area = polygon.GetBoundingBox().GetArea();

See Code Health: Obsessed With Primitives?

Documentation / Reference





Discover More
Data System Architecture
(Data Type | Data Structure)

A type is the classification of value according to: how they are represented (the structure) the properties that they have (the operations) A data structure is a complex data type that can not be...
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...
Data System Architecture
Computer Storage - Integer Data Type (Binary Data)

In computer, integer are stored in word from 8 to 64 bit. Because CPU manipulates integer data type, they are also sometime called binary data type. Bit Length Two's complement signed Unsigned Float...
Data System Architecture
Data Type - Boolean

A Boolean is a primitive data type and may be implemented with: only two state: true or false 1 or 0 and an optional third one It's therefore almost always implemented on a computer level with...
Card Puncher Data Processing
Data Type - Boxing (Autoboxing|Autowrapping) and Primitive Wrapper

Boxing and Unboxing are the terms used to describe automatically wrapping a primitive type in a wrapper class and unwrapping it as necessary. This operation has the advantage to add basic method functions...
Card Puncher Data Processing
Data Type - Coercion (ie Type Conversion)

Type conversion is called generally “coercion.” Coercion is the fact to change: the type of a primitive (Example from string to number) a class of an object. The function name to coerce...
Card Puncher Data Processing
Data Type - Complex Data Type

A complex data type is a data type that shows a structure. All complex data type are based on a class concept. They are complex because they shows a structure primitive A complex data type is created...
Card Puncher Data Processing
Data Type - Enum

An enum primitive data type is a field data type whose consist of a fixed set of constants (ie nominal data) Enumerated type
Card Puncher Data Processing
Hive - Data Type

in Hive Hive supports the following data types category: primitive and complex in Hive Category Type Description Integers TINYINT 1 byte integer Integers SMALLINT 2 byte integer...
Java Conceptuel Diagram
Java - (Primitive|Native) Data Type

Java has a fixed set of primitive types: boolean, byte, short, int, long, char, float, and double. They can also be used in a wrapper class in order to enhance the functionalities....



Share this page:
Follow us:
Task Runner