Day 18 : Some important concepts in C#

 In this blog we are going to learn some important concepts like IL, JIT...

IL :

  • IL stands for intermediate language.
  • This term is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language.
  • Using JIT (Just-in-time) compiler we can use IL on any computer architecture.
  • The IL is the object-oriented programming language used by compilers on .NET framework.
  • The IL includes two-types of instruction set : Base instruction (CPU instructions) and Object-model instructions (high-level).
  • In C# before the code get compiled in machine code it compile in IL code.

How to get IL code :
1) Build the program first
2) Open the program in file explorer.
3) Their is folder named as .dll(dynamic link library) extension which linked with console application.
4) Open the developer command prompt of vs and type "ildasm" and enter We can see a window where we are going to drop the .dll in that window.


4) Click on the console app until we see the void main and open the void main for IL code.


JIT :

  • The JIT stands for Just-in-time.
  • The language specific compiler converts source code to IL and JIT compiler converts IL to machine code.
  • The JIT compiler is used to speed-up the execution.
  • The JIT compiler uses less memory as methods that required at run-time only compiled into machine code.
  • The JIT has three types :
              1) Pre-JIT compiler : The pre-JIT compiler is used to compile all source codes compiled into machine code at same time in a single-cycle.
             2) Normal-JIT compiler : The normal-JIT compiler is used when source code that are required at run-time compiled into machine code at first time. If the methods are not required anymore they are stored in cache for future use.
             3) Econo-JIT compiler : The econo-JIT compiler is used when source code that are required at run-time compiled into machine code. If the methods are not required anymore, they are removed.

Strongly-typed :

  • C# is a strongly-typed language. Means we must declare the type of a variable that indicates the kind of values it is going to store, such as integer, float, decimal etc.

Data type : 

  • Example :
  •                  string a = "Angular";
                     int n = 10;
                     float b = 10.24f;
                     char c = 'A';
                     bool b = true;

Conversion :

  • For conversion of datatype we can use "Convert".


Example :




For more understanding watch below video :


Thank You!!!

Comments

Popular posts from this blog

Day 3 : JavaScript

SQL Concepts-1

ASP .NET Session Management