Appendix K 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:

  1. Its definition should be independent of any particular hardware or operating system. C was originally defined as a language for system software on Unix platforms. However, it has evolved to a language independent of Unix or any specific platform.

  2. Its definition should be standardized, and compiler implementations should comply with this standard. C has followed the standardization path of most languages. First, the language was created and used. As its popularity grew, it began to spawn a number of different dialects. Then, C went through a standardization process, with the main core of the language being standardized. It is common for compiler implementations to support standard C with additional, system-dependent features. This results in the creation of much non-standard C code.

  3. It should support software engineering technology, discouraging or prohibiting poor practices, and promoting or supporting maintenance activities. Because of its original purpose, the easy creation of system software, C has never emphasized support for software engineering technology. As with any language, it is possible to use good software engineering practices with C. However, the language neither prevents nor discourages poor practice, and it, therefore, does not provide good support for maintenance.

  4. It should effectively support the application domain(s) of interest. Although it was originally developed to support system software, C has proven to be a very versatile language, supporting any domain in which it has been tried.

  5. It should support the required level of system reliability and safety. Because of its lack of support for software engineering technology, C provides little support for reliability. Safety-critical systems, those on which human life may depend, are also not effectively supported by C because of its lack of support for software engineering technology. [Cullyer 91] [Pyle 91]

  6. Its compiler implementations should be commensurate with the current state of technology. Because of the language's immense popularity, C compilers continue to be improved using current technology.

  7. Appropriate software engineering-based supporting tools and environments should be available. Again because of its popularity, a wide variety of supporting tools and environments is available for C development. Many of these are little more than tools to support code creation, with minimal support for engineering software. However, many also provide appropriate software engineering-based support.

Language Characteristics

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 supportthe 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 supportthe 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 supportthe 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 >

Sections
1 2 3 4 5 6 7

Appendices
A B C D E F G H J
K L M N P Q R S