Initialization
The process of establishing initial values or a starting state for a program entity, component, resource, or computation before subsequent operation.
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.
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.
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
- Advanced Algorithms and Data Structures
- Grokking Data Structures
- Build a Robo-Advisor with Python (From Scratch)
- Optimization Algorithms: AI techniques for design, planning, and control problems
- The Well-Grounded Rubyist, Fourth Edition
- Evolutionary Deep Learning: Genetic algorithms and neural networks
- C# Concurrency: Asynchronous and multithreaded programming
- 100 Java Mistakes and How to Avoid Them
- Deep Learning with PyTorch, Second Edition
- Quarkus in Action
- Machines that ThinkIn early access (MEAP)
What to know first
- arrayAn array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
- exceptionAn exception is a runtime signal or value representing an abnormal condition that interrupts ordinary program flow and can be handled or propagated.
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- neural networkA neural network is a computational model composed of interconnected, parameterized units or transformations that learn to map inputs to outputs.
Related concepts
- static storageconfigured by · Static storage duration is the storage duration of an object whose lifetime extends throughout program execution.
- lazy initializationincludes · Lazy initialization is a technique that postpones creating, retrieving, computing, or loading a value or resource until it is needed.
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.




