Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This is a great way to write software. However, there are a number of shortcomings in implementing encapsulation and information hiding with functions only. It is these drawbacks that C++ tries to eliminate with the introduction of classes.
One drawback is that access functions do not indicate to the maintainer what the designer knows, that these functions belong together and access the same data structure. In the examples in this chapter, I was putting the server functions together into the same listing for everyone to see. A better solution is to put functions isLeft(), isRight(), and symbolsMatch() into one file (functions accessing symbols), and the functions initStore(), isEmpty(), saveSymbol(), and getLast() into another file (functions accessing temporary storage).