dotnet / dotnet/dotnet-api-docs
Definition of primitive type
- Lingua principale
- C#
- Stelle
- 949
- Fork
- 1.7k
- Merge medio
- 2g 19h
- PR unite (30g)
- 52
Descrizione
This page covers the `IsPrimitive` property for types, but I haven't been able to find a definition anywhere of what a primitive type is. As far as I can tell primitive types are the value types built into .Net. Structs and Enums aren't primitive types (but are value types) as they can be user defined.
There was this [discussion](https://stackoverflow.com/questions/2066035/in-c-sharp-are-the-terms-primitive-and-literal-interchangeable/2135136#2135136), that says that 'primitive' isn't defined in the specification, but there must be a reason why the types listed on this page are deemed primitive.
This [site](https://medium.com/omarelgabrys-blog/primitive-data-types-in-c-vs-java-5b8a597eef05) describes primitives as the main built-in types, but `string`, `object`, aren't primitive as per the list on the `IsPrimitive` page, but maybe this definition isn't specific to value types.
Is there a definition, and can it be added to this page, and maybe else where in the msdn documentation?
Here's some more links:
[This page](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/built-in-types-table) mentions simple types, which seems to be the same as primitive types, but there is once again no definition of what a simple type is other than the list of types.
Here's another [page](https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/ms228360(v=vs.90)) that talks about primitive types with respect to both C# and Java.
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: dffb41b0-35d3-6ddc-7bfe-c162d1e32d45
* Version Independent ID: 51569306-3108-5d27-466e-44aa6acb3514
* Content: [Type.IsPrimitive Property (System)](https://docs.microsoft.com/en-us/dotnet/api/system.type.isprimitive?view=netframework-4.7.2)
* Content Source: [xml/System/Type.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System/Type.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con xml/System/Type.xml e la pagina di riferimento dell'API Type.IsPrimitive indicata nell'issue. Confronta la tabella dei tipi integrati e il materiale storico collegato per determinare se sia supportata una definizione precisa. Il lavoro è completato quando alla documentazione pertinente viene aggiunta una spiegazione accurata dei tipi primitivi o semplici, inclusa la distinzione rispetto a structs, enums, string e object.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100