In the age of social media and Instagram, people are becoming more and more influenced by the lifestyles they see on social media. This gives a rise to aspirations to attain wealth and live a very comfortable if not a luxurious life. Not everyone is blessed with a good amount of wealth, born in an affluent family or have a high income. It is good to work hard towards your goals and achieve success over time but even though most people want to become wealthy, they just don't get it. We all have seen a prince marrying an ordinary woman in fairy tales. In Korean drama, it is very common to see an extremely rich man marrying an ordinary woman or vice versa. Marrying a rich man/woman can be a shortcut for someone to escape poverty and attain the desired level of wealth and financial freedom. During my consultations, several people come up to me with these questions and through this article I want to guide you to find the best approach for your life based on your planetary placemen
C# is a Managed language and the code you write in C# is called a managed code. A managed language cannot exist without a Managed Runtime. For .NET CLR do this job.
Common Language Runtime (CLR) is the virtual machine component of Microsoft's .NET framework and it manages the execution of .NET programs. A process know as just in time (JIT) compilation converts compiled code into machine instructions which is executed by the CPU.
Common Language Runtime (CLR) is the virtual machine component of Microsoft's .NET framework and it manages the execution of .NET programs. A process know as just in time (JIT) compilation converts compiled code into machine instructions which is executed by the CPU.
A managed code is a computer program code that requires a Managed Runtime, which is Common Language Runtime (CLR) in this case, and it will only execute in the management of CLR. CLR is responsible of taking the managed code and compiling it into machine language in order to execute it.
If the language (or code) is not managed then small operations like memory allocation & realizing must be taken care by the developer only. This will make coding far more complicated & time consuming. With a managed code it is much easier to build programs, test and debug those programs.
Features of Common Language Runtime:
- Automatic Memory Management
- Exception Handling
- Standard Data Types
- Security
A) Automatic Memory Management
Common Language Runtime (CLR) manages the allocation & realizing of memory and the developer need not to write codes to perform memory management tasks while developing applications. The CLR's garbage collector manages everything and it eliminate possibility of common human errors that occurs while writing codes for freeing or allocation of memory.
A contiguous region of address called managed heap is reserved whenever a new process is initialized. Allocating memory from the managed heap is comparatively faster than unmanaged allocation. When the objects are no longer in use then the garbage collector automatically frees up the space.
A contiguous region of address called managed heap is reserved whenever a new process is initialized. Allocating memory from the managed heap is comparatively faster than unmanaged allocation. When the objects are no longer in use then the garbage collector automatically frees up the space.
B) Exception Handling
An Exception is an unexpected behavior or condition which is encountered during program execution. Exception may arise due to any fault in code, unavailability of resources or due to some unexpected conditions encountered during runtime. In .NET, an exception is an object that inherits from System.Exception class and the advantage of .NET is that it allows you to define a syntax according to the exception that may arise and to add code to the application in order to handle that exception & make the application more reliable. If these exceptions are not properly held then the runtime terminates the application.
C) Standard Data Types
Standard types provides a common base for different type of objects like int, double, float & etc. Every variable that is defined in C# is an object holding a value & inherits properties from a standard data type. This is because you need not to define the data type when you start coding rather you use these standard data types. There are three categories of types:
- Value Types - Stores values (int, double, long, etc.)
- Reference Types - Stores reference to a data (int &ref = i;)
- Pointer Types - Holds memory address of other variables (int *ptr = &i;)
D) Security
The CLR and the .NET framework provides a number of useful classes that enables developers to write secure codes & enable system administrators to customize the permissions granted to code so that it can access protected resources.
A managed code is written in high-level languages and when this code is compiled then instead of a machine code we get an Intermediate Language code. The compiler for C# is called CSC (C Sharp Compiler). This Intermediate Language Code is then compiled by the CLR and executed.
C# file (.cs file) is compiled by CSC and you get MSIL (Microsoft Intermediate Language) code and then this MSIL file (.msil file) is compiled by CLR in order to get the .NET executable file (.exe or .dll file) and then this file is executed.
Suggested Articles: