X hits on this document





6 / 73

Compiling Code

Once a programmer finishes writing code, it must be compiled. Compiling is the process of converting the lines of code written in a computer language into the native language of a computer program – something it can understand. To compile the code, you need a compiler, which is a special piece of software that converts the source code you create into code that the computer can understand. It also performs other operations, such as checking to make sure there are no logic errors in your code, or syntax errors (which means you may have spelled something incorrectly.)

In modern programming language such as Visual Basic or C#, there are actually a few steps in between writing code and the physical computer receiving instructions. These languages are called “interpreted languages” because they are compiled into an intermediate language that is then interpreted by each type of computer they reside on. They are interpreted by a program called a Virtual Machine which takes the compiled intermediate code and executes it on a particular computer. For example, Java’s claim to fame is the slogan: “Write once, run anywhere.” Java has a separate Virtual Machine that runs on Windows, on Mac, Unix and Linux. This allows a developer to create code once and be assured that the Virtual Machine will determine how to work with the idiosyncrasies of each operating system and computer hardware. Since we are working with Visual Basic and C#, the Virtual Machine is actually called the .NET Runtime.

When you compile your Visual Basic or C# code, it is compiled into a different language called the MSIL, or rather Microsoft Intermediate Language. The compiled code will then reside in a file called an Assembly. Assemblies have an .exe or a .dll file extension. If you were to execute your assembly, it immediately attempts to load the .NET Runtime and the .NET Runtime then becomes responsible for executing the MSIL code.

Supplemental Readings for the Express Edition Videos Copyright © 2005 LearnVisualStudio.NET

Document info
Document views147
Page views147
Page last viewedSat Dec 03 03:13:47 UTC 2016