[ fromfile: libraries-questions.xml id: libraries-questions ]
What is a platform? What platform do you use? What platform can be found in the labs at your school or work place?
What is code reuse? How is it done? What is good about it?
What is the role of a compiler?
What is the role of a linker?
Name three kinds of C++ libraries.
What is CPPLIBS? Why do you need it?
For each of these items, decide whether it would normally be found in a header (.h
) file or an implementation (.cpp
) file and explain why.
Function definitions
implementation - they should be only compiled once, and not included by other modules that use it.
Function declarations
usually the header file, to refer to functions defined in other separate implementation files.
static
object declarations
header files, like most declarations.
static
object definitions
implementation file, just like functions. We do not wish to have redundant storage allocation for statics.
Class definitions
These go in the header file.
Class declarations
header file - usually they are forward declarations.
inline
function definitions
header files - unlike regular functions which can be linked together, inline functions need to be fully defined before they can be used.
inline
function declarations
Header file - Rarely used for member functions except when the declaration is separated from the definition - but kept in the same header file.
Default argument specifiers
header file - default arguments to a function changes the way the function is called. This is the realm of the header file.
What is the difference between a compile time dependency and a link time dependency?
A compile time dependency exists if we need to #include
the header file in order to reuse the symbol. A link time dependency exists if we can get away with just a declaration of the symbol, which requires the linker to be able to find the referenced symbol.
What is a framework? Are you using one?
What is a design pattern? What do most design patterns have in common?
Most design patterns describe how to separate code by responsibility. Each has a pattern name, a description of the problem to which the pattern applies, a description of how the pattern solves the problem, and a discussion of the consequences of employing the pattern.
What is an AntiPattern?
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |