Appendix L Guidelines for Choosing a Computer Language:
Support for the Visionary Organization

Appendix L: C++

C++ is an object-oriented 3GL based on C. As with C, C++ has become a very popular language for many types of applications. C++ is a much newer language, and it is currently in the process of being standardized. In this assessment of C++, ratings are based on the use of the C++ features of the language [Bar-David 93] [Pohl 94] [Stroustrup 88], as opposed to the use of only the C features. It has become common practice to write C code, run it through a C++ compiler, and call it C++. However, if C code is run through a C++ compiler, the result will still be C, and the language characteristics for C are in Appendix K.

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. As with C, C++ is completely independent of any particular hardware or operating system.

  2. Its definition should be standardized, and compiler implementations should comply with this standard. As with C, 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++ started a standardization process, with the main core of the language being standardized. Because C++ is a relatively new language, its standardization process is not yet complete. It is expected that the C++ standard will be used much as the C standard, and it will be common for compiler implementations to support standard C++ with additional, system-dependent features. This will continue to result 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. Unlike C, the structures and object-oriented features of C++ provide support for the concepts of encapsulation and data abstraction.

  4. It should effectively support the application domain(s) of interest. As with C, 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. Reliability is supported by the object-oriented features of C++. Safety-critical systems, those on which human life may depend, are not effectively supported by C++ because of its lack of support for software engineering technology in its C subset. [Cullyer 91] [Pyle 91]

  6. Its compiler implementations should be commensurate with the current state of technology. As with C, because of the immense popularity of C++, its 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. As with C, 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 [Bar-David 93] [Pohl 94] [Stroustrup 88]. 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 that is understandable, and the object-oriented nature of C++ is supported with understandable syntax, it is not common practice to use a verbose, understandable style for C++ any more than for C. C++ still provides the cryptic C shortcuts that run counter to clarity, and they are commonly used. Rating: 6

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 object-oriented organization and separate compilation of program pieces. Like C, it also encourages the use of header files for grouping declarations of external resources used in a compilation unit. However, it provides neither consistency checking across compilation units, nor a mechanism for managing very large software components, such as subsystems. Rating: 6

Concurrency supportthe extent to which inherent language features support the construction of code with multiple threads of control (also known as parallel processing).

As with C, C++ provides no language constructs to support concurrency. 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.

When C++ is being used to create object-oriented code, the programmer has good object-oriented features to facilitate maintainability. However, the C problem of little inherent support for maintainability still remains in other C++ language features. Rating: 7

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. C++ improves on C with better language constructs for facilitating language interfacing. Rating: 7

Object-oriented programming support the extent to which inherent language features support the construction of object-oriented code.

Unlike C, C++ provides complete support for all aspects of a language generally recognized as making it object-oriented—encapsulation of objects and their operations, inheritance, and polymorphism. C++ also provides support for other programming paradigms, so a C++ program will not necessarily be object-oriented. Rating: 10

Portability the extent to which inherent language features support the transfer of a program from one hardware and/or software platform to another.

C++ does not yet have an existing standard, but, when it does, it will probably not alter the C characteristics in this respect. Common practice will not necessarily adhere to the standard. However, C++ does encourage the encapsulation of dependencies, a feature which facilitates portability. C++ tools and tool sets are also widely available on many platforms. Rating: 7

Real-time supportthe extent to which inherent language features support the construction of real-time systems.

C++ does not significantly alter this characteristic of C. 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++ improves considerably on the language characteristics of C for supporting reliability with features such as encapsulation, as well as improved expression. Rating: 5

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 much more inherent support for these characteristics than C. Rating: 8

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. C++ improves somewhat on these characteristics of C, since it facilitates better expression of abstractions. Rating: 3

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 in the process of being standardized by both ANSI and ISO. However, once completed, 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 created to support object-oriented programming, which provides support for encapsulation and data abstraction. This makes its software engineering support rather one-dimensional, but still substantial. Rating: 7

< Previous Page Search Contents Tables Next Page >

1 2 3 4 5 6 7