Back to Basics - How And Why Learning C# Programming Language

This article is the first of the "Back to Basics" playlist. Its goal is to bring the basic knowledge to start developing with the C# language. Whether you are an experienced developer of another language such as Rust or C++, or a beginner looking to design applications with .net technologies or even games with Unity.

This playlist will be the perfect answer and information hub for beginners and the more experienced to lead your journey into the world of the .net ecosystem, mainly in the C# language.

If you are interested in learning this new language and the huge ecosystem that is .net, sit down, buckle up, and follow me on this fun journey!

History of C#

C# - Home | FacebookIs there have a mascot for dotnet? · Issue #808 · microsoft/dotnet · GitHub

C# is a general-purpose, multi-paradigm programming language. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented, and component-oriented programming disciplines.

Wikipedia

C# is pronounced, "C-Sharp". It is a programming language provided by Microsoft. Anders Hejlsberg is known as the founder of the C# language. 

Note: He is a Danish software engineer who co-designed several programming languages and development tools.<?#/ Note ?>

MSDN

.NET architecture

C# programs run on .NET, a virtual execution system called the common language runtime (CLR), and a set of class libraries. The CLR is the implementation by Microsoft of the common language infrastructure (CLI), an international standard. The CLI is the basis for creating execution and development environments where languages and libraries work together seamlessly.

Source code written in C# is compiled into an intermediate language (IL) that conforms to the CLI specification. The IL code and resources, such as bitmaps and strings, are stored in an assembly, typically with an extension of .dll. An assembly contains a manifest that provides information about the assembly's types, versions, and culture.

When the C# program is executed, the assembly is loaded into the CLR. The CLR performs a Just-In-Time (JIT) compilation to convert the IL code to native machine instructions. The CLR provides other services related to automatic garbage collection, exception handling, and resource management. Code that's executed by the CLR is sometimes referred to as "managed code." "Unmanaged code" is compiled into a native machine language that targets a specific platform.

Language interoperability is a key feature of .NET. IL code produced by the C# compiler conforms to the Common Type Specification (CTS). IL code generated from C# can interact with code that was generated from the .NET versions of F#, Visual Basic, and C++. There are more than 20 other CTS-compliant languages. A single assembly may contain multiple modules written in different .NET languages. The types can reference each other as if they were written in the same language.

In addition to the run-time services, .NET also includes extensive libraries. These libraries support many different workloads. They're organized into namespaces that provide a wide variety of useful functionality. The libraries include everything from file input and output to string manipulation, XML parsing, web application frameworks, and Windows Forms controls. The typical C# application extensively uses the .NET class library to handle common "plumbing" chores.

A tour of C# - Overview | Microsoft Docs

What are the advantages of learning C#

C# is a programming language called "high level" like Java. It is part of the .NET ecosystem. In the computer science universities/university institute of technology in computer science, you will surely learn this language, or Java in order to have a base in the world of development and on the object paradigm (Object Oriented Programming). 

You can develop applications in almost every possible field :

  • whether it is in games with Unity
  • in the web with ASP.NET, Blazor.NET
  • in native applications with UWP, WinForms, WPF
  • in the world of mobile development with Xamarins
  • and now there is a framework to create a cross-platform application only through a single code base with .NET MAUI.

Whether you are on Linux, Windows, or MacOS, you have no excuse to start your journey in this incredible universe.

Moreover, C#.NET has a huge community to support you during your learning, whether it is on :

IDEs and text editors

There is a multitude of IDEs and code editors that you can use to write code in C#; nevertheless, the most popular and used are : 

If you use a VI(M) fork like Neovim, you can have access to the Language Server Protocol Omnisharp, used in the Visual Studio Code; an article will be created on this subject, being myself a VI user.

Whatever else you try, there are extensions everywhere that will allow you to design your .NET powered applications with the best of comforts, although those listed below are the most recommended. 

Recommended resources for learning

There are many resources to learn C#, mostly theoretical or practical, at the time of writing this article, these are the articles that make the most sense to me to learn C#, this list may be updated in the future:

Or maybe you want to learn by doing? Zachary Patten is an associate member of the C# support community on the Discord server. You can find on his GitHub repository, examples of console games created with their renderings available on a site powered by Blazor Web Assembly.

Hello world

using System;
namespace MyApp
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

Hello world in the console template

Console.WriteLine("Hello World!");

same but with the new console template

Good mentions

Advice during your learning process

Although the resources are qualitative to allow you to learn, it is not enough to watch the videos and try to memorize as much information as possible. You must practice!  Try to create something by yourself, create a console game, or create a website or an application. You will likely find yourself blocked, on the verge of collapse and abandonment, but you must not give up! Search for solutions to your problems with Google, and learn how to use the search engine to find answers to your questions very quickly. Learn continuously, look for resources elsewhere, look at the codes of C# gurus, browse open-source resources, and even contribute... Think before you design your application. Take the time to brainstorm with paper and pen. 

Here is a complete guide to learning C#: C# Tutorial For Beginners.


Recommended Free Ebook
Similar Articles