liveBook · Manning

Initialization

Initialization is the process of establishing initial values or a starting state for a program entity, component, resource, or computation before subsequent operation.

How 5 Manning books explain it

Modern C

An initialization function is a function conventionally responsible for putting a supplied object into a valid initial state.

How it is used
Establishes a known initial state for objects, especially where allocated storage or variable-length arrays cannot use declaration initializers.
How deep it goes
Specifies naming, arguments, null handling, return values, and an element-by-element array routine; does not detail the internals of `rat_init`.
Examples
Uses scalar and designated array initializers, then `rat_init`, `rat_new`, and an array initialization loop.
What you can do after
Build it from scratch: define a consistent `_init` function and use it to initialize allocated objects or arrays.

Read how Modern C explains initialization →

Get Programming: Learn to code with Python

How it is used
Provides starting values for variables, loop counters, program inputs, and object attributes before they are used.
How deep it goes
Defines variable initialization as name binding and shows how `__init__` establishes object attributes through small Python examples.
Examples
Uses arithmetic variables, a minutes-conversion input, a loop counter, a circle’s radius, and an empty stack.
What you can do after
Build it from scratch by assigning starting values to variables and defining initial attributes in a class’s `__init__` method.

Read how Get Programming: Learn to code with Python explains initialization →

100 C++ Mistakes and How to Avoid Them

Initialization is the process of giving a C++ object its initial value or state when it is created.

How it is used
Uses initialization to prevent incorrect calculations, undefined reads, and objects that violate their class invariants.
How deep it goes
Explains declaration placement, primitive initialization, constructor initializer lists, validation, and exception-based construction, stopping short of broader language mechanics.
Examples
Demonstrates maximum over negative values, an uninitialized Person age, required constructor arguments, and validated Person construction.
What you can do after
Build it from scratch by placing initialization near use, requiring constructor state, validating arguments, and rejecting failed construction.

Read how 100 C++ Mistakes and How to Avoid Them explains initialization →

Modern C, Third Edition

Initialization is the process of providing an initial value for a C object as part of its declaration or creation.

How it is used
Establishes objects in a well-defined state when declarations or allocated storage bring them into existence.
How deep it goes
Descends from declaration syntax to storage-duration rules and initialization APIs, while deferring deeper object representations.
Examples
Uses scalar initialization, designated array elements, omitted zero values, and rat-specific initialization functions.
What you can do after
Apply initialization syntax and storage-duration rules, then design consistent initialization functions for allocated data types.

Read how Modern C, Third Edition explains initialization →

Natural Language Processing in Action, Second Edition

Initialization is the process of assigning starting values to a neural network’s states, weights, and biases before training.

How it is used
Uses starting hidden-state patterns to help recurrent networks learn temporal roles during sequence training.
How deep it goes
Explains hidden-state value choices, consistency, sample ordering, and risks of structured seeding without detailing initialization algorithms.
Examples
Uses zeros, ones, value gradients, consistent seeds, random shuffling, and alphabetized equal-length text samples.
What you can do after
Apply it by selecting repeatable hidden-state values and preserving effective sample randomization during recurrent-network training.

Read how Natural Language Processing in Action, Second Edition explains initialization →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.