Skip to content

fx-biocoder/oop-in-cpp

Repository files navigation

The Ultimate Guide to Object-Oriented Programming in C++

the ultimate

1.0 Contents

  1. Abstraction
  2. Encapsulation
  3. Inheritance
  4. Polymorphism
  5. Modern C++ Overview
  6. Best Practices

1.1 Scope

This guide provides a comprehensive explanation of Object-Oriented programming in modern C++ (C++17/20). The content has been completely updated to reflect contemporary best practices including:

  • Smart pointers and modern memory management
  • Move semantics and rvalue references
  • Const-correctness and RAII principles
  • Modern constructor patterns and initializer lists
  • Standard Library containers and algorithms
  • Type safety and compiler-assisted correctness

The guide emphasizes pedagogical clarity over so-called "real world examples". Still, it shows current best practices and code patterns.

2. Release notes (2.0.0)

Major Update: Complete modernization to C++17/20 standards with comprehensive improvements.

What's New in This Version:

  • ✅ All code examples updated to modern C++ (C++17/20)
  • ✅ Smart pointers throughout (no more raw new/delete)
  • ✅ Move semantics and rvalue references explained
  • ✅ Const-correctness and RAII principles emphasized
  • ✅ Fully compilable example code in examples/ directory
  • ✅ CMakeLists.txt for easy building
  • ✅ Modern C++ Overview guide for quick reference
  • ✅ Best Practices document with industry patterns
  • ✅ Compilation scripts for all examples

Previous Release (1.0.0):

This was the first edition of this guide. It used outdated C++ patterns that no longer reflect modern best practices.

Topics Covered:

  • ✅ Object-Oriented fundamentals (classes, objects, abstraction)
  • ✅ Encapsulation and access control
  • ✅ Inheritance and class hierarchies
  • ✅ Polymorphism and virtual functions
  • ✅ Move semantics and modern memory management

"I want to help you improve this guide. How can I do it?"

If you have any feedback regarding the contents of this guide, such as corrections or possible additions, please create a new issue here. This will allow me to keep track of future modifications that need to be implemented. I greatly appreciate the valuable feedback I have received from users.

3. Author

  • Facundo Martínez © 2026

4. Licensing

The content of this repository is licensed under CC BY-NC-SA 4.0

If you are interested in using the contents of this repository for commercial purposes, please contact me privately to reach an agreement.

💙 Contributing

I love creating free content for everyone. If my articles and repos were useful to you, please consider supporting me on Github Sponsors, Ko-Fi or PayPal. It would be of great help and I would really appreciate it!

Github-sponsors Ko-Fi PayPal

About

A guide to learn Object-Oriented Programming, written in C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published