Tagged articles

default initialization

2 articles · Page 1 of 1
Golang Shines
Golang Shines
Aug 6, 2026 · Fundamentals

Understanding Go's Zero Values and Default Initialization

The article explains Go's zero‑value concept, why every variable gets a deterministic default, provides a complete table of zero values for basic and composite types, shows how standard library types are "zero‑value useful", demonstrates designing your own zero‑value-friendly types, and discusses nil semantics, new vs make, and common pitfalls with practical code examples.

Design Patternsdefault initializationdefensive programming
0 likes · 21 min read
Understanding Go's Zero Values and Default Initialization
ITPUB
ITPUB
Apr 27, 2016 · Fundamentals

Why new T[10] Differs on Windows vs Linux: Default vs Value Initialization in C++

The article explains why allocating an array with new sample[10] yields zero‑initialized memory on Linux but uninitialized memory on Windows, clarifies the difference between default and value initialization in C++, and shows how various new expressions behave with concrete code examples.

C++cross‑platformdefault initialization
0 likes · 10 min read
Why new T[10] Differs on Windows vs Linux: Default vs Value Initialization in C++