Tagged articles
3 articles
Page 1 of 1
Baidu Geek Talk
Baidu Geek Talk
May 19, 2022 · Fundamentals

Singleton Design Pattern: Implementation and Practical Applications

The Singleton design pattern guarantees a single, globally accessible instance, reducing memory overhead and global variables, with eager (init) and lazy (sync.Once) thread‑safe implementations in Go, and practical uses such as configuration management in Python, shared DB connections in PHP, and UI components like toasts in JavaScript.

Design PatternsGo ProgrammingJavaScript Programming
0 likes · 16 min read
Singleton Design Pattern: Implementation and Practical Applications
Byte Quality Assurance Team
Byte Quality Assurance Team
Oct 13, 2021 · Fundamentals

Understanding Python Object Assignment, Mutable vs. Immutable Types, and Shallow vs. Deep Copying

This article provides a comprehensive guide to Python's memory management and object assignment mechanisms, clearly explaining the differences between mutable and immutable objects, direct assignment, shallow copying, and deep copying through practical code examples and visual diagrams.

Data StructuresImmutable ObjectsPython Programming
0 likes · 7 min read
Understanding Python Object Assignment, Mutable vs. Immutable Types, and Shallow vs. Deep Copying