0

Could someone explain what are low level and high level data types in the context of programming in general. Coming from a Java background I thought that low level would be the primitive types such as the integer, boolean, String etc and high level would be compound object types. Not quite sure that this is the general understanding though and I could not come across a clear definition online.

2
  • Your understanding is correct: low level types are usually the primitives and high level types are usually types composed of primitives or other high level types. This is rough, informal classification of types.
    – xxbbcc
    Nov 4, 2014 at 15:27
  • Where did you hear that term? You should look there for the definition.
    – svick
    Nov 4, 2014 at 18:35

2 Answers 2

2

Your understanding is generally correct, but it is also very dependent on your specific code stack.

For example, you list String as a primitive type; but in C, for example, a string is usually just an array of characters, while a full-featured String (like the one in Java) is a very high-level object. At least, higher level than some structs you could easily define, like a complex number, or a 2d- point like typedef struct {float x, y} Point.

Of course it can simple be explained because Java is a higher level language than C, so its primitives are higher level than C ones. In the end, that just means that 'high/lower' level are just defined as relative values, some things are higher level than others.

Ultimately, everything in software must be executed by a CPU, so it makes sense to note which concepts are implemented in hardware and which are not.

Integers, pointers, bit fields, floating point, etc. are common to most CPUs. Some of them also handle arrays and even simple (C -style) strings.

Structs and typed values are usually 'implicit' in the code, but not a CPU feature, so they're slightly higher level, but usually so low that there might be no explicit code to handle them, just the structure of the program makes the data behave as intended.

0
0

i would say 'low level' is something dependent of your operating system architecture for example 'unsigned int' in C. it's different on 64 and 32 bit architecture. on the other hand you can have something that abstracts from your hardware. for example infinite list of any type (in haskell)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.