2

I have heard both "fundamental types" and "primitive types" being used.

Is there a difference in what the two phrases are referring to?

2

Having followed the provided links leading to Microsoft documentation and having chewed on the words for a while, this is what I make of it.

Fundamental means machine architecture bound. So anything that fits the data directly handled by the hardware in the CPU is fundamental. It makes sense, doesn't it?

Primitive means language bound. The basic types directly supported by the language without the need to write a class or struct. Note that this includes string. They are the dark blue keywords in C#.

https://msdn.microsoft.com/en-us/library/aa711900(v=vs.71).aspx

4

These terms are confusing and I would avoid using them in a formal setting without a specific definition.

In particular, I note that some editions of the C# specification uses the expression "primitive type" only twice, without definition, and somewhat inconsistently. It implies both that "primitive type" means "built in value types" and "any value type".

As David's comment notes, this is at odds with the definition of "primitive type" given in the .NET specification.

Rather than try to come up with a definition of "primitive", instead concentrate on clearly stating the property you would like a given set of types to have. Primitive types are often used to mean:

  • Types which are the atoms of a type system; that is, the types which are not themselves built from application of rules to other types.
  • Types which are provided for you by default in a language.
  • Types which are guaranteed by convention to be available in compliant languages.
  • And so on.
  • This answer is very useful, but the above answer answered my immediate question. – starbeamrainbowlabs Oct 6 '16 at 13:59
0

I would assume there is no difference in terms of meaning. However, a Google search highlights the "fundamental type" keyword in relation to Microsoft, .Net and C++ which suggests it is preferred instead of "primitive type" within those circles.

  • 2
    Nope, .NET defines a set of primitive types: "The primitive types are Boolean, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Char, Double, and Single." (msdn.microsoft.com/en-us/library/…) – David Arno Oct 5 '16 at 13:07
  • That is correct. The question is "Does primitive type = fundamental type?" From what I could grasp from your referenced link it seems to be a nuance of how you want to call it rather than a difference in meaning. I wouldn't mind more people giving input here though. Thanks ! – Alexandru Ungureanu Oct 5 '16 at 13:37
  • 1
    "Fundamental Type" is specific to C++. msdn.microsoft.com/en-us/library/cc953fe1.aspx – Robert Harvey Oct 5 '16 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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