Tag: OOP
9 posts
-
Python Classes: Class vs Instance Attributes, super() and the MRO, @property and Dataclasses
How Python classes work: the shared mutable class attribute bug, __new__ vs __init__, super() and the MRO, @property, dataclasses and __hash__.
-
JavaScript Classes | ES6 Class Syntax Explained
JavaScript ES6 classes explained: what class syntax desugars to, getters/setters, static blocks, inheritance, private fields (#), and the this-binding pitfall.
-
Go in 2 Weeks #03: Structs, Methods, Pointer vs Value Receivers and Embedding Instead of Inheritance
No class keyword in Go: structs, methods, pointer vs value receivers, embedding, and NewXxx constructors compared to C++.
-
C++ Virtual Functions: Polymorphism, override, and Pure
Virtual functions in C++: dynamic dispatch, virtual vs non-virtual, pure virtual and abstract classes, virtual destructors, vtables, and slicing pitfalls.
-
C++ static Members: Static Data & Static Functions
Class static members shared by all instances: declaration vs definition, ODR, thread safety, the static init/deinit order fiasco, singletons, factories, and C++17 inline static in headers.
-
C++ Inheritance Design: Access Specifiers, Virtual Destructors, Hiding and Diamonds
C++ class hierarchy design: public vs private inheritance, virtual destructors, virtual calls in constructors, name hiding, slicing and virtual bases.
-
C++ friend Keyword: Access Control and Operators
How friend functions and classes reach private members, why operator<< is usually a friend, friend factories, and when a getter or member is the better choice.
-
C++ Diamond Problem: Multiple Inheritance & Virtual Bases
C++ diamond inheritance explained: why the common base is duplicated, what virtual inheritance really changes (construction, casts, layout, overriders), and when composition or interfaces are the better fix.
-
C++ Classes and Objects: Constructors and Access Control
Learn C++ OOP from scratch: classes, constructors, public/private access, destructors, const member functions, and the Rule of Three/Five with working.