liveBook · Manning

What you will learn in Coding with AI

Examples in Python

by Jeremy Morgan

Chapter by chapter

Chapter 1: Introducing generative AI

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

1.1 Generative AI for coders · 1.1.1 Code generation and autocompletion · 1.1.2 Bug detection and automated fixes · 1.1.3 Documentation generation · 1.1.4 Code refactoring and optimization · 1.1.5 Test case generation and mock data creation · 1.2 Developer tools landscape · 1.2.1 Integrated developer tools · 1.2.2 Standalone tools · 1.3 How does generative AI work? · 1.4 What is an LLM, and why should I care? · 1.5 Why do these tools sometimes get it wrong? · 1.5.1 How LLMs differ from databases · 1.5.2 Training phase problems · 1.5.3 Misinterpreting context · 1.6 The potential of LLMs · 1.7 Generative AI vs. code completion · 1.7.1 Other types of generative AI · 1.7.2 Why coders care about generative AI · 1.8 Project workflow with AI assistance · 1.8.1 Ideation and planning · 1.8.2 Code generation and assistance · 1.8.3 Code review and analysis · 1.8.4 Testing and debugging · 1.8.5 Documentation and content generation · 1.9 Choosing the right generative AI tools · 1.9.1 Data quality and availability · 1.9.2 Integration with development workflows · 1.9.3 Quality assurance · 1.9.4 Keeping up with evolving tools · 1.9.5 Shift in focus · 1.10 Don’t fear the rise of AI · 1.11 Go forth and code! · 1.12 Summary

What you learn in chapter 1 →

Chapter 2: First steps with AI-assisted coding

The chapter introduction recommends starting with generative AI coding tools by choosing one and experimenting.

2.1 What is GitHub Copilot? · 2.1.1 How GitHub Copilot works · 2.1.2 Interacting with GitHub Copilot · 2.2 Common patterns · 2.3 Context is everything · 2.4 What is NLP? · 2.5 A simple Python project · 2.5.1 Preparing your development environment · 2.5.2 Creating the application · 2.5.3 Side quest: Testing the function speed · 2.6 Summary

What you learn in chapter 2 →

Chapter 3: Design and discovery

This introduction explains why planning matters in software design and how ChatGPT can help establish a foundation for an application.

3.1 Getting to know ChatGPT · 3.2 The problem · 3.3 Creating the right prompt · 3.4 Measuring the effect on the design process · 3.5 A design document created with ChatGPT · 3.6 Software design document: HAM radio license practice test application · 3.7 Digging deeper · 3.7.1 System overview (section 2) · 3.7.2 Technical stack (section 5) · 3.8 Generating user stories for our project · 3.8.1 Defining roles in prompts · 3.8.2 The output: User stories document · 3.8.3 Analyzing the output · 3.8.4 User stories document in detail · 3.9 Summary

What you learn in chapter 3 →

Chapter 4: Coding the first version of our application

The chapter introduces the need for a sound application foundation and explains how stubs let developers assemble and run an application before implementing its functionality.

4.1 Stubbing: Building the skeleton of your application · 4.1.1 A simple code example · 4.2 Extracting requirements from the design · 4.2.1 Step 1: Extract the requirements using ChatGPT · 4.2.2 Step 2: Gathering requirements from Gemini · 4.3 Setting up our development environment · 4.4 Flask application structure · 4.5 Stubbing out our application · 4.6 Running our application · 4.7 Summary

What you learn in chapter 4 →

Chapter 5: Using Blackbox AI to generate base code

The chapter introduces AI-assisted application development as a collaboration in which AI speeds up coding while the developer supplies judgment and direction.

5.1 Application development with generative AI tools · 5.2 Setting up the development environment · 5.3 Developing core features · 5.3.1 Creating the database · 5.3.2 Connecting to our database · 5.3.3 Calling our database from the frontend · 5.3.4 Refactoring our Questions class · 5.3.5 Modifying our entry point (App.py) · 5.3.6 Pulling a set of questions · 5.3.7 Creating a test session in the database · 5.3.8 Creating code for the test session · 5.3.9 Generating a question set · 5.3.10 Verifying our test session was created · 5.3.11 Conclusion · 5.4 Summary

What you learn in chapter 5 →

Chapter 6: Generating a software backend with Tabnine

The introduction connects the existing question database to the need for persistent test sessions that keep a test-taker’s questions available.

6.1 Creating a session and our first bug · 6.2 Creating an index page · 6.2.1 Persisting the session · 6.2.2 Refactoring session creation · 6.2.3 Refactoring our question set method · 6.2.4 Creating an end session function that ends the test · 6.3 Summary

What you learn in chapter 6 →

Chapter 7: Building user interfaces with ChatGPT

The chapter introduces AI-assisted UI design as a way to turn a working backend into a usable application and explains why chat-based tools can help plan the frontend.

7.1 Getting our strategy from our AI tools · 7.1.1 ChatGPT Results · 7.1.2 Gemini Results · 7.1.3 Blackbox AI results · 7.2 Creating our templates · 7.3 Describing the flow of our application · 7.3.1 Creating an overall design · 7.3.2 Drafting HTML based on our wireframes · 7.3.3 The final UI for our application · 7.4 Summary

What you learn in chapter 7 →

Chapter 8: Building effective tests with generative AI

The chapter introduces why testing matters and how generative AI can make writing thorough tests faster.

8.1 Why use generative AI for testing? · 8.2 What are unit tests? · 8.3 The tools we’ll use for Python testing · 8.3.1 Github Copilot · 8.3.2 Tabnine · 8.3.3 Blackbox AI · 8.4 Writing unit tests with generative AI · 8.4.1 unittest or pytest? · 8.4.2 Using Copilot for test generation · 8.4.3 Using Tabnine for test generation · 8.4.4 Applying Blackbox AI for test generation · 8.4.5 Which tool should you use for testing? · 8.5 Summary

What you learn in chapter 8 →

Chapter 9: Prompt engineering

The introduction explains why prompt engineering matters for developers using generative AI, while previewing the techniques covered in the chapter.

9.1 Understanding prompt engineering · 9.1.1 Why prompt engineering matters · 9.2 Understanding the anatomy of a prompt · 9.3 Crafting the ultimate prompt · 9.3.1 Prompt engineering principles · 9.4 Fundamental prompt types · 9.4.1 Zero-shot prompting · 9.4.2 Few-shot prompting · 9.4.3 Open-ended prompts · 9.4.4 Constrained prompts · 9.4.5 Using iterative prompts · 9.4.6 Structured prompts · 9.5 Advanced prompt types · 9.5.1 Chain-of-thought prompting · 9.5.2 Recursive prompting · 9.5.3 Context manipulation · 9.5.4 Instruction refinement · 9.5.5 Output control · 9.5.6 Wrap up · 9.6 Prompt techniques for programmers · 9.6.1 Examples · 9.7 Summary

What you learn in chapter 9 →

Chapter 10: Vibe coding with Cursor

The introduction explains vibe coding as conversational, AI-assisted development and positions it as a fast way to prototype without replacing structured practices for important applications.

10.1 What is vibe coding? · 10.2 What is Cursor, and why is it different? · 10.2.1 The interface · 10.2.2 Project-wide context and customization · 10.3 First concept · 10.4 The initial prompt to build our game · 10.5 Cursor basics · 10.5.1 Giving feedback · 10.5.2 Adding context · 10.5.3 Selecting a mode · 10.5.4 Model selection · 10.5.5 MAX mode · 10.6 Results from the first prompt · 10.7 Running our game for the first time · 10.8 Making changes to our game · 10.9 Summary

What you learn in chapter 10 →

Concepts explained in this book

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.