well, Typically, the aim of a responsible programmer is to reasonably quickly produce a program that correctly performs its task, does so with reasonable efficiency, and is maintainable. The key to fast development, correctness, efficiency, and maintainability is to use a suitable level of abstraction supported by good libraries. This short paper provides a view of how C++ can be used to support that aim. The aim of this is not to be “advanced”, but to make a couple of simple but important points.
Doing anything significant using only basic language features – that is, without the use of libraries – is unpleasant and unproductive. The key to elegant code and productivity lies in the production and use of libraries. That’s true in any language. C++ provides features, such as classes, class hierarchies, templates, exceptions, and namespaces, to directly support library building and use [Stroustrup,2000]. The design of C++ favors systems programming and applications where performance is essential or where resources must be carefully managed [Stroustrup,1994].
Consider a very simple example: To read an unknown number of characters from a keyboard, file, or network connection, we need to set aside a fixed size buffer, read individual characters into that buffer, check that we are not overflowing our allocation (or we’ll face memory corruptions and could cause security problems), expand the buffer as needed (or truncate the input), and finally report the number of characters read back to the application. Doing all this “by hand” is tedious and error prone. The C++ standard library provides types, such as string and istream (input stream) that makes such operations trivial to write.
source site: http://www.research.att.com/~b s/abstraction.pdf
Answered by
Nidhi Singh
at
4:24 PM on September 05, 2008