
Understanding C++
C++ is an object-oriented programming language developed by Dr. Bjarne Stroustrup at Bell Labs in the early 1980s (originally called “C with Classes”). It is a general-purpose programming language that supports multiple programming paradigms, including procedural programming, data abstraction, object-oriented programming, and generic programming.
C++ is an extension of the C language, further enhancing and perfecting it to become an object-oriented programming language. In mainland China, programmers typically pronounce C++ as “C加加”, while Western programmers pronounce it as “C plus plus” or “CPP”.
In 1983, Bjarne Stroustrup from Bell Labs introduced C++. C++ further expanded and refined the C language, becoming an object-oriented programming language. The most popular compilers for C++ currently include Borland C++ 4.5, Symantec C++ 6.1, and Microsoft Visual C++ 2012. C++ introduces some more profound concepts, and the object-oriented concepts it supports allow for a direct mapping of problem space to program space, providing programmers with a different way of thinking and programming compared to traditional structured programming. As a result, it also increases the complexity of the entire language, making it somewhat challenging to master.
C++ was invented and implemented by Dr. Bjarne Stroustrup at Bell Labs in the early 1980s (originally called “C with Classes”). Initially, C++ emerged as an enhanced version of C, starting with the addition of classes and continuously adding new features. Virtual functions, operator overloading, multiple inheritance, templates, exceptions, RTTI, and namespaces were gradually included in the standard.
Object – An object has state and behavior. For example: a dog’s state – color, name, breed; behavior – wagging, barking, eating. An object is an instance of a class.
Class – A class can be defined as a template/blueprint that describes the behavior/state of an object.
Method – Essentially, a method represents a behavior. A class can contain multiple methods. Logic can be written in methods to manipulate data and perform all actions.
Instance Variable – Each object has its unique instance variables. The state of an object is created by the values of these instance variables.
-
OOP: The two parts that programming languages deal with are algorithms and data, and OOP emphasizes data. The class in C++ is a specification used to describe the data format of an object, while the object is a data structure constructed under the class’s specification. Important concepts include: code reuse, access control, polymorphism, inheritance, etc.
Generic Programming: Generic programming means writing code in a way that is independent of any specific type, which can be understood as programming that is independent of specific types. In my limited experience, this is the first time I’ve heard this term; it was not mentioned in the books I studied before. Its goal is the same as OOP programming: to make code reuse and general concepts easier. C++ has various types of data – integers, floating-point numbers, characters, strings, user-defined types, and structures composed of multiple types. For example, to sort different types of data, a sorting function usually needs to be created for each type. Generic programming addresses this issue by extending the language, allowing a single generic function to handle different types of data. C++ templates provide the mechanism to accomplish this task.
The main parts are: compilation and linking. Compilation converts source code into assembly code, generating object code (machine language). Linking combines the object functions with other object code and library code used to generate an executable program.
C++ General Frameworks and Libraries
Apache C++ Standard Library: A collection of algorithms, containers, iterators, and other essential components.
ASL: Adobe Source Libraries provide peer review and a portable C++ source code library.
Boost: A collection of many general-purpose C++ libraries.
BDE: A development environment from Bloomberg Labs.
Cinder: An open-source development community that provides professional-quality creative coding.
Cxxomfort: A lightweight library containing only header files, porting some new features of C++ 11 to C++ 03.
Dlib: A general-purpose cross-platform C++ library designed using contract programming and modern C++ techniques.
EASTL: EA-STL public part.
ffead-cpp: An enterprise application development framework.
Folly: An open-source C++ library developed and used by Facebook.
JUCE: A comprehensive C++ class library for developing cross-platform software.
libPhenom: An event framework for building high-performance and highly scalable systems.
LibSourcey: A C++ 11 evented IO for real-time video streaming and high-performance networking applications.
LibU: A multi-platform utility library written in C.
Loki: A design library for C++, including implementations of common design patterns and idioms.
MiLi: A small C++ library that contains only header files.
openFrameworks: A toolkit for creative coding in C++.
Qt: A cross-platform application and UI framework.
Reason: A cross-platform framework that makes it easier for developers to use Java, .Net, and Python while also meeting their needs for C++ performance and advantages.
ROOT: A comprehensive object-oriented framework that can efficiently process and analyze large amounts of data, used by CERN.
STLport: A representative version of STL.
STXXL: The standard template library for extra-large datasets.
Ultimate++: A rapid application development framework for C++ across platforms.
Windows Template Library: A C++ library for developing Windows applications and UI components.
Yomm11: Open multi-methods for C++ 11.
The most important thing is
to practice and research while learning C++

Editor: Cui Ziheng
Images and Text: Cui Ziheng
Instructor: Yu Jie