Overview

2 Advantages & Disadvantages of Using a Coding Companion

Large language models are presented as useful coding companions for data engineering because they can speed up everyday development tasks and reduce manual effort. Instead of replacing the engineer, they act as a conversational helper that can generate code, suggest transformations, and support an iterative workflow where prompts are refined until the result is close to what is needed. The chapter frames this relationship as a separation between the AI assistant and the coding environment, which helps developers understand what the model is producing and learn how to evaluate it before execution.

The main benefits come from faster code generation, easier handling of repetitive work, and better support for complex data tasks such as nested JSON processing, SQL query writing, and multi-step transformations. By describing a problem in natural language, a data engineer can quickly get a working first draft and then improve it through feedback. This is especially valuable when dealing with awkward structures or long transformation logic, since the model can help compress the time required to build and revise solutions.

At the same time, the chapter emphasizes important drawbacks: LLMs do not truly understand a project’s schema, business rules, or architecture, and they can produce confident but incorrect output. Hallucinations, context-window limits, and weak awareness of edge cases can lead to invalid methods, missing columns, or SQL that looks correct but fails in practice. Because of these risks, the text stresses that generated code should be treated as a draft, carefully validated against the real system, and always reviewed by a human before being trusted in production.

The AI coding companion mental model: You, the data engineer, interact with a coding companion via prompts and responses, then test and execute code within a separate coding environment. This separation reinforces how AI generates code and supports learning prompt engineering
Reading from bottom to top, this timeline compares the traditional manual steps (left) versus an AI-assisted workflow (right) for API data extraction. The "Without AI" column illustrates the cumulative time and effort required to manually code each part of the task. In contrast, the "With AI" column shows how a well-structured prompt and a few refinements can significantly compress the workflow.
The Pagila Entity Relationship Diagram illustrating relationships between the different objects in the Paglia DVD Store data set

Lab Answers

Note: Due to the probabilistic nature of language models, your AI-generated answers might differ slightly from the code shown here. As long as the results are correct and the logic aligns with the prompt, your solution is valid.

1.

2.

3.

4.

5.

6.

FAQ

What is the main benefit of using a coding companion in data engineering?It helps accelerate coding tasks, reduce manual effort, and streamline the iterative development process.
How do LLM coding companions help with complex data engineering work?They can quickly generate code for tasks like nested JSON handling, API integrations, multi-step transformations, and conditional processing.
What is a key advantage of using an AI companion for repetitive tasks?It can automate repetitive coding work, allowing data engineers to focus on higher-level architecture and logic.
Why is rapid prototyping easier with a coding companion?Because you can describe the task in a prompt and get a first draft of code quickly, then refine it through follow-up prompts.
What is a hallucination in the context of AI coding companions?A hallucination is when the model confidently produces incorrect or misleading information, such as nonexistent functions, wrong columns, or invalid SQL logic.
Why should AI-generated code always be validated before use?LLMs do not truly understand your data, schema, or business rules, so their output can contain subtle errors or incorrect assumptions.
What is one disadvantage of using a coding companion for data engineering?It may generate code that looks correct but fails in practice because it does not know your actual system architecture or business context.
How do context windows limit coding companions?They can only process a finite amount of text at once, so long schemas or prompts may cause the model to forget earlier details or miss key relationships.
Why does the book keep the AI companion and coding environment separate at first?To help learners understand how prompts are interpreted, test AI-generated code independently, and build intuition without relying too early on integrated tools.
What is the best way to work with a coding companion on important tasks?Treat its output as a first draft, use precise prompting, iterate with feedback, and keep human review in place for critical decisions.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Learn AI Data Engineering ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Learn AI Data Engineering ebook for free