yuhattor / copilot-patterns

This document is a compilation of best practices for AI-Native development, curated by our community. Discover useful tips and tricks for leveraging tools to improve your AI development process.

Home Page:https://www.ai-native.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pattern: Making the calculation part independent

yuhattor opened this issue · comments

Description

In the rapidly evolving world of software development, relying on tools like GitHub Copilot can enhance the development process. However, current versions of large language models may have limitations when handling complex calculations. To address this, developers can refactor their code by moving the computation part to another function. This improves code maintainability, readability, and makes it easier to test and develop with AI tools. Imagine a developer building a financial software system who needs to separate interest calculations from the user interface logic. Every time GitHub Copilot rewrites a particular piece of code, verifying that the logic is correct is a very cumbersome task. By separating this complex computation, you create a codebase that can work with a flexible and more durable AI.

https://www.ai-native.dev/docs/refactoring/making-the-calculation-part-independent