Tagged articles
41 articles
Page 1 of 1
Data STUDIO
Data STUDIO
Mar 31, 2026 · Fundamentals

Why Using = in Python Can Delete Your Data: Common Copy Pitfalls Explained

The article reveals how the Python assignment operator creates references instead of copies, leading to accidental data loss, and walks through safe copying techniques (.copy(), list(), [:]) with concrete examples, performance benchmarks, and guidance for nested structures.

Pythonassignmentdeep copy
0 likes · 8 min read
Why Using = in Python Can Delete Your Data: Common Copy Pitfalls Explained
Deepin Linux
Deepin Linux
Nov 30, 2025 · Fundamentals

When Does C++ Generate a Default Copy Constructor? A Deep Dive

This article explains the role of copy constructors in C++, when the compiler automatically provides a default one, the situations that trigger copy construction, why bitwise copying can be unsafe, and how to implement proper deep‑copy semantics with clear code examples.

CCopy ConstructorDefault Constructor
0 likes · 31 min read
When Does C++ Generate a Default Copy Constructor? A Deep Dive
Code Mala Tang
Code Mala Tang
Sep 30, 2025 · Fundamentals

Master Python Shallow vs Deep Copy: Using copy.copy() and copy.deepcopy()

This article explains Python's assignment operator behavior, demonstrates why it creates shared references rather than true copies, and provides detailed examples of shallow and deep copying using the copy module, including code snippets, output analysis, and practical scenarios such as data processing and game development.

Pythoncopy moduledeep copy
0 likes · 11 min read
Master Python Shallow vs Deep Copy: Using copy.copy() and copy.deepcopy()
Python Programming Learning Circle
Python Programming Learning Circle
Sep 23, 2025 · Fundamentals

Master Python Shallow vs Deep Copy: Avoid Hidden Bugs and Boost Your Code

This article explains the difference between shallow and deep copying in Python, shows why simple copies can unintentionally modify original data, provides visual memory diagrams, demonstrates multiple copying methods with code examples, compares performance, and offers practical guidelines for choosing the right copy technique in real projects.

Memory ManagementPythoncopy module
0 likes · 10 min read
Master Python Shallow vs Deep Copy: Avoid Hidden Bugs and Boost Your Code
Deepin Linux
Deepin Linux
Aug 22, 2025 · Fundamentals

When Does C++ Generate a Default Copy Constructor? Deep Dive and Pitfalls

This article explains what a copy constructor is, when the C++ compiler automatically generates a default copy constructor, and why relying on shallow copying can cause serious bugs, especially with inheritance, virtual functions, and resource‑managing members.

CCopy ConstructorDefault Constructor
0 likes · 39 min read
When Does C++ Generate a Default Copy Constructor? Deep Dive and Pitfalls
Liangxu Linux
Liangxu Linux
May 12, 2025 · Fundamentals

Essential Embedded Concepts: Stack Watermark, Copy Techniques, Sync/Async, Memory Barriers

This article explains key embedded software concepts, including how stack watermark detection tracks maximum stack usage, the differences between shallow and deep copying of data structures, the distinction between synchronous and asynchronous processing, and the role of memory barriers in enforcing operation ordering on weakly consistent architectures.

AsynchronousSynchronousdeep copy
0 likes · 7 min read
Essential Embedded Concepts: Stack Watermark, Copy Techniques, Sync/Async, Memory Barriers
JavaScript
JavaScript
Apr 27, 2025 · Frontend Development

Mastering JavaScript Object Copying: Shallow vs Deep Techniques

Understanding how JavaScript handles object references is crucial, as improper copying can cause unexpected side effects; this guide explains the differences between shallow and deep copies, demonstrates various methods—including Object.assign, spread operator, JSON serialization, lodash, and the native structuredClone API—and offers practical tips for choosing the right strategy.

JavaScriptObject Copyperformance
0 likes · 10 min read
Mastering JavaScript Object Copying: Shallow vs Deep Techniques
Raymond Ops
Raymond Ops
Apr 18, 2025 · Fundamentals

Master Python Class vs Static Methods, Deep/Shallow Copies, and Decorators

This comprehensive guide explains Python’s class and static methods, compares deep and shallow copying techniques, demystifies decorators, and reveals how variables are stored in memory, providing clear examples and best‑practice recommendations for writing efficient, maintainable code.

class methodsdecoratorsdeep copy
0 likes · 13 min read
Master Python Class vs Static Methods, Deep/Shallow Copies, and Decorators
Liangxu Linux
Liangxu Linux
Jan 6, 2025 · Fundamentals

Master Deep vs Shallow Copy in C++ and Follow the Rule of Three/Five

This article explains the concepts of shallow and deep copying in C++, demonstrates their pitfalls such as shared memory and double deletion, and shows how to implement proper copy constructors, assignment operators, and move semantics following the Rule of Three/Five to ensure safe and efficient resource management.

C++Memory ManagementRule of Three
0 likes · 16 min read
Master Deep vs Shallow Copy in C++ and Follow the Rule of Three/Five
Liangxu Linux
Liangxu Linux
Nov 2, 2024 · Fundamentals

When Does Shallow Copy Break? Mastering Deep vs Shallow Copy in C++

This article explains the difference between shallow and deep copying in C++, shows why the default copy constructor can cause double‑deletion when a class holds pointers, and demonstrates how to implement a proper deep‑copy constructor with clear code examples.

C++Copy ConstructorMemory Management
0 likes · 5 min read
When Does Shallow Copy Break? Mastering Deep vs Shallow Copy in C++
Test Development Learning Exchange
Test Development Learning Exchange
Aug 10, 2024 · Fundamentals

Mastering Shallow vs Deep Copy in Python: When and How to Use Them

This guide explains the difference between Python's shallow and deep copy mechanisms, shows the built‑in tools available, and provides ten concrete code examples covering lists, dictionaries, custom objects, tuples, sets and multi‑level nesting to help you choose the right copying strategy for reliable API test automation.

AutomationData StructuresPython
0 likes · 8 min read
Mastering Shallow vs Deep Copy in Python: When and How to Use Them
Satori Komeiji's Programming Classroom
Satori Komeiji's Programming Classroom
Jul 30, 2024 · Fundamentals

Inside Python’s List: C‑Level Implementations of Core Methods

This article walks through the CPython source code that defines list’s built‑in methods—append, insert, pop, index, count, remove, reverse, clear, and copy—explaining how each method is wired into the type object, the underlying C logic, time‑complexity characteristics, and common pitfalls such as reference‑count handling and shallow versus deep copying.

Data StructuresListPython
0 likes · 28 min read
Inside Python’s List: C‑Level Implementations of Core Methods
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Nov 20, 2023 · Fundamentals

Prototype Pattern: Definition, UML Diagram, Implementation, Advantages, Disadvantages, and Use Cases

This article explains the Prototype design pattern, covering its definition, UML class diagram, Java implementation with shallow and deep copy examples, advantages and drawbacks, comparisons with Factory Method and Singleton patterns, and practical scenarios where cloning objects provides an efficient alternative to costly object creation.

Design PatternsJavaObject Cloning
0 likes · 14 min read
Prototype Pattern: Definition, UML Diagram, Implementation, Advantages, Disadvantages, and Use Cases
Python Programming Learning Circle
Python Programming Learning Circle
Jul 27, 2022 · Fundamentals

Understanding Shallow and Deep Copy in Python

This article explains how Python variables reference objects in memory, distinguishes between shallow and deep copying, demonstrates three common copying techniques (slicing, factory functions, and the copy method) with lists and tuples, and shows how to use the copy module for deep copies.

ListPythoncopy module
0 likes · 6 min read
Understanding Shallow and Deep Copy in Python
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
Python Programming Learning Circle
Python Programming Learning Circle
Jul 10, 2021 · Fundamentals

Understanding Shallow and Deep Copy in Python

This article explains Python's shallow and deep copy mechanisms, demonstrates their differences with code examples, visual diagrams, and discusses when to use each approach, highlighting performance and memory considerations in software development.

Pythoncopydeep copy
0 likes · 5 min read
Understanding Shallow and Deep Copy in Python
MaGe Linux Operations
MaGe Linux Operations
Nov 30, 2020 · Fundamentals

Master Python Deep vs Shallow Copy: When and How to Use Them

This article explains why copying data in Python is necessary, distinguishes between assignment, shallow copy, and deep copy, demonstrates each with code examples and diagrams, and summarizes the performance and memory trade‑offs of the two copying methods.

copydeep copyprogramming fundamentals
0 likes · 6 min read
Master Python Deep vs Shallow Copy: When and How to Use Them
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Aug 4, 2020 · Fundamentals

Understanding the Prototype Design Pattern in Java

The article explains the Prototype design pattern in Java, covering its definition, class diagram, implementation with Cloneable, shallow vs deep copying, advantages, use cases, Spring prototype scope, and provides complete code examples illustrating cloning of Sheep, Goat, and Lamb objects.

Design PatternsJavaPrototype Pattern
0 likes · 12 min read
Understanding the Prototype Design Pattern in Java
FunTester
FunTester
May 6, 2020 · Fundamentals

Understanding Shallow vs Deep Copy in Java ArrayList: Code Examples and Pitfalls

This article explains how Java's ArrayList.clone() creates a shallow copy that shares object references, demonstrates the resulting behavior with string and custom object lists, and shows how to implement a deep copy by manually cloning each element, complete with runnable code samples and console output.

ArrayListJavaTutorial
0 likes · 7 min read
Understanding Shallow vs Deep Copy in Java ArrayList: Code Examples and Pitfalls
FunTester
FunTester
Dec 21, 2019 · Fundamentals

Demonstrating Deep vs Shallow Copy in Java Using Heap Dumps

This article explains how to avoid thread‑unsafe statistics collection by copying objects per thread, explores Java deep and shallow copying concepts, provides a concrete test program, and uses JConsole and heap dumps to verify the number of object instances created by each copying method.

Heap DumpJavaMemory analysis
0 likes · 6 min read
Demonstrating Deep vs Shallow Copy in Java Using Heap Dumps
FunTester
FunTester
Dec 19, 2019 · Fundamentals

Deep vs Shallow Copy in Java: Visualizing Object Instances with Heap Dumps

During a rewrite of a performance testing framework, the author explores Java deep and shallow copying, demonstrates memory analysis using heap dumps and JConsole to visualize object instances, and provides sample code illustrating how to clone objects safely across multiple threads.

Heap DumpJConsoleJava
0 likes · 6 min read
Deep vs Shallow Copy in Java: Visualizing Object Instances with Heap Dumps
MaGe Linux Operations
MaGe Linux Operations
Nov 28, 2019 · Fundamentals

Why Python’s [:] List Copy Is Misleading and Better Alternatives

Python’s slice syntax new = old[:] appears to copy a list, but it actually creates a reference to the same object, leading to subtle bugs; this article explains Python’s object model, demonstrates the pitfalls, and presents clearer alternatives such as list(), copy.copy(), and deepcopy.

Slicebest-practicesdeep copy
0 likes · 6 min read
Why Python’s [:] List Copy Is Misleading and Better Alternatives
MaGe Linux Operations
MaGe Linux Operations
Mar 28, 2019 · Fundamentals

Master Python Shallow vs Deep Copy: When and How to Use Them

This article explains Python's object model, the difference between mutable and immutable objects, how references work, and provides clear examples of shallow and deep copying—including when each method should be used to avoid unintended data modification.

ImmutableMutablePython
0 likes · 11 min read
Master Python Shallow vs Deep Copy: When and How to Use Them
Java Captain
Java Captain
Mar 31, 2018 · Fundamentals

Understanding Object Cloning in Java: Shallow vs Deep Copy

This article explains Java object cloning, detailing why cloning is needed, how to implement shallow and deep copies using the Cloneable interface and serialization, and provides comprehensive code examples illustrating the differences and pitfalls of reference copying.

CloneableJavacloning
0 likes · 15 min read
Understanding Object Cloning in Java: Shallow vs Deep Copy
MaGe Linux Operations
MaGe Linux Operations
Mar 6, 2017 · Fundamentals

Understanding Python Assignment, Shallow Copy, and Deep Copy

This article explains how Python handles object assignment, the differences between shallow and deep copying using the copy module, and special cases such as immutable types and tuples, providing clear examples and visual output to avoid common pitfalls.

copy moduledeep copyobject-assignment
0 likes · 6 min read
Understanding Python Assignment, Shallow Copy, and Deep Copy