liveBook · Manning

Initialization

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
Uses initialization functions to give supplied objects a defined state, especially when storage is dynamically allocated or arrays cannot have declaration initializers.
How deep it goes
Specifies a naming, argument, null-handling, and return-value convention, then demonstrates allocation wrappers and element-by-element array initialization.
Examples
Uses rat_init, rat_new, and rat_vinit to demonstrate single-object allocation and array initialization.
What you can do after
Build initialization functions and allocation wrappers that follow a consistent pointer and error-return convention.

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 local values and partially initialized objects.
How deep it goes
Explains placement, member initialization, validation, and construction failure through contrasting code listings.
Examples
Contrasts maximum calculations and Person constructors with missing, supplied, and validated values.
What you can do after
Diagnose initialization mistakes by checking first use, meaningful starting values, and constructor coverage.

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 →

Also covered in

What to know first

Related concepts

Questions about initialization

What is initialization?

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

Which Manning books explain initialization?

Modern C, Get Programming: Learn to code with Python, 100 C++ Mistakes and How to Avoid Them, Modern C, Third Edition and Natural Language Processing in Action, Second Edition.

What should I know before learning initialization?

Manning books that teach initialization usually introduce array, exception, function and neural network first.

What kinds of initialization are there?

Kinds of initialization include Kaiming initialization, lazy initialization, map initialization, population initialization and random centroid initialization.

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.