Ten Simple Rules for AI-Assisted Coding in Science

Eric W. Bridgeford 1,†, Iain Campbell 2, Zijiao Chen 1, Zhicheng Lin 3,4, Harrison Ritz 2, Joachim Vandekerckhove 5, Russell A. Poldrack 1 · 2025

Read Ten Simple Rules for AI-Assisted Coding in Science by Eric W. Bridgeford 1,†, Iain Campbell 2, Zijiao Chen 1, Zhicheng Lin 3,4, Harrison Ritz 2, Joachim Vandekerckhove 5, Russell A. Poldrack 1 (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2510-22254.txt.

Introduction

Eric W. Bridgeford leads a seven-author team writing rules for scientists who code with AI assistants. The tools plainly speed up software work. In research, though, a fast program that is subtly wrong is worse than a slow one. The paper aims at speed without surrendering quality or validity.

Ten practical rules sit under four themes. The first theme is preparing and understanding the problem before generating anything. The second is managing context and the back-and-forth with the tool. The third is testing and validation strong enough to catch plausible nonsense. The fourth is code quality through iterative improvement. One insistence runs through all of them: human agency. The researcher keeps the decisions, the domain judgment, and the responsibility. The rules are working habits for labs adopting these tools now.

Catalog record

CREATOREric W. Bridgeford 1,†, Iain Campbell 2, Zijiao Chen 1, Zhicheng Lin 3,4, Harrison Ritz 2, Joachim Vandekerckhove 5, Russell A. Poldrack 1
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE35 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2510-22254

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Ten Simple Rules for AI-Assisted Coding in Science Eric W. Bridgeford 1,†, Iain Campbell 2, Zijiao Chen 1, Zhicheng Lin 3,4, Harrison Ritz 2, Joachim Vandekerckhove 5, Russell A. Poldrack 1 Abstract While AI coding tools have demonstrated potential to accelerate software development, their use in scientific computing raises critical questions about code quality and scientific validity. In this paper, we provide ten practical rules for AI-assisted coding that balance leveraging capabilities of AI with maintaining scientific and methodological rigor. We address how AI can be leveraged strategically throughout the development cycle with four key themes: problem preparation and understanding, managing context and interaction, testing and validation, and code quality assurance and iterative improvement. These principles serve to emphasize maintaining human agency in coding decisions, preserving the domain expertise essential for methodologically sound research. These rules are intended to help researchers harness AI’s transformative potential for faster software development while ensuring that their code meets the standards of reliability, reproducibility, and scientific validity that research integrity demands. 1 Introduction The integration of artificial intelligence into scientific computing represents one of the most significant shifts in research methodology since the advent of personal computers. Large language models (LLMs) trained on vast corpora of code can now generate syntactically correct, functionally appropriate programs from natural language descriptions, a capability that was inconceivable just a few years ago [ 1 ] . Tools like GitHub Copilot, ChatGPT, and Claude have democratized access to sophisticated programming assistance, enabling researchers with limited coding experience to implement complex analyses and build robust scientific software [ 2 ] . Agentic coding tools like Claude Code and Cursor have further enabled entire coding workflows by invoking tools outside the language model. AI-assisted coding tools have demonstrated measurable productivity gains in some controlled studies, with benefits spanning development speed, code quality, and maintainability [ 2 ] . However, the evidence for these benefits remains contested and situation-dependent. While some enterprise studies and developer surveys report significant productivity increases and improved code quality [ 3 ] , recent randomized controlled trials with experienced developers found that AI tools actually slowed completion times, despite developers believing they were working faster [ 4 ] . Additional concerns about code quality have emerged, with research analyzing almost 200 million lines of code showing substantial increases in copy-pasted code and decreases in refactoring as AI use has become more prominent when using AI assistants [ 5 ] . These contradictory findings suggest that productivity effects are far from well-understood, and may vary based on developer experience, task complexity, and codebase characteristics. These questions become particularly acute in scientific computing, where code is not merely a means to an end but often embodies scientific reasoning, methodological decisions, and domain expertise. The validity, reproducibility, and interpretability of scientific software directly impact research integrity and the reliability of scientific findings [ 6 ] . The implications for scientific computing are profound. Programming involves complex problem decomposition, algorithmic thinking, and domain-specific reasoning. These cognitive skills that atrophy with excessive AI dependence. Furthermore, scientific code often requires deep understanding of mathematical models, statistical methods, and domain-specific conventions that cannot be adequately captured by AI tools trained on general programming corpora. These challenges are compounded by the technical limitations inherent to current AI systems: their context windows constrain how much code they can process simultaneously, their stateless nature means they forget previous interactions, and their tendency toward “context rot” [ 7 ] can cause them to lose track of important details even within their processing limits. Effective use of AI coding tools requires understanding how to work within and around these constraints. Techniques like strategic prompting, test-driven development, and externally-managed context files (such as memory files and constitution files) can help maintain consistency across AI interactions. Different tools (from conversational interfaces to interactive coding assistants to autonomous coding agents) each offer distinct capabilities and limitations that must be matched to specific development tasks. (For readers unfamiliar with these concepts, we provide detailed definitions in Appendix A .) The rules presented in this paper emerge from our collective experience using AI-assisted coding tools, and highlight both the substantial promise and documented risks of AI-assisted coding in scientific settings. We hope they provide a framework for harnessing AI’s transformative potential while preserving the methodological rigor and domain expertise essential for high-quality scientific computing. These guidelines emphasize the importance of maintaining human agency in the coding process, establishing robust testing and validation procedures, and strategically managing the interaction between human expertise and AI assistance. Who is this paper for? These guidelines are intended for anyone who develops scientific software that will be used more than once, whether by themselves, their collaborators, or the broader research community. This includes both scientists who primarily use code to generate research outputs and developers who build reusable tools and packages. Our focus is on creating maintainable, reliable software rather than one-off scripts. If you write code that needs to work reliably and repeatably, be understood by others, or be built upon in the future, we believe these rules are for you. 2 The rules To illustrate these rules with concrete examples, we provide an interactive Jupyter Book demonstrating both effective and ineffective implementations of each rule (3+ examples per rule), available at poldracklab.org/10sr_ai_assisted_coding and permanently indexed at [ 8 ] . These worked examples with detailed analysis will reinforce readers’ understanding of what good and flawed AI interactions look like, and put the strategies discussed herein into practice. 2.1 Preparation and Understanding The effectiveness of AI-assisted coding is fundamentally constrained by the clarity and completeness of what you bring to the interaction. AI models cannot compensate for gaps in your understanding of the problem domain, your inability to recognize appropriate solutions, or your unfamiliarity with relevant tools and conventions. These limitations arise because AI tools lack true domain expertise. They pattern-match from training data rather than reason from first principles, and they cannot assess whether their outputs align with field-specific best practices you haven’t mentioned. Without this foundational preparation, you risk “vibe coding,” accepting AI-generated code you cannot evaluate, debug, or maintain. Rule 1: Gather Domain Knowledge Before Implementation Know your problem space before writing code. Understand data shapes, missing data patterns, field-specific libraries, and existing implementations that could serve as models. You don’t need to be an expert initially; use AI to help research domain standards, available datasets, common approaches, and implementation patterns before diving into coding. This reconnaissance phase prevents you from reinventing wheels or violating field conventions. Share your current understanding level with the AI and iteratively build context through targeted questions about tools, data structures, and best practices, asking for specific references and paper summaries. This upfront investment ensures that your code aligns with community standards and handles real-world data appropriately. Rule 2: Distinguish Problem Framing from Coding Framing a problem in a programmatic way and coding are not the same thing [ 9 ] . Programmatic problem framing is problem solving: understanding the domain, decomposing complex problems, finding the right levels of abstraction, designing algorithms, and making architectural decisions. Coding is the mechanical translation of these concepts into executable syntax in a programming language. Using AI coding tools effectively requires that you

Read the complete text