Coding with AI

Programming with an AI Agent

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

Issues with order and duplication

AI agents struggle with the correct order of code. For example, they may place initializations at the end of a file, causing runtime errors. Additionally, AI can readily 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 is to use AI code platforms that can manage memory and project structures. This helps maintain consistency in complex projects. Unfortunately, these features are not always applied consistently. 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 can invoke the large language model. These tools are based on an open standard protocol (MCP). It is therefore possible to connect an AI coding agent to an IDE such as Visual Studio Code. You can also set up a local LLM with llama of ollama en kies je een MCP server om mee te integreren. NetCare heeft een MCP server gemaakt om te helpen met debuggen en het onderliggende (linux) systeem te beheren. Handig voor als je direct de code live wilt zetten.
Modellen zijn te vinden op huggingface.

IDE extensions are essential

Om AI-gegenereerde code beter te beheren, kunnen ontwikkelaars gebruik maken van IDE-extensies die toezien op code-correctheid. Hulpmiddelen zoals linters, type checkers en geavanceerde code-analyse tools helpen om fouten vroegtijdig op te sporen en te corrigeren. Ze vormen een essentiële aanvulling op AI-gegenereerde code om de kwaliteit en stabiliteit te waarborgen.

The cause of recurring errors: context and role in APIs

Een van de belangrijkste redenen waarom AI-agenten fouten blijven herhalen, ligt in de manier waarop AI API’s interpreteren. AI-modellen hebben context en een duidelijke rolomschrijving nodig om effectieve code te genereren. Dit betekent dat prompts volledig moeten zijn: ze moeten niet alleen de functionele eisen bevatten, maar ook het verwachte resultaat en de randvoorwaarden expliciet maken. Om dit te vergemakkelijk kun je de prompts in standaard formaat (MDC) opslaan en standaard meesturen naar de AI. Dat is vooral handig voor generieke programmeer regels die je hanteert en de functionele en technische requirements en de structuur van je project.

Tools such as FAISS and LangChain help

Producten zoals FAISS and LangChain provide solutions to make AI handle context better. FAISS, for example, helps with efficient searching and retrieving of relevant code snippets, while LangChain helps with structuring AI-generated code and maintaining context within a larger project. But you can also set it up locally yourself with RAC databases.

Conclusion: useful, but not yet autonomous

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

Take contact to help set up the development environment so teams can get the most out of it and focus more on requirements engineering and design rather than debugging and coding

 

Gerard

Gerard works as an AI consultant and manager. With extensive experience at large organizations, he can unravel a problem very quickly and work towards a solution. Combined with an economic background, he ensures business‑responsible decisions.