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

Combining the best of both worlds with the C programming language

Оглавление

High-level languages isolate you from the technical details of programming, but by isolating you from these details, high-level languages also limit what you can do. So, as a compromise between assembly language (which can manipulate the processor) and high-level languages (which isolate you from the details of manipulating the processor), computer scientists created an intermediate language dubbed C.

The idea behind the C programming language is to give programmers the ability to manipulate the processor directly like assembly language, but also give them the chance to ignore these technical details, if they want, like a high-level language.

As a result, a C program doesn’t look as cryptic as assembly language, but it also isn’t as easy to read as a high-level language, as the following C program demonstrates:

#include <stdio.h>int main(void){ printf("Hello World!\n"); exit(0);}

Just by looking at this C program, you can probably figure out that it prints Hello World! on the screen. However, you may see a bunch of cryptic curly brackets, back slashes, and other odd symbols and characters that may make no sense whatsoever. Don’t worry. Just notice how confusing C programs can look while at the same time being somewhat understandable.

Because C lets you directly control the processor like assembly language does, but still write programs that look somewhat understandable and easy to read and write, many operating systems — such as Linux, macOS, and Microsoft Windows — are written all or partially in C.

Beginning Programming All-in-One For Dummies

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