C++ generic programming, initially popularized for creating reusable libraries like the Standard Template Library (STL), has recently seen widespread adoption in many C++ projects. The power of templates allows developers to write code that is flexible, reusable, and type-safe, reducing redundancy while ensuring performance. With modern C++ standards (C++11, C++17, and C++20), template programming has evolved, featuring advanced concepts like variadic templates, constexpr, and SFINAE, which help manage complexity. This trend has made generic programming an integral part of contemporary C++ development.
Continue reading “C++ Generic Programming: From Libraries to Core Projects”Tag: oop
OGRE Engine: A Case Study on OOP Principles
OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible 3D rendering engine written in C++ designed to make it easier and intuitive for developers to produce applications utilizing hardware-accelerated 3D graphics. The class library abstracts the details of using the underlying system libraries like Direct3D and OpenGL and provides an interface based on world objects and other high-level classes. Continue reading “OGRE Engine: A Case Study on OOP Principles”
The Key to Successful OOP C++ Project: Stable Abstractions
Robert C.Martin wrote an interesting article about a set of metrics that can be used to measure the quality of an object-oriented design in terms of the interdependence between the subsystems of that design.
Here’s from the article what he said about the interdependence between modules:
What is it that makes a design rigid, fragile and difficult to reuse. It is the interdependence of the subsystems within that design. A design is rigid if it cannot be easily changed. Such rigidity is due to the fact that a single change to heavily interdependent software begins a cascade of changes in dependent modules. When the extent of that cascade of change cannot be predicted by the designers or maintainers the impact of the change cannot be estimated. This makes the cost of the change impossible to estimate. Managers, faced with such unpredictability, become reluctant to authorize changes. Thus the design becomes rigid.
And to fight the rigidity he introduces metrics like Afferent coupling, Efferent coupling, Abstractness and Instability. Continue reading “The Key to Successful OOP C++ Project: Stable Abstractions”