liveBook · Manning

Chapter 1: Introducing generative AI

What you will learn in chapter 1 of Coding with AI

The introduction presents generative AI as a way for developers to delegate some implementation work while retaining responsibility for higher-level design.

After this chapter you will be able to

Section by section

Introduction

The introduction presents generative AI as a way for developers to delegate some implementation work while retaining responsibility for higher-level design.

Key terms: generative AI tools, code context, implementation details, architecture and design

1.1 Generative AI for coders

Introduces the range of development tasks where generative AI may assist coders, ahead of the detailed sections that follow.

1.1.1 Code generation and autocompletion

This section explains how AI-assisted code generation uses context and developer instructions to speed up coding, while leaving developers responsible for reviewing and testing the result.

Key terms: autocompletion, smart autocompletion, code generation, large language models (LLMs), context, AI-assisted approach, CSV file, review, test

1.1.2 Bug detection and automated fixes

This subsection explains how generative AI can find problems in existing code and suggest fixes.

Key terms: bug detection, security vulnerabilities, performance problems, context, trained models, appropriate fixes

1.1.3 Documentation generation

This section explains why documentation matters and how generative AI can help write it and clarify code.

Key terms: documentation, generative AI, contextually relevant explanations

1.1.4 Code refactoring and optimization

AI tools can help developers review and refactor code by identifying problems and suggesting improvements.

Key terms: refactoring, optimization, redundant code, inefficient algorithms

1.1.5 Test case generation and mock data creation

This subsection explains how generative AI can help developers create test cases and tailored mock data.

Key terms: test cases, mock data, generative AI tools

1.2 Developer tools landscape

This section introduces what AI developer tools do and distinguishes tools integrated into an IDE from standalone tools.

Key terms: Integrated tools, Standalone tools, integrated development environment (IDE), LLMs, generate code, provide suggestions, automate tasks

1.2.1 Integrated developer tools

This section distinguishes integrated coding assistants from general-purpose standalone tools and introduces three integrated assistants used in the book.

Key terms: integrated tools, standalone tools, context, GitHub Copilot, Tabnine, Blackbox AI, code suggestions

1.2.2 Standalone tools

This section describes standalone AI coding tools and compares how developers interact with ChatGPT, Google Gemini, and Copilot Chat.

Key terms: standalone tools, integrated development environments (IDEs), web interface, ChatGPT, Google Gemini, threads, CLI, API, Copilot Chat, agent mode

1.3 How does generative AI work?

Explains how generative coding tools learn patterns from examples, predict code from a developer’s context, and use feedback to improve suggestions.

Key terms: training data, model, patterns, prediction, developer input, context analysis, developer feedback, model adaptation, probabilistic, deterministic

1.4 What is an LLM, and why should I care?

This section explains what an LLM is, how Transformers process text and code, and why attention helps coding assistants make relevant suggestions.

Key terms: large language model, neural network, training, prompt, Transformer, word order, context, self-attention, attention mechanisms, codebase

1.5 Why do these tools sometimes get it wrong?

This section explains why coding LLMs can give confident but incorrect answers and why developers should check their output.

Key terms: LLMs, prompt, learned patterns, prediction, hallucinating, statistical likelihood, skeptical, double-check

1.5.1 How LLMs differ from databases

This section explains why LLMs generate answers rather than retrieve stored ones, and why their output needs verification.

Key terms: LLM, traditional databases, statistical patterns, probabilities, text prediction, probabilistic nature, verify, confidently incorrect

1.5.2 Training phase problems

This section explains how flawed training data can lead an AI model to produce convincing but incorrect code, making developer verification essential.

Key terms: training, statistical patterns, training data, probability calculations, hallucinations, training biases, Python best practices, architectural standards, human oversight

1.5.3 Misinterpreting context

This section explains why AI code generation can misread context and how developers can make their requests clearer.

Key terms: context, domain knowledge, coding standards, architectural patterns, specifications and constraints, code context, error handling requirements, expected inputs and outputs

1.6 The potential of LLMs

This section argues that LLM-based development tools can help developers produce better software faster across many parts of their work.

Key terms: LLMs, development tools, productivity, software quality

1.7 Generative AI vs. code completion

The section distinguishes generative AI from traditional code completion while noting their shared aim of improving developer productivity.

Key terms: generative AI, code completion, IntelliSense, prescriptive

1.7.1 Other types of generative AI

This section explains how generative AI creates content from patterns learned in existing data, illustrates image generation, and notes that different media have reached different levels of maturity.

Key terms: generative AI, traditional AI systems, patterns and relationships, training, text, images, videos, music, voice generation, maturity

1.7.2 Why coders care about generative AI

This section explains how generative AI can help coders work faster through code suggestions, tests, documentation, and natural-language interaction.

Key terms: code completion and suggestion, documentation generation, automated testing, test cases, edge cases, natural language processing, chatbots, prompts, vibe coding, rapid prototyping

1.8 Project workflow with AI assistance

This section explains that AI assistance can make software development faster and improve quality when developers verify its output.

Key terms: AI assistance, verify the output, productivity, repetitive tasks

1.8.1 Ideation and planning

This section shows how to use a chat-based AI tool to explore a project idea, sketch a high-level plan, and begin planning documents before coding.

Key terms: chat-based, plain English, prompts, tech stack, outline, project proposal, feature descriptions, application requirements, high-level objectives

1.8.2 Code generation and assistance

This section explains how AI tools can assist while coding, especially by scaffolding an application, and cautions against using generated code without understanding it.

Key terms: integrated developer tools, scaffolding, code completions, suggestions, code generated, functional, optimal, dangerous

1.8.3 Code review and analysis

This section shows how to ask external AI tools to review code for performance and security issues and use their feedback to improve it.

Key terms: code review, performance, bottlenecks, Gemini, security issues, vulnerabilities, security-focused mindset

1.8.4 Testing and debugging

This section explains how AI tools can help generate tests and suggest ways to investigate errors during testing and debugging.

Key terms: test cases, unit tests, integrated tools, debugging, error message, display information

1.8.5 Documentation and content generation

This section explains how AI tools can draft software documentation and why developers should revise and verify the output.

Key terms: integrated IDE tools, Tabnine, ChatGPT, API documentation, code documentation, human touch, accuracy problems, review

1.9 Choosing the right generative AI tools

Introduces considerations for using generative AI tools that apply to individual contributors and organizational leaders alike.

1.9.1 Data quality and availability

This subsection explains how training-data quality, source, and licensing affect the choice of a generative AI coding tool.

Key terms: corpus, data used for training, open source software, proprietary software, licensed software, legal and copyright matters

1.9.2 Integration with development workflows

This section explains how solo developers and teams can fit AI tools into established coding workflows while accounting for different learning curves.

Key terms: IDE extensions and configurations, AI-generated code, personal coding style, domain-specific knowledge, team conventions, AI assistance, code review processes and standards, proprietary code, consistent access, learning curve

1.9.3 Quality assurance

This section explains why AI-generated code needs the same quality assurance as human-written code, even when AI speeds up development.

Key terms: AI-generated code, code review, QA testing, quality standards

1.9.4 Keeping up with evolving tools

This section explains how to keep up with rapidly changing AI tools without adopting every new feature.

Key terms: latest advancements, new techniques, long-term benefits, churn

1.9.5 Shift in focus

AI tools accelerate a developer’s shift from day-to-day coding toward system design and architecture, raising the question of how quickly developers and teams can adapt.

Key terms: writing code, designing systems and architecture, AI tools

1.10 Don’t fear the rise of AI

The section argues that generative AI will change developers’ work but is most useful as an assistant whose output still needs human judgment.

Key terms: generative AI, augment, boilerplate code, repetitive code, problem solving, context, gut-check, ethical and moral considerations, human touch

1.11 Go forth and code!

The section previews the book’s hands-on project, upcoming AI techniques, and intended learning outcomes.

1.12 Summary

Where this is used later

Concepts explained in this chapter

Chapter 2: First steps with AI-assisted coding →

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.