liveBook · Manning

First-class object

Also called first-class citizens

A first-class object is a language value or entity that can be represented, stored, passed, returned, and manipulated like other values.

How 8 Manning books explain it

Learn Concurrent Programming with Go

A first-class object is a value that a programming language allows to be stored, passed as an argument, returned from a function, or otherwise handled like other ordinary values.

How it is used
Uses channels as composable connections for message-passing pipelines and select-based concurrent behavior.
How deep it goes
Defines first-class channels and works through returned streams and a dynamically growing prime-filter pipeline.
Examples
Demonstrates periodic Tick/Tock channels selected together and a prime-number sieve that adds filter goroutines.
What you can do after
Apply it via Go channels to compose reusable stages and change a concurrent program’s channel topology at runtime.

Read how Learn Concurrent Programming with Go explains first-class object →

Secrets of the JavaScript Ninja, Second Edition

A value that can be assigned, passed as an argument, returned, and otherwise handled like an ordinary value.

How it is used
Uses first-class functions to explain why JavaScript functions can be placed where values are needed, including callback arguments.
How deep it goes
Explains assignable, passable, returnable, and invokable functions with code; defers detailed closure and scope mechanics.
Examples
Compares number and function literals in assignments and arguments, then contrasts function declarations with expressions.
What you can do after
Practice/perform it by placing function expressions in assignments, arguments, and return positions.

Read how Secrets of the JavaScript Ninja, Second Edition explains first-class object →

Kotlin in Action, 2E

A first-class function is a function that can be stored in variables, passed as an argument, or returned from another function.

How it is used
Uses functions as values to parameterize behavior, remove duplication, and structure functional-style Kotlin code.
How deep it goes
Defines storing, passing, and returning functions, then works through lambda callbacks and returned calculators and predicates.
Examples
Uses a button click listener, a message-processing pipeline, shipping-cost calculators, and contact-list predicates.
What you can do after
Apply it via Kotlin lambdas and function types to pass or return behavior for callbacks, calculators, and filters.

Read how Kotlin in Action, 2E explains first-class object →

Functional Programming in JavaScript

A function value that can be assigned, passed as an argument, and returned like other values in a language.

How it is used
Uses functions as reusable values for composing functional JavaScript and passing parameterized behavior.
How deep it goes
Defines function objects, variables, properties, constructors, and arguments, then stops short of detailed execution internals.
Examples
Demonstrates variable assignment, object methods, Function constructors, sorting callbacks, operation arguments, and returned functions.
What you can do after
Apply it by passing operations, selectors, printers, and callbacks into reusable JavaScript functions.

Read how Functional Programming in JavaScript explains first-class object →

Secrets of the JavaScript Ninja, Third Edition

A value that can be assigned, stored, passed as an argument, and returned from a function.

How it is used
Treats JavaScript functions as values that can be assigned, passed, and returned.
How deep it goes
Explains function expressions and their placements, while deferring scope and identifier-resolution questions.
Examples
Uses functions assigned to variables, passed as arguments, returned from functions, and invoked with call or apply.
What you can do after
Apply functions as arguments or return values, and set their invocation context with call or apply.

Read how Secrets of the JavaScript Ninja, Third Edition explains first-class object →

Functional Programming in Scala, Second Edition

A first-class value is a value that can be represented, returned, stored, passed to functions, and otherwise manipulated like other values.

How it is used
Separates business logic from payment effects so purchases and charges can be reused and tested independently.
How deep it goes
Demonstrates representation, reuse, aggregation, and function passing, but does not develop the general theory of first-class values.
Examples
Uses Coffee, Charge, buyCoffee, buyCoffees, and coalesce to demonstrate explicit and combinable values.
What you can do after
Apply first-class values to separate effects, compose collection operations, and write reusable testable business logic.

Read how Functional Programming in Scala, Second Edition explains first-class object →

Learn Haskell by Example

A first-class function is a function that can be treated as a value, including being passed, returned, named, stored, or composed.

How it is used
Uses functions as reusable values for composing declarative programs and passing transformations between operations.
How deep it goes
Explains passing, returning, naming, storing, and composing functions, then demonstrates composition in GHCi and CSV output.
Examples
Uses a cake recipe analogy, GHCi composition expressions, composed function lists, and a CSV file-writing pipeline.
What you can do after
Apply function composition and partial application to build concise transformation pipelines, including CSV output actions.

Read how Learn Haskell by Example explains first-class object →

Data-Oriented Programming: Reduce software complexity

A first-class citizen is a value or language entity that can be represented, stored, passed, and manipulated in the same general ways as other values.

How it is used
Uses first-class data and fields to support generic manipulation, debugging, and reproducible database-backed behavior.
How deep it goes
Defines the idea through data collections, fields, late binding, and a worked REPL reproduction, without formal language-runtime internals.
Examples
Demonstrates captured catalog data, reproduced book-search calls, and a failing then improved 'Habit' query.
What you can do after
Diagnose/debug with it by capturing data arguments, reproducing calls in a REPL, and iterating against concrete database data.

Read how Data-Oriented Programming: Reduce software complexity explains first-class object →

Also covered in

What to know first

Related concepts

Questions about first-class object

What is first-class object?

A first-class object is a language value or entity that can be represented, stored, passed, returned, and manipulated like other values.

Which Manning books explain first-class object?

Learn Concurrent Programming with Go, Secrets of the JavaScript Ninja, Second Edition, Kotlin in Action, 2E, Functional Programming in JavaScript, Secrets of the JavaScript Ninja, Third Edition, Functional Programming in Scala, Second Edition, Learn Haskell by Example and Data-Oriented Programming: Reduce software complexity.

What should I know before learning first-class object?

Manning books that teach first-class object usually introduce functional programming, function, lambda and JavaScript first.

What is the difference between first-class object and arithmetic operator?

A first-class object is a language value or entity that can be represented, stored, passed, returned, and manipulated like other values. An arithmetic operator is a programming-language operator that performs a numerical calculation on one or more operands.

What kinds of first-class object are there?

Kinds of first-class object include function and channel.

What is first-class object also called?

First-class object is also called first-class citizens.

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.