Skip to content

Cplusplus [the next step]

tsirif edited this page Sep 9, 2014 · 1 revision

General Topics

###1. C++ C++ is the main language used in Pandora. Good knowledge of the language's mechanics and syntax is a must. Developing in C++ and knowing how to write a program in C++ are two different skills, as C++ introduces objects as a code tool for state and flow organizing (http://en.wikipedia.org/wiki/Object-oriented_programming). As a result, object oriented programming skills are needed apart from structured programming skills (http://en.wikipedia.org/wiki/Structured_programming). It also includes generics (http://en.wikipedia.org/wiki/Generic_programming). A program takes full advantage of these features when it correctly uses coding techniques that replace structured programming paradigms with object oriented ones. These techniques are called software patterns (http://en.wikipedia.org/wiki/Software_design_pattern) and their usage helps the developer as it equally serves the program. Advantages and some techniques will be discussed in section 2.

To be able to use these techniques correctly and adopt an object oriented programming style, one must know the virtues and vices of C++ very well. A good tutorial to start studying is on this site: http://www.learncpp.com/ The writer analyzes some tricky issues of C++ in whole paragraphs so it is a good start. Taking care of these issues is important in order to write quality code. Some are being presented below:

Closing this chapter about C++, the reader must be accustomed with all attributes that consist C++. They must know its basics as well as all concepts about inheritance and templates. Finally they should check libraries that are offered to C++ developers in order to make their lives easier. The most basic are:

  • STL which contains the most common data structures (vectors, lists, tuples, pairs, maps etc) in generic form and utilities upon them.
  • Boost which is the bread and butter and headache for a modern C++ developer. It is the bread and butter because it delivers the most common things that a programmer needs in a generic way that C++ does not already have it by default (C++11 and on - among other things - are efforts to make canonical into the language most utilities offered by Boost). It is also the headache because of its bad documentation and not always so clear usage of its thingies. Among all Boost's goods you should take some time and read what function binding is (basically means objectifying functions!) and smart pointers. Smart pointers are pointers whose content is deleted when all users/keepers of the same pointer expire (meaning that there are no more active copies of the smart pointer object) or when you decide to do so. Thus, smart pointer objects provide C++ with a Java notion of a reference-object but without the complexes of the garbage collector system that sometimes arise. You are going to see both function-objects and pointer-objects very often so get used to them.

Next chapter: Software Engineering