C# Programing
Fundamentals
Fundamentals
  • C# Fundamental concepts
    • Introduction to C#.NET
    • Variables and Types
    • User Input
    • Strings
    • Methods
    • Date and Time
    • Conditions
    • Loops
    • Arrays
  • Problem based learning
    • P1: Arithmetic Calculator
    • P2: Number Guessing
    • P3: Print Patterns
    • P4: Grade Average
    • P5: Calculate Age
  • Practice Problems
    • W3Schools
    • Edabit
Powered by GitBook
On this page
  • What is .NET?
  • Why use C#?
  • Versions
  • Check installation
  • Tools
  • How is a C# program compiled to an executable?
  • Structure of a C# program
  • Our first C# program
  1. C# Fundamental concepts

Introduction to C#.NET

NextVariables and Types

Last updated 1 year ago

What is .NET?

.NET is a free, cross-platform, open source developer platform for building many different types of applications. With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, and IoT. There is no specific reason as to why the name “.NET” was chosen for this framework! You can write .NET apps in C#, F#, or Visual Basic. NET that contains over 90,000 packages! You can read on why developers need to choose .NET over other frameworks. You can also read more about .NET .

Why use C#?

C# is a statically typed programming language which lets us write code that runs atop Microsoft's .NET framework. C# has more features and capabilities than Java. C# is object oriented and its syntax is very similar to Java. We could also use Visual Basic (VB) to write .NET apps, but C# is more popular because of it resemblance to C, C++ and Java!

Versions

The first version of C# was in the year 2002, with the first version of .NET also. C# and .NET have independent version numbering, since both are constantly updated with new features, performance enhancements and bug fixes.

The latest versions (as of Dec 2023) are:

  • C# 12.0

  • .NET 8.0

  • Visual Studio 2022 17.8.2

  • You can find more information .

Prior to .NET version 5, the platform was usable only on Windows OS. (Read )

Check installation

We can check which version is installed, by using the below command:

dotnet --version

Tools

How is a C# program compiled to an executable?

Structure of a C# program

Our first C# program

Here is a simplified program to begin with:

using System;

class Program
{
    static void Main()
    {
        Console.WriteLine("Hello, world!");
        //todo - print another line saying I love computers      
    }
}

For several years, Visual Studio (by Microsoft) was the only viable tool required to develop .NET applications. When we install it, all other things like .NET SDK, Runtime, Servers, Data Tools etc. are also installed. Now we can use VS Code . VS code is a more modern and light weight approach to developing code, not just C# based, we could use it for virtually anything!

Even today the community edition of Visual Studio gives a better, full-fledged, productive and integrated atmosphere for .NET app development. You can read more .

Download VS 2022 Community installer from .

For a detailed explanation, follow link.

more
here
here
more
also
here
here
this