---
title: "Discussion on \"Tip: Use AI to refactor one small function at a time\" | Hashnode"
description: "Discussion on \"Tip: Use AI to refactor one small function at a time\". When you ask an AI to “refactor my project,” it usually gets lost.[dev]​Instead, copy just one function or method, paste it into the prompt, and ask for a refactor with very specific constraints, for example:\n\n“Refactor this function to be more reada..."
url: "https://hashnode.com/posts/tip-use-ai-to-refactor-one-small-function-at-a-time/69962b33059418f4890b4c2f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Tip: Use AI to refactor one small function at a time](https://litos.hashnode.dev/tip-use-ai-to-refactor-one-small-function-at-a-time?utm_source=hashnode&utm_medium=feed)

When you ask an AI to “refactor my project,” it usually gets lost.\[dev\]​Instead, copy just one function or method, paste it into the prompt, and ask for a refactor with very specific constraints, for example: “Refactor this function to be more reada...

Feb 18 · 1 min read · litos.hashnode.dev  
Read the article

-   [#programming](https://hashnode.com/tag/programming)

## Written by

[Carlos A Loaiza O](https://hashnode.com/@carlos-andres)

@carlos-andres

  
[View profile](https://hashnode.com/@carlos-andres)

til

## Responses

Comments are turned off for this post.
