I have heard both "fundamental types" and "primitive types" being used.
Is there a difference in what the two phrases are referring to?
Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.
Sign up to join this communityI have heard both "fundamental types" and "primitive types" being used.
Is there a difference in what the two phrases are referring to?
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
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:
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.
void
, some pointers and numeric types, eg see msdn.microsoft.com/en-gb/library/cc953fe1.aspx and en.cppreference.com/w/cpp/language/types – David Arno Oct 5 '16 at 13:12