Читать книгу Beginning Programming All-in-One For Dummies - Wallace Wang - Страница 69

.NET compatibility

Оглавление

Because Microsoft invented C#, it also invented a special program — the .NET framework. The idea behind the .NET framework is that instead of compiling a C# program into machine language, you compile a C# program into p-code or Common Intermediate Language (CIL), which is similar to the bytecode intermediate file format of Java.

The .NET framework allows you to both

 Run C# programs on any computer with the .NET framework.

 Write programs in multiple languages that all link together through the .NET framework, as shown in Figure 3-5.


FIGURE 3-5: The .NET framework can tie programs, written in multiple languages, into a single program.

By letting you write a program with different languages, the .NET framework lets you use each language’s strengths without forcing you to put up with the language’s weaknesses.

The only programming languages you can use with the .NET framework are languages specifically designed to work with the .NET framework. So, if you want to write a program using a combination of C# and BASIC, you have to find a BASIC compiler that works with the .NET framework, such as Microsoft’s own Visual Basic language.

A final advantage of the .NET framework is that it lets you use event-driven programming to create your UI and then write event handlers in any .NET language, such as C#.

Because C# is similar to C, C++, and Java, you can study C# first and then study the other languages (or vice versa).

For that reason, many programmers prefer to first understand C or C++, and then understand C#.

Beginning Programming All-in-One For Dummies

Подняться наверх