Programmeren met een AI

Programming with an AI Agent

Artificial intelligence (AI) has fundamentally changed the way we program. AI agents can generate, optimize, and even help debug code. However, there are some limitations that programmers should keep in mind when working with AI.

Problems with order and duplication

AI agents struggle with the correct order of code. For example, they can place initializations at the end of a file, which causes runtime errors. In addition, AI can, without hesitation, define multiple versions of the same class or function within a project, leading to conflicts and confusion.

A code platform with memory and project structure helps

One solution to this is the use of AI code platforms that can manage memory and project structures. This helps maintain consistency in complex projects. Unfortunately, these functions are not always consistently applied. As a result, the AI may lose the coherence of a project and introduce unwanted duplications or incorrect dependencies during programming.

Most AI coding platforms work with so-called tools that the large language model can call. These tools are based on an open standard protocol (MCP). It is therefore possible to link an IDE such as Visual Code to an AI coding agent. You can optionally set up an LLM locally with llama or ollama and choose an MCP server to integrate with. Models can be found on huggingface.

IDE extensions are indispensable

To better manage AI-generated code, developers can use IDE extensions that monitor code correctness. Tools such as linters, type checkers, and advanced code analysis tools help detect and correct errors early. They are an essential addition to AI-generated code to ensure quality and stability.

The cause of recurring errors: context and role in APIs

One of the main reasons why AI agents keep repeating errors lies in the way AI interprets APIs. AI models need context and a clear role description to generate effective code. This means that prompts must be complete: they must not only contain the functional requirements, but also explicitly state the expected result and the boundary conditions. To facilitate this, you can store the prompts in standard format (MDC) and send them to the AI by default. This is especially useful for generic programming rules you use and the functional and technical requirements and the structure of your project.

Tools like FAISS and LangChain help

Products like FAISS and LangChain offer solutions to help AI deal with context better. FAISS, for example, helps with efficiently searching and retrieving relevant code fragments, while LangChain helps structure AI-generated code and maintain context within a larger project. But here too, you can optionally set it up locally with RAC databases.

Conclusion: useful, but not yet independent

AI is a powerful tool for programmers and can help accelerate development processes. However, it is not yet truly capable of independently designing and building a more complex codebase without human supervision. Programmers should consider AI as an assistant that can automate tasks and generate ideas, but still needs guidance and correction to achieve a good result.

Contact us to help set up the development environment to help teams get the most out of the development environment and focus more on requirements engineering and design than on debugging and writing code.

 

Gerard

Gerard

Gerard is active as an AI consultant and manager. With extensive experience at large organizations, he can quickly unravel a problem and work towards a solution. Combined with an economic background, he ensures commercially sound choices.

AIR (Artificial Intelligence Robot)