I was wondering where do you draw the line between a programming language feature and a platform feature.
For instance, is Linq a C# language feature or a .NET feature. Does the programming language work like a specification for the platform?
I believe the answer, in the case of your example, is both.
The extension methods that enable Linq
are a feature of .Net, the platform. However, the language constructs that are translated into calls to those extension methods are a feature of the C# language. You can use the same extension methods from VB, but you can't use the same language constructs.
In the same way, you can use Linq to XML from both languages, but only VB has XML literals.
That's a difficult line to draw, and LINQ is a good example of this:
Query expressions, implicitly typed variables, and extensions methods are language features in C# and VB.NET,
The specific extension methods which provide the necessary background for LINQ to work are platform features in .NET 3.5 and higher.
LINQ is a .NET feature as it is accessible from all the CLS compatible languages. The yield statement is a C# language feature.
Linq is part of the .Net Framework since the version 3.5
You can find C# specification here.
Hmm, interesting question. .NET really is more like a library, however it's integrated thoroughly into the language that in order to use many features of the language, you're required to include it. So I suppose the defining factor is whether or not you must have .NET included for the feature to exist. In the case of Linq, you have to have .NET included, so I'd say it's just a .NET feature more than a language feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With