1

I feel this is very commonly misunderstood and I always end up getting confused between the two. When we say CLR feature (.NET feature) or C# feature, are they same or they vary

Edit: I feel most of the folks have misunderstood my question. I am not asking the core difference between C# and .NET, rather was little curious about the feature wise classification. Like garbage collection is a CLR feature or anonymous types are language feature, so on and so forth

Misam
  • 4,320
  • 2
  • 25
  • 43
  • possible duplicate of [What is the different between C# and .Net?](http://stackoverflow.com/questions/2724864/what-is-the-different-between-c-sharp-and-net) – molnarm Mar 20 '13 at 07:42
  • I feel most of the folks have misunderstood my question. I am not asking the core difference between C# and .NET, rather was little curious about the feature wise classification. Like garbage collection is a CLR feature or anonymous types are language feature, so on and so forth – Misam Mar 20 '13 at 12:49
  • I see, your edit helped to clarify that. I cannot undo my duplicate vote, but it wouldn't help much, since most of the close votes are for being "not constructive", probably because of the danger of "extended discussion". – molnarm Mar 20 '13 at 13:42

1 Answers1

7

It's worth being very clear between language features, library features and runtime features.

Some examples:

  • The null-coalescing ?? operator, partial classes and lambda expressions are entirely language features
  • Garbage collection is pretty much a pure runtime feature; the language interacts with it somewhat via finalizers, but that's all
  • Generics are a mixture of a language and runtime feature - although notably the CLR had support for generic variance significantly before F# exposed it. Libraries use generics, of course.
  • Nullable types are a mixture of all three: the CLR needs to know about them for boxing purposes (and struct constraints on generics), the Nullable<T> type itself is defined in the libraries, and the C# language has support for them in various ways (for example using the ? type suffix)
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • @Misam: Does your unacceptance of this answer indicate that you're still looking for more detail? – Jon Skeet Mar 20 '13 at 17:10
  • Yes some more feature classification would be great and that would add to my knowledge. – Misam Mar 21 '13 at 06:43
  • 1
    @Misam: Well I don't really want to go through every feature in the language, runtime and frameworks. I'd be here forever. Do you have anything specific in mind? – Jon Skeet Mar 21 '13 at 06:47
  • Oh yes ! I understand that, I am pretty clear now after going through your 'C# In Depth' site and other resources. Thank you very much Jon for the response and patience :) – Misam Mar 21 '13 at 08:54