Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

language feature vs framework feature

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?

like image 897
ilias Avatar asked Nov 03 '10 10:11

ilias


5 Answers

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.

like image 122
Andrew Cooper Avatar answered Nov 14 '22 23:11

Andrew Cooper


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.

like image 21
Frédéric Hamidi Avatar answered Nov 14 '22 22:11

Frédéric Hamidi


LINQ is a .NET feature as it is accessible from all the CLS compatible languages. The yield statement is a C# language feature.

like image 39
Darin Dimitrov Avatar answered Nov 14 '22 23:11

Darin Dimitrov


Linq is part of the .Net Framework since the version 3.5

You can find C# specification here.

like image 2
Service Informatique Avatar answered Nov 14 '22 23:11

Service Informatique


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.

like image 1
Neil Avatar answered Nov 14 '22 22:11

Neil