When to Code vs Prompt with AI

Is your AI coding workflow causing more friction than flow? Do you wonder when to trust AI and when to just write the code yourself?

This video offers a balanced perspective on "When to Code vs. Prompt with AI" and introduces a practical decision matrix to guide your development workflow.

Intro

AI agents are excellent for prototyping, ideation, and boilerplate tasks. But you also know the frustration: AI frequently gets stuck or misunderstands, forcing you to take over and write code manually. While some might dismiss this as a "skill issue," the reality is that AI isn't infallible, and you shouldn't force an AI workflow in every scenario.

So, how do you decide between prompting with AI and traditional coding? This video provides a balanced perspective and a decision matrix to help you choose the right approach. Ultimately, this decision boils down to a simple question: "Which is greater? Your prompting effort, or your coding effort?" The answer, as you'll see, varies significantly by task.

Common Flutter Tasks

Consider this list of common tasks you might encounter during Flutter app development:

  • Complex charting solutions
  • Text rendering issues
  • Boilerplate (crash reporting, analytics...)
  • Full-stack features
  • Small UI/animation tweaks
  • Pull to refresh
  • IAP + entitlements
  • Writing tests
  • Dense business logic
  • Simple refactors
  • Background tasks + iOS/Android specific
  • Localization
  • Theming system
  • Big refactors
  • Offline caching + syncing
  • Codegen
  • Layout errors
  • One-line bug fixes

The Prompt vs. Coding Effort Matrix

This 2x2 matrix shows which tasks fall in which quadrants depending on their coding vs prompting effort:

Prompt vs. Coding Effort Matrix

Low Prompting Effort, High Coding Effort

This quadrant contains tasks that require minimal prompting but generate a significant amount of code. AI excels here because these tasks often involve pattern recognition and repetition or filling in the blanks. Examples include:

  • Boilerplate code: For features like crash reporting or analytics setup.
  • Writing tests: AI can effectively analyze existing code and generate comprehensive test cases, covering various edge cases.
  • Localization: AI can identify hard-coded strings in the UI and generate correct ARB files for multiple languages, streamlining the setup.
  • Theming systems: AI can plan and implement a robust theming system, for instance, by refactoring hard-coded colors and text styles into a consistent theme.
  • Big refactors: Large-scale code rearrangements that follow clear patterns.

These tasks are not intrinsically hard but are code-intensive, making them ideal for AI to handle.

High Prompting Effort, Low Coding Effort

This quadrant describes tasks that demand very specific and detailed prompting to get the desired result, but ultimately produce minimal code. In these scenarios, direct coding is often more efficient. Examples include:

  • Text rendering issues: Fixing wrapping, ellipsis, or font rendering quirks requires precise explanations of visual problems.
  • Layout errors: Issues like overflows or unbounded heights need visual descriptions, screenshots, and desired behavior specified, often for a single-line fix (e.g., wrapping a widget in Expanded).
  • One-line bug fixes: Such as adding a missing notifyListeners() call.
  • Dense business logic: Algorithms like binary search, while short in code (less than 20 lines), require verbose and precise natural language prompts to describe, often making the prompt less clear than the code itself.

Note the inherent ambiguity of natural language and the fidelity gap that can arise when AI attempts to make precise visual UI changes. If you already understand how to solve the problem, directly editing the code saves time and avoids iterative prompt refinement.

Low Prompting Effort, Low Coding Effort

These tasks are straightforward to describe with minimal prompting and result in a small amount of code. Examples include:

  • Small UI/animation tweaks: Adjusting an animation curve or duration.
  • Adding pull-to-refresh: Wrapping a ListView with a RefreshIndicator and an onRefresh callback.
  • Simple refactors: Minor code adjustments you can do quickly.

For problems you're already familiar with, relying on your own muscle memory is often faster than context-switching to AI, writing a prompt, and waiting. Furthermore, you'll likely trust your own code more.

I also place codegen in this quadrant. While tools like build_runner might generate a lot of code, your human input is minimal (e.g., adding a new property to a data model), and you trust the output because it's a deterministic process.

High Prompting Effort, High Coding Effort

This quadrant encompasses tasks that are significantly complex in terms of specification, planning, implementation, and verification. Working with AI here is rarely a "one-shot" prompt, but rather an iterative and conversational process. Examples include:

  • Offline caching and syncing.
  • Full-stack features.
  • Background tasks with platform-specific (iOS/Android) code.
  • Complex charting solutions.
  • In-app purchases and entitlements.

To succeed with AI on these tasks, several critical steps are needed:

  • Detailed and specific requirements: This is the cost of providing context to AI, and it requires your significant domain expertise. Without it, AI is likely to miss details and go down the wrong path.
  • Break down complex problems: Decompose the main problem into smaller, manageable sub-problems that AI can tackle individually.
  • Ensure maintainability: Follow project standards and conventions.
  • Thorough verification: This is often the most complex part. Debugging AI-generated code can be particularly challenging because you didn't write it yourself, and AI might have introduced subtle errors.

These tasks have a high cost of failure. Careful human oversight and robust guardrails are essential, even with AI assistance.

My AI-assisted coding workflow
My AI-assisted coding workflow

Summary

Before coding with AI, always consider whether your prompting effort or coding effort will be greater. The answer is task-dependent.

Additionally, consider your cognitive load. A short prompt might still require significant mental effort to formulate. A one-line code change in an unfamiliar system can also be cognitively demanding, where AI can assist you in understanding.

Agentic AI vs. Autocomplete

Your choice of tool also depends on the amount of code you need:

  • For a few lines of code, autocomplete and IDE assists are more surgical and efficient.
  • For a lot of code or big changes, agentic AI workflows make more sense. AI can handle heavy lifting (planning, implementation), while you focus on providing good specifications and verifying results.

This mindset is crucial for AI coding in 2025. As AI tools improve, the "high prompting" effort for complex problems will likely decrease, causing the quadrants to shift. What's "high prompt, high code" today might become "low prompt, high code" tomorrow. While AI offers incredible knowledge and speedaccuracy is not guaranteed.

Your human insights, muscle memory, and direct debugging skills remain indispensable. An important skill in this new era is knowing when to code and when to prompt, being selective between full agentic AI mode and autocomplete mode to achieve results more quickly and without frustration.

Happy coding!

Want More?

Invest in yourself with my high-quality Flutter courses.

Flutter In Production

Flutter In Production

Learn about flavors, environments, error monitoring, analytics, release management, CI/CD, and finally ship your Flutter apps to the stores. 🚀

Flutter Foundations Course

Flutter Foundations Course

Learn about State Management, App Architecture, Navigation, Testing, and much more by building a Flutter eCommerce app on iOS, Android, and web.

Flutter & Firebase Masterclass

Flutter & Firebase Masterclass

Learn about Firebase Auth, Cloud Firestore, Cloud Functions, Stripe payments, and much more by building a full-stack eCommerce app with Flutter & Firebase.

The Complete Dart Developer Guide

The Complete Dart Developer Guide

Learn Dart Programming in depth. Includes: basic to advanced topics, exercises, and projects. Last updated to Dart 2.15.

Flutter Animations Masterclass

Flutter Animations Masterclass

Master Flutter animations and build a completely custom habit tracking application.