Overview – An Interesting Framework
C# is an OOP programming language, which is developed by Microsoft. It can be a bit boring if we just talk about the language itself. When I started learning to program, I always asked myself what I can do with this language or Framework.
With the Framework, it begins with a general discussion of the .NET Framework. .Net Framework does develop not only the application on the Windows platform but also other operating systems, such as Mac OS. For example, Mono is an open-source version of the .NET Framework, which can be installed and ran on both Windows and Mac OS.
Another exciting part of the .NET Framework is, there is no restriction on the type of application development, for examples, desktop application, Web API, etc.
Furthermore, .NET Framework is designed so that it can be used from any language, such as C#, C++, Visual Basic and so on. One powerful of .NET Framework is, codes, which are written in different languages, can communicate with each other. Such as, a C# developer can make use of the code written by Visual Basic or C++ programmer.
.NET Standard & .NET Core
Both .NET Standard and .NET Core are industry accepted open-source concept in development. .NET Core is the most optimal solution for cross-platform code development, and .NET Standard is a class library that exposes APIs that support any fork of an application using the .NET platform.
CIL & JIT
When we compile our code, we don’t immediately create an operating system-specific native code. Instead, we compile our code into Common Intermediate Language (CIL). Our compiler, such as Visual Studio, takes care of this step.
When we need to compile our code from CIL into operating-system-specific native code, Just In Time (JIT) compiler takes charge of this process. The native code is specific to the OS and machine architecture. As a developer, we don’t usually worry about CIL and JIT on our daily development, unless we are dealing with very critical or too advanced code.
The CIL (Common Intermediate Language) code is stored in an assembly when we compile an application.
Assemblies include three types of files:
- Executable Application File (The file has a .exe file extension)
- Library File (The file has a .dll file extension)
- Metadata (Sound, Picture or any other resource file)
The procedure of C# Code
The C# code that compiled into CIL doesn’t need to be contained in a single file. Instead of a single file, multiple files can be then compiled into a single file. This process is called linking, which is very useful.
With linking, we can split one code file into several files. These divided files can work independently and get assembled together when needed.
Garbage Collection enables the .NET method to inspect our computer’s memory periodically. As a result, unnecessary objects will be removed from our memory.