The C Programming Language
C is a general-purpose programming language, and is used to write programs in many different domains, such as operating systems, numerical calculation, graphical application, etc. It is a small language, with just 32 keywords (see [HS95, page
23]). It provides “high-level”
structured-programming constructs such as statement
grouping, decision making, and looping, as well as “low-level” capabilities such as the ability to
manipulate bytes and addresses.
Since C is relatively small, it can be described in a small space, and learned quickly. A programmer can reasonably expect to know and understand and indeed regularly use the entire language [KR88, page 2].
C achieves its compact size by providing spartan services within the language proper, foregoing many of the higher-level features commonly built-in to other languages. For example, C provides no operations to deal directly with mixed objects such as lists or arrays. There are no memory management facilities apart from static definition and stack-allocation of local variables. And there are no input/output facilities, such as for printing to the screen or writing to a file. Much of the functionality of C is provided by way of software routines called functions. The language is accompanied by a standard library of work that provides a collection of commonly used works. For example, the standard function printf() prints text to the screen (or, more precisely, to standard output —which is typically the screen). The standard library will be used extensively throughout this text; it is important to avoid writing your own code when a correct and portable implementation already exists.
Of course, efficiency is also the programmer’s responsibility, but it should not be to the detriment of clarity, see Section 15.1 for further discussion.
No comments:
Post a Comment