liveBook · Manning

Call by value

Call by value is a parameter-passing semantics in which a called operation receives its own copy of an argument’s value.

How 3 Manning books explain it

Object-Oriented Software Design in C++

A parameter-passing mechanism that initializes a function parameter with a copy of the argument value.

How it is used
Uses parameter passing to expose hidden copies and explain poor performance in vector-based C++ code.
How deep it goes
Traces copy construction, vector growth, allocation, and destruction, then stops short of a complete alternative design.
Examples
Demonstrates Date arguments passed to append and Appointments passed to print, using instrumented lifecycle output.
What you can do after
Diagnose performance problems by identifying unexpected copies, allocations, and destructions in instrumented C++ programs.

Read how Object-Oriented Software Design in C++ explains call by value →

Go by Example

Pass-by-value is a parameter-passing semantics in which a function receives a copy of each argument's value.

How it is used
Uses copied Result values to process synchronous API results without unnecessary shared state.
How deep it goes
Explains value-versus-pointer semantics, mutation, goroutine isolation, allocation, stack use, caching, and garbage-collector trade-offs.
Examples
Uses Result, Send, SendN, yield, Results, and Summarize to demonstrate copied values in a result-processing pipeline.
What you can do after
Evaluate whether functions should receive Result values or pointers based on mutation, isolation, allocation, and garbage-collection concerns.

Read how Go by Example explains call by value →

100 Go Mistakes and How to Avoid Them

A value copy is an independent value produced by copying another value rather than referring to the original value.

How it is used
Diagnoses failed mutations in Go range loops and guides the choice between value, index, and pointer access.
How deep it goes
Explains struct and pointer copying, then stops at practical slice-update patterns rather than language-runtime internals.
Examples
Uses account balances to contrast ineffective value-variable mutation with indexed and pointer-based updates.
What you can do after
Apply value-copy rules to choose a loop form that predictably mutates or preserves slice elements.

Read how 100 Go Mistakes and How to Avoid Them explains call by value →

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.