Guidelines for Choosing a Computer Language:|
Support for the Visionary Organization
Appendix K: C
C is a 3GL which is popular for its ease of code creation, efficiency, and availability on a wide variety of platforms, including Unix-based workstations and PCs. It supports all of the usual language features found in a non-object-oriented 3GL (for its object-oriented counterpart, see Appendix L on C++). C is usually associated with the quick creation of cryptic code, although it is possible to create readable C. [Plauger 89] [Rabinowitz 90]Language Criteria
The following assesses C with respect to the language criteria presented in the Criteria for a Good Language section in the main document:
In this section, C is rated with respect to the language characteristics used in Table 2 in the main document [Plauger 89] [Rabinowitz 90]. The ratings range from 0 to 10, where 0 means the language provides no support for the characteristic, and 10 means it provides extensive support. The ratings given below are those provided in Table 2. The reader must bear in mind that the support for a good characteristic in a language does not necessarily mean that it is always used, or used appropriately. Unskilled programmers can write bad code in any language, but a good language facilitates the production of good code by skilled programmers.
Clarity of source code – the extent to which inherent language features support source code that is readable and understandable and that clearly reflects the underlying logical structure of the program.
Although it is possible to write C code which is understandable, it is not common practice to use a verbose, understandable style. C provides cryptic shortcuts that run counter to clarity, and they are commonly used. Rating: 5
Complexity management (architecture support) – the extent to which inherent language features support the management of system complexity, in terms of addressing issues of data, algorithm, interface, and architectural complexity.
C provides the capability to manage complexity through separate compilation of program pieces. It also encourages the use of header files for grouping declarations of external resources used in a compilation unit. However, it provides no consistency checking across compilation units, nor does it provide a mechanism for managing very large software components, such as subsystems. Rating: 5
Concurrency support – the extent to which inherent language features support the construction of code with multiple threads of control (also known as parallel processing).
Although C is often used in concurrent systems, the standard language definition provides no inherent support for concurrency. Note that some dialects of C do support concurrency, but they are not standards. Rating: 0
Distributed system support – the extent to which inherent language features support the construction of code to be distributed across multiple platforms on a network.
C provides no specific support for distributed systems. Rating: 0
Maintainability – the extent to which inherent language features support the construction of code that can be readily modified to satisfy new requirements or to correct deficiencies.
A C programmer must work very carefully to write maintainable code because the language provides little inherent support. Rating: 2
Mixed language support – the extent to which inherent language features support interfacing to other languages.
C will readily use object files produced by any language compiler as it composes an application. This is easy because C requires no consistency checking among these separate files. While that makes the object files easy to use, it does not provide specific support for properly interfacing the languages or for verifying correct exchange of data across the established interface. Rating: 5
Object-oriented programming support – the extent to which inherent language features support the construction of object-oriented code.
C provides no object-oriented programming support. Rating: 0
Portability – the extent to which inherent language features support the transfer of a program from one hardware and/or software platform to another.
The existence of a standard for C makes portability possible. However, common practice does not necessarily adhere to this standard. There are also no inherent language features that facilitate portability, such as the encapsulation of dependencies. The tremendous popularity of C has spawned tools and tool sets that are widely available on many platforms, enhancing portability. Rating: 5
Real-time support – the extent to which inherent language features support the construction of real-time systems.
C was developed as a systems programming language, where real-time performance is required. It is a well streamlined language, inherently supporting real-time system performance and the ability to interact directly with low-level devices. Rating: 7
Reliability – the extent to which inherent language features support the construction of components that can be expected to perform their intended functions in a satisfactory manner throughout the expected lifetime of the product.
C provides little in the way of inherent language features to support reliability. It readily allows inconsistencies to show up in compiled code. Rating: 1
Reusability – the extent to which inherent language features support the adaptation of code for use in another application.
Support for reusability requires support for code clarity, encapsulation, maintainability, and portability. C provides little inherent support for any of these characteristics. Hence, it does not support development reuse on a large scale. On the other hand, reuse of specialized C libraries, such as graphics libraries, is very effective. Rating: 3
Safety – the extent to which inherent language features support the construction of safety-critical systems, yielding systems that are fault-tolerant, fail-safe, or robust in the face of systemic failures.
As noted by [Cullyer 91], C does not provide good support for any safety features. Rating: 0
Standardization – the extent to which the language definition has been formally standardized (by recognized bodies such as ANSI and ISO) and the extent to which it can be reasonably expected that this standard will be followed in a language translator.
C is standardized by both ANSI and ISO. However, there is no reasonable expectation that a C compiler will follow the standard without including additional features. Rating: 5
Support for modern engineering methods – the extent to which inherent language features support the expression of source code that enforces good software engineering principles.
C was not created with support for software engineering in mind, and it provides little inherent support for modern engineering methods. Rating: 1
|< Previous Page||Search||Contents||Tables||Next Page >|