C# and .NET: language and platform
C# is a programming language: it describes what a program should do. .NET is a development platform that supplies tools for building those programs, a runtime for executing managed code and reusable libraries. You can use C# without learning every .NET library first. Start by writing one instruction that displays a message.
The quoted text is a string (text value). The call to WriteLine displays it and ends the line. System is a namespace, a way to organize related names. Console is a type in that namespace. You do not need to memorize those terms yet.
Expected output (not executed here):
Library is open.Language, tools and runtime
Think of a program as a sequence of instructions. Source code is the text you write, the compiler translates that text into a form the platform can execute, and the runtime provides the environment for managed execution. The software development kit (SDK) contains the compiler and other build tools. An editor or IDE helps you write the text but is not the language itself. For the examples in this chapter, imagine an ordinary console application targeting .NET 10.
More examples
The expression 3 + 4 produces the number seven before the display operation uses it. The program is written in C#; the display operation belongs to the .NET library.
Expected output (not executed here):
7Where this fits
A console program is a useful starting point because it does not require a web server or graphical interface. The same language can also be used for web services, desktop programs, mobile apps and libraries, but each kind of application needs appropriate runtime components and tools. C# and .NET are not interchangeable names: the platform also supports other languages, and a particular .NET application may have operating-system-specific dependencies.
Common mistake
Installing an editor alone does not necessarily install the SDK. When an application cannot build, check that an appropriate SDK is available before changing correct C# source. An existing executable may only need a compatible runtime, depending on how it was published.
Try it yourself
Identify the language, library operation, editor and SDK in a fictional developer setup. Then predict the output of System.Console.WriteLine(8 + 5); without running it.
Continue with Your first console program. The example source is for an ordinary .NET 10 console project; ByteMind C# execution is not established.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
C# and .NET: language and platform — knowledge check
Review the concept before moving on.
Which item is a programming language?
What is the SDK used for?
What does System.Console.WriteLine(3 + 4) display?
Which claim about .NET applications is most accurate?