Code generation
Code generation is the production of program code from inputs such as specifications, models, templates, prompts, or program representations, typically through automated transformation.
Coding with AI
Code generation is the automated production of source code from natural-language instructions, existing code, or other structured input.
- How it is used
- Uses AI assistance to generate implementations and scaffolding while developers direct design and integration.
- How deep it goes
- Works through prompting, generated suggestions, revisions, and validation, with a conceptual account of transformer attention.
- Examples
- Demonstrates a Python file reader, text cleaning, and a SQLite connection prompt.
- What you can do after
- Apply it via GitHub Copilot or Blackbox AI, then review and test the generated code.
Building User-Friendly DSLs
The automated production of source code or executable artifacts from a higher-level representation.
- How it is used
- Generates executable JavaScript from a DSL AST, connecting domain-oriented representations to runtime artifacts.
- How deep it goes
- Builds from templates through AST parameterization, helper functions, expression dispatch, and diagnostics; it stops short of a complete runtime.
- Examples
- Uses a Rental class, record-type and attribute ASTs, template helpers, numeric expressions, attribute references, and generator watch commands.
- What you can do after
- Build it from scratch by parameterizing templates, running the generator, and checking generated output against reference code.
Read how Building User-Friendly DSLs explains code generation →
Go in Practice, Second Edition
Code generation is the automated production of program source or implementation code from declarations, schemas, or other inputs.
- How it is used
- Uses generation to replace repetitive typed declarations or repeated runtime reflection with compiled Go code.
- How deep it goes
- Works through a directive, a template-based generator, generated files, and their use in a program.
- Examples
- Builds a typed queue generator and demonstrates generated JSON codec methods and gRPC client scaffolding.
- What you can do after
- Build it from scratch with `go generate` and Go templates, or apply it via `codecgen` to tagged structs.
Read how Go in Practice, Second Edition explains code generation →
Generative AI in Action
Code generation is the computational production of source code by a model from learned programming-language patterns and inputs.
- How it is used
- Augments enterprise developers with function-level code, scaffolding, onboarding support, and automation of repetitive development tasks.
- How deep it goes
- Explains prompt and IDE context, then provides tool-selection and validation guidance without descending into model internals.
- Examples
- Uses a Python OpenAI API greeting and French translation, plus an OAuth2 implementation scenario, to illustrate generation and trust.
- What you can do after
- Apply code generation via GitHub Copilot while reviewing, testing, and verifying suggestions before production.
The Quick Python Book, Fourth Edition
Code generation is the automated production of source code from prompts, specifications, templates, or other inputs.
- How it is used
- Uses AI-generated Python solutions to support exercises and compare them with human-written code.
- How deep it goes
- Describes prompt creation, generation, review, testing, and refinement through worked exercises and corrected outputs.
- Examples
- Uses temperature statistics, word counting, and weather-data filtering to illustrate prompts and generated solutions.
- What you can do after
- Apply it via Google Colaboratory or GitHub Copilot to generate and evaluate Python solutions.
Read how The Quick Python Book, Fourth Edition explains code generation →
ASP.NET Core in Action, 3e
Code generation is the automated production of source code or related artifacts from a higher-level description or specification.
- How it is used
- Automates strongly typed C# API-client creation from OpenAPI descriptions.
- How deep it goes
- Details setup, build integration, client usage, naming, customization, and tradeoffs without explaining generator internals.
- Examples
- Uses a FruitClient to create and retrieve fruit through generated asynchronous methods.
- What you can do after
- Build and apply an NSwag-generated C# client for an OpenAPI-described API.
Read how ASP.NET Core in Action, 3e explains code generation →
Starting Data Analytics with Generative AI and Python
The automatic production of executable source code from prompts, specifications, or other program representations.
- How it is used
- Supports data analysts by translating analytical requests into workflows, visualizations, and executable code.
- How deep it goes
- Explains prompting, IDE integration, and validation practices, but stops short of detailing code-generation internals.
- Examples
- Uses Excel-to-Power BI dashboards, Google Tag Manager and Google Analytics 4 tracking, GitHub Copilot, and financial-product pricing code.
- What you can do after
- Apply it via GitHub Copilot or a conversational model, then test, inspect, and revise generated analytical code.
Read how Starting Data Analytics with Generative AI and Python explains code generation →
Automating API Delivery
Code generation is the automated production of source code or scaffolding from a formal specification or other input.
- How it is used
- Uses an OpenAPI definition as the source of truth for generating API service scaffolding and keeping artifacts aligned with changing requirements.
- How deep it goes
- Walks through a Spring Boot generation command, generated files, and controller behavior without teaching Java or prescribing Spring Boot project structure.
- Examples
- Uses a generated Spring Boot product-catalog service, a product lookup controller, curl responses, and an invalid-UUID error response.
- What you can do after
- Apply it via OpenAPI Generator CLI to generate Spring Boot service stubs, implement endpoint behavior, and regenerate after specification changes.
Introduction to Generative AI, Second Edition
The automated production of source code from a natural-language description, specification, or other input.
- How it is used
- Improves programming productivity through autocomplete, code drafting, documentation, testing, and related software tasks.
- How deep it goes
- Explains prompting, autocomplete, agentic action, and risks, but stops short of implementation details or systematic evaluation methods.
- Examples
- Uses GitHub Copilot, Cursor, Devin, Claude Code, Replit Agent, Windsurf, DiagramGPT, and generated docstrings as examples.
- What you can do after
- Apply it via LLM-assisted programming tools to draft functions, complete code, generate documentation, and visualize code or schemas.
Read how Introduction to Generative AI, Second Edition explains code generation →
gRPC Microservices in Go
Code generation is the automated production of source code from a higher-level specification.
- How it is used
- Turns gRPC service contracts into client stubs that microservices can consume across language boundaries.
- How deep it goes
- Works through compiler flags, generated Go files, client use, and CI automation; defers complete client-server wiring.
- Examples
- Uses an order-creation RPC, its generated Go client, and a tagged workflow for order, payment, and shipping services.
- What you can do after
- Apply it via protoc and GitHub Actions to generate, publish, and consume Go gRPC code.
Read how gRPC Microservices in Go explains code generation →
Quarkus in Action
Generated code is source code produced automatically by a software tool from project settings, templates, or other inputs.
- How it is used
- Uses project settings, extensions, and schemas to bootstrap application resources and communication code.
- How deep it goes
- Explains generated artifacts and triggering commands, but stops short of detailing generator internals.
- Examples
- Uses a generated GreetingResource, Quarkus tests, a Car protobuf model, and InventoryService gRPC stubs.
- What you can do after
- Build generated REST, protobuf, and gRPC artifacts using Quarkus extensions and Maven compilation.
Geometry for Programmers
Code generation is the automatic translation of a representation or formula into source code in a target programming language.
- How it is used
- Turns solved symbolic formulas into executable code for programming and engineering calculations.
- How deep it goes
- Shows API-level translation and output formats, but does not explain code-generation internals.
- Examples
- Uses SymPy equations for Va and Vp, symbolic output, Python code, and printable LaTeX.
- What you can do after
- Build executable formula implementations with SymPy's pycode or language-specific code-generation functions.
Read how Geometry for Programmers explains code generation →
Microservices Patterns, Second Edition
Code generation is the automated production of source code or related implementation artifacts from higher-level specifications.
- How it is used
- Implements API-client message DTOs from interface definitions.
- How deep it goes
- Compares generated, handwritten, and untyped models using effort, correctness, type safety, and coupling.
- Examples
- Contrasts generated DTOs for binary payloads with generated, handwritten, or untyped options for text payloads.
- What you can do after
- Evaluate DTO strategies against development effort, schema correctness, type safety, and design-time coupling.
Read how Microservices Patterns, Second Edition explains code generation →
How Large Language Models Work
Code generation is the automated production of computer-program source code from prompts, specifications, or other inputs.
- How it is used
- Deploys LLMs as coding agents that produce source code and support software-development workflows.
- How deep it goes
- Explains token handling, compilation, unit tests, and incremental syntax checks, but does not detail implementation beyond these validation methods.
- Examples
- Uses Python and Java code, comments, descriptive names, compilation, unit tests, and a Python if-statement syntax check.
- What you can do after
- Diagnoses generated code by compiling it, testing its behavior, and detecting syntax errors during token generation.
Read how How Large Language Models Work explains code generation →
Kafka Streams in Action, Second Edition
Code generation is the automated production of source code or programming-language objects from formal specifications such as schemas.
- How it is used
- Automates schema-to-object conversion during the application build cycle.
- How deep it goes
- Explains tools, input directories, output configuration, compiler selection, and the generation command.
- Examples
- Uses Gradle generation, schema source directories, configured output paths, and a Maven Central protoc compiler.
- What you can do after
- Build it from scratch by configuring Gradle plugins and running a task that generates Java model objects from schemas.
Read how Kafka Streams in Action, Second Edition explains code generation →
Learn Go with Pocket-Sized Projects
Code generation is the automatic production of source or executable code from schemas, specifications, or other input artifacts.
- How it is used
- Generates Go message and gRPC service implementations from Protobuf definitions in a habits-tracker application.
- How deep it goes
- Traces installation, compiler flags, import resolution, output layout, and automation, but stops short of generated-code internals.
- Examples
- Uses protoc commands, generated habit.pb.go and service files, directory trees, and a go:generate directive.
- What you can do after
- Operate protoc and its Go plugins to generate organized message and gRPC service source files.
Read how Learn Go with Pocket-Sized Projects explains code generation →
WordPress Power Toolkit: Harness AI to build next-level websites
Code generation is the production of source code by an automated system from instructions, specifications, or other inputs.
- How it is used
- Speeds the creation and customization of website elements such as HTML tables.
- How deep it goes
- Demonstrates prompt-based HTML generation and iterative formatting, without explaining programming internals.
- Examples
- Uses a five-largest-lakes table and progressively styled column headings as concrete examples.
- What you can do after
- Apply it via Claude to generate, insert, inspect, and refine HTML website elements.
Read how WordPress Power Toolkit: Harness AI to build next-level websites explains code generation →
Building Web APIs with ASP.NET Core
Code generation is the automated production of source code or compiled code from a higher-level specification.
- How it is used
- Automates gRPC client and server stub creation from a protobuf contract during the .NET build.
- How deep it goes
- Explains contract definition, project configuration, service implementation, and endpoint registration without detailing generator internals.
- Examples
- Uses a grpc.proto contract, a csproj Protobuf entry, GrpcService.cs, and Program.cs registrations for a board-game endpoint.
- What you can do after
- Build a gRPC endpoint from a protobuf definition and connect its generated types to application data.
Read how Building Web APIs with ASP.NET Core explains code generation →
Machines that Think
The automated production of source code by a computational system from specifications, examples, or natural-language instructions.
- How it is used
- Shifts software creation from direct implementation toward ordinary-language requests for features and product changes.
- How deep it goes
- Describes the workflow and organizational consequences, but not code-generation implementation mechanics.
- Examples
- Names requests for landing pages, database connections, authentication, dashboards, and interface changes.
- What you can do after
- Build or modify software through ordinary-language requests while recognizing the need to review, test, secure, and maintain the result.
Build High Value Software Systems
The production of source code from a specification, model, template, or other structured input.
- How it is used
- Uses code generation to regenerate an implementation against a feature specification refined through implementation.
- How deep it goes
- Shows a constrained iterative prompt example but does not describe generation mechanics or evaluation.
- Examples
- Uses a payment webhook handler with explicit implementation constraints and scope exclusions.
- What you can do after
- Build a payment webhook handler by regenerating against a refined, implementation-informed specification.
Read how Build High Value Software Systems explains code generation →
Vibe Engineering
The automated production of source code from instructions, specifications, or other inputs.
- How it is used
- Frames automated code production as a starting point whose central engineering task is determining whether the result deserves to exist.
- How deep it goes
- Contrasts easy generation with the harder question of production reliability, without explaining generation internals or verification procedures.
- Examples
- Uses sorting algorithms, REST endpoints, React components, completion accuracy, pass rates, and tokens per second as examples.
- What you can do after
- Evaluate generated code as untrusted output rather than equating rapid production with software quality.
Also covered in
- Crack Any Codebase with AIIn early access (MEAP)
- Investing for Programmers
- Domain-Specific Small Language Models
- Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
- AI Agents and Applications
- Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu
- The Design of Web APIs, Second Edition
- Julia as a Second Language
- Build AI-Enhanced Web Apps
- Write Powerful Rust Macros
- Learn Generative AI with PyTorch
- Acing the Frontend InterviewIn early access (MEAP)
What to know first
- conversational aiConversational AI is artificial intelligence that enables software systems to interpret user input and interact with users through natural-language dialogue.
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- ChatGPTChatGPT is OpenAI’s conversational AI service, which lets users interact with generative AI models and related tools through natural-language prompts.
Related concepts
- interpreteralternative to · An interpreter is software that evaluates or executes a program or instruction representation according to its defined semantics.
- language modelproduced by · A language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- conversational aiproduced by · Conversational AI is artificial intelligence that enables software systems to interpret user input and interact with users through natural-language dialogue.
- GitHub Copilotused by · GitHub Copilot is an AI-powered programming assistant that provides code suggestions, generation, and conversational assistance for software development.
- HumanEvalmeasured by · HumanEval is a benchmark dataset of Python programming problems and tests used to evaluate the functional correctness of generated code.
- macroproduced by · A macro is a named, reusable construct that expands into generated code or a sequence of commands when invoked, often during preprocessing, compilation, or application execution.
Questions about code generation
What is code generation?
Code generation is the production of program code from inputs such as specifications, models, templates, prompts, or program representations, typically through automated transformation.
Which Manning books explain code generation?
Coding with AI, Building User-Friendly DSLs, Go in Practice, Second Edition, Generative AI in Action, The Quick Python Book, Fourth Edition, ASP.NET Core in Action, 3e, Starting Data Analytics with Generative AI and Python, Automating API Delivery and 13 more.
What should I know before learning code generation?
Manning books that teach code generation usually introduce conversational ai, Python, language model and ChatGPT first.
What is the difference between code generation and interpreter?
Code generation is the production of program code from inputs such as specifications, models, templates, prompts, or program representations, typically through automated transformation. An interpreter is software that evaluates or executes a program or instruction representation according to its defined semantics.
What is code generation also called?
Code generation is also called generate code or generating code.
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.




















