liveBook · Manning

Comparative prompting

As explained in Coding with AI

Comparative prompting asks an AI system to evaluate multiple approaches against specified criteria and explain their tradeoffs.

Comparative prompting asks an AI system to evaluate multiple technical approaches against explicit criteria and explain their tradeoffs before implementation. section 9.6.1

Choosing a data store

Compare MongoDB vs PostgreSQL for our user management system, considering scalability, query complexity, data consistency requirements, and maintenance overhead. section 9.6.1

Apply the technique to decisions that benefit from explicit alternatives and criteria:

  • Ask which design patterns could handle dynamic pricing, then compare Strategy, Template, and Chain of Responsibility before choosing one. section 9.6.1
  • State the dimensions that matter, such as scalability, query complexity, consistency, maintenance, or implementation tradeoffs. section 9.6.1

How Coding with AI covers it

How deep it goes
Demonstrates criteria-driven prompts and tradeoff requests, but stops short of showing generated comparisons or revisions.
Examples
Compares MongoDB and PostgreSQL for user management and weighs design patterns for dynamic pricing.
What it assumes
Assumes a defined technical problem and criteria such as scalability, consistency, complexity, or maintenance overhead.
What you can do after
Evaluate/understand: assess alternatives against stated criteria before implementing a selected approach.
How it connects
Connects technical approach selection with API design, design patterns, refactoring, security, and complexity analysis.

This explainer was generated by Manning's knowledge graph from the text of Coding with AI. The section links point to the parts of the book it draws on.