C# is a programming language, .NET is a blanket term that tends to cover both the .NET Framework (an application framework library) and the Common Language Runtime which is the runtime in which .NET assemblies are run.
Microsoft's implementation of C# is heavily integrated with the .NET Framework so it is understandable that the two concepts would be confused. However it is important to understand that they are two very different things.
Here is a class written in C#:
class Example { }
Here is a class written in C# that explicitly uses a .NET framework assembly, type, and method:
class Example
{
static void Main()
{
// Here we call into the .NET framework to
// write to the output console
System.Console.Write("hello, world");
}
}
As I mentioned before, it is very difficult to use Microsoft's implementation of C# without using the .NET framework as well. My first Example
implementation above even uses the .NET framework (implicitly, yes, but it does use it nonetheless) because Example
inherits from System.Object
.
Also, the reason I use the phrase Microsoft's implementation of C# is because there are other implementations of C# available.
In addition to Andrew's answer, it is worth noting that:
The distinction between a language, a runtime, and a library is more strict in .NET/C# than for example in C++, where the language specification also includes some basic library functions. The C# specification says only a very little about the environment (basically, that it should contain some types such as int
, but that's more or less all).
C# is a programming language, .NET is the framework that the language is built on.
C# is a strong Object Oriented programming language that is mostly built on the .NET framework.
C# is the airplane and .NET is the runway ;)
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