r/intersystems • • 16d ago

Coding with Generative AI: Four Rules Worth Considering

Generative AI is changing how developers write code, from intelligent autocomplete to AI-enabled IDEs that can create substantial parts of an application. But as these tools become more capable, an important question remains: how much development work should we delegate to AI, and what are the long-term consequences?

In this article, I share my thoughts on coding with GenAI and the four rules for it I think are worth considering.

The Risks of Relying on GenAI for Coding

Modern AI-enabled IDEs can take on coding tasks traditionally assigned to entry-level developers, especially in mainstream programming languages such as Python. However, relying on AI-generated code comes with several risks.

One major concern is technical debt. AI can generate large amounts of code that may contain serious flaws. Even more concerning is code that appears mostly correct but contains small problems that are difficult to detect.

Another risk is the impact on developers' skills and professional growth. If AI increasingly handles foundational programming tasks, how will early-career developers build the knowledge and practical experience needed to become senior engineers and software architects?

So, reflecting on the growing reliance on GenAI in software development, I came up with four rules that may help mitigate these risks.

Rule 1: Keep AI-Generated Code Within Your Expertise

Don't use GenAI to perform work that exceeds or approaches the limits of your own understanding. Think of AI-assisted coding as delegation. You should be able to perform the delegated task yourself and evaluate whether the result is correct. For developers at different experience levels, this leads to different approaches:

  • Interns and entry-level developers: Avoid using AI to generate new code that would otherwise be part of your own development work. Using it as an advanced search tool is fine, and intelligent autocomplete may also be appropriate.
  • Senior developers: Delegate simpler coding tasks in technologies where you already have substantial expertise. Review the output as you would review code written by an entry-level developer.

I've used Windsurf for AI-assisted development and found it helpful in this context. It lets me provide rules and guidance that the assistant can remember and follow. However, much like an entry-level developer, it can occasionally apply those instructions in the wrong context.

The important distinction is between delegating work you understand and depending on AI to perform work you cannot reliably evaluate or do yourself.

Rule 2: Clearly Attribute AI-Generated Code

When GenAI produces a substantial amount of code, make its involvement explicit. That means identifying AI-generated contributions in:

  • Commit messages.
  • The code itself.
  • Associated human-readable documentation.

Attribution helps reviewers understand the origin of the code. Instead of assuming it reflects your expertise, they can review it with greater caution towards AI-specific mistakes. It also helps future maintainers assess the code.

And there is another consideration: future AI training datasets. Identifying AI-generated code may help those assembling training data distinguish human-written material from model-generated output. This relates to concerns about model collapse, where training successive models on generated data can introduce irreversible defects.

Rule 3: Use AI for Guidance When Your Goal Is Learning

AI assistance can make development faster, but completing a task and learning how to complete it are different objectives. When the primary goal is to learn something new or reinforce existing programming skills, doing the work yourself is more valuable.

One feature I'd like to see in AI-enabled IDEs is a dedicated learning mode. Rather than generating the code, the assistant would observe the developer's work and offer guidance. But even without a specific IDE feature, developers can choose to interact with AI this way: asking for explanations and feedback instead of requesting complete implementations.

For example, GenAI could make specific programming languages, such as ObjectScript, easier to learn. Developers could use its guidance to become familiar with a new language and build their skills.

Rule 4: Reflect on the Impact of AI on Your Work

It's easy to get lost in deliverables, deadlines, and the amount of code being produced without considering how AI assistance affects your work and skills. Take time to reflect on both.

Some useful questions to think of:

  • Is this technology making my life better or worse?
  • Is it making me smarter or dumber?
  • Am I producing more value or just more output?
  • Does that output include technical debt incurred for the sake of expediency?
  • Am I learning more effectively or forgetting how to learn?

Conclusion

As GenAI becomes more capable of handling development tasks, it's worth considering not only what we can delegate to it, but also what we should continue doing ourselves. The ability to generate code faster doesn't necessarily mean we're producing better results or becoming better developers.

The challenge is to benefit from these tools without losing the understanding and experience that allow us to evaluate their output in the first place. This matters not only for individual developers but also for the next generation of engineers who need opportunities to practice their skills. 

Where do you draw the line between using GenAI to accelerate development and relying on it too heavily?

Find full reflection by Timothy Leavitt on the Developer Community: https://community.intersystems.com/post/thoughts-coding-genai

1 Upvotes

0 comments sorted by