3 Designing functions

This chapter covers

  • Functions in Python and their role in designing software
  • The standard workflow when interacting with Copilot
  • Examples of writing good functions using Copilot
  • Reasonable tasks for Copilot to solve

One of the hardest challenges for programming novices is to know what a reasonable task is to give to Copilot so that it finds a good solution. If you give Copilot too big of a task, it will often fail in spectacular ways that can be extremely difficult to fix. What, then, is a reasonable task?

This question is important for our use of Copilot but goes far beyond it. Human programmers struggle with complexity too. If experienced software engineers try to write code to solve a problem that’s too complex ...

Get Learn AI-Assisted Python Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.