Tagged articles
4 articles
Page 1 of 1
Deepin Linux
Deepin Linux
Aug 28, 2025 · Fundamentals

Unraveling C++ static: From Variables to Destruction Order

This article explains the many roles of the C++ static keyword—how it affects variables, functions and class members—then dives deep into static object lifetimes, destructor rules, destruction order across translation units, common pitfalls such as resource‑dependency bugs, memory leaks and multithreading issues, and finally offers practical solutions and interview‑style questions.

Cdestructorinitialization-order
0 likes · 28 min read
Unraveling C++ static: From Variables to Destruction Order
Liangxu Linux
Liangxu Linux
Mar 5, 2025 · Fundamentals

What Hidden Functions Does C++ Auto‑Generate for Your Classes?

This article explains the seven default special member functions that C++ automatically provides for a class—including constructors, destructors, copy/move operations and address‑of operators—showing when they are sufficient, when they can cause problems such as shallow copies or double frees, and how to implement custom versions to ensure correct resource management.

C++Constructorcopy semantics
0 likes · 17 min read
What Hidden Functions Does C++ Auto‑Generate for Your Classes?
php Courses
php Courses
Jan 2, 2025 · Backend Development

Understanding Constructors and Destructors in PHP

This article explains the purpose, syntax, and practical examples of PHP constructors (__construct) and destructors (__destruct), demonstrating how they initialize objects, manage resources, and simplify code through automatic execution during object creation and destruction.

ConstructorOOPPHP
0 likes · 8 min read
Understanding Constructors and Destructors in PHP
Qunar Tech Salon
Qunar Tech Salon
Jun 11, 2019 · Fundamentals

Understanding Python __init__ and __del__ Methods: Constructors, Destructors, and Resource Management

This article explains how Python uses the special __init__ and __del__ methods to emulate constructors and destructors, discusses the language's reference‑counting garbage collector, demonstrates common pitfalls with __del__, and presents safer alternatives such as context managers and weak references for resource cleanup.

PythonResource Managementcontext manager
0 likes · 7 min read
Understanding Python __init__ and __del__ Methods: Constructors, Destructors, and Resource Management