Some of the statements about separate compilation follow. Which are correct? Comment on all the answers in the explanation section, including the ones that are wrong.
a) Separate files are a big bother. There is no compelling advantage to separate files.
b) Placing client and class implementations in separate files enhances project development. How?
c) Separate files for interface and implementation enhance reuse. How?
d) Separating interface and implementation can save considerable time. How?
b) Placing client and class implementations in separate files enhances project development. How? , c) Separate files for interface and implementation enhance reuse. How? , and d) Separating interface and implementation can save considerable time. How?
a) There is a grain of truth here, but it is basically incorrect. For small programs, placing all the code in a single file makes the program easier to understand, edit, compile and use. On the other hand, reuse is made much more difficult. This practice exposes the client programmer to the implementation details and the class author to the details of the client’s use. Changing anything will be hard.
b) Separate files: Changing the implementation of either the class or the client code does not require a change in the implementation of the other, so long as the interface stays the same. The client and class development can proceed in parallel.
c) The implementation file needs to be compiled only once. A program that uses the class can #include the interface, compile and link to the precompiled implementation file.
d) You can use the class in other programs without needing to rewrite the class definition or implementation. Unchanged files do not require recompilation. They need only to be relinked. For programs of moderate size, the saving in rewriting time exceeds saving in recompilation time. (For very large programs the reverse may well true. Some Linux kernels (12 MB of source code) on some machines can take overnight to compile completely, but only a few minutes to recompile a small file and link.)
You might also like to view...
In the accompanying figure, the
Answer the following statement true (T) or false (F)
Match the following terms to their meanings:
I. Primary key field II. Dynamic III. Flagged IV. System table V. Field property A. highlighted word or words B. used to keep track of multiple entries in an attachment field C. stored value must be unique D. attribute or characteristic of a field that controls the display and input of data E. data in a database that changes
A(n) ____________________ approach means the designers start by creating a mobile version of the site and then add content and complexity to the site targeted to tablets and desktop computers.
Fill in the blank(s) with the appropriate word(s).
Typing an ordinal followed by a space or a hyphen makes part of the ordinal into a subscript.
Answer the following statement true (T) or false (F)