Clarity-Driven Development of Scientific Software
Preface
This book is meant to empower researchers to code with confidence and clarity.
If you studied something other than computer science—especially in the natural sciences like physics, chemistry, or biology—it’s likely you were never taught how to properly develop software. Yet, you’re often still expected to write code as part of your daily work. Maybe you’ve taken a programming course like Python for Chemists and can put together functional scripts through trial and error (with a little help from an AI assistant). But chances are, no one ever showed you how to write well-structured, maintainable, and reusable code that could make your life—and collaborating with your colleagues—so much easier.
This book is for you if you want to:
- Write functional software more quickly.
- Use a structured approach to design better programs.
- Reuse your code in future projects.
- Feel confident about what your scripts are doing.
- Prepare your research code for production.
- Share your work with pride.
Whether you’re just beginning your scientific journey—perhaps working on your first major project like a master’s thesis or your first paper—or you’re contemplating a move from academia to industry, the practical advice in this book can guide you along the way. We will approach software design from first principles and tackle research questions with a product mindset.
While the book contains some example code in Python to illustrate the concepts, the general ideas are independent of any programming language.1
Software development is a craft that’s best learned with the guidance of a senior colleague—someone who can show you the right tools and provide feedback through code reviews. Unfortunately, mentors with industry experience are rare in academia. While a book can’t replace an apprenticeship, I hope this one gives you a head start. It’s the book I wish I could have read at university and the one I always wanted to recommend to the students and junior developers I’ve mentored.
To quote Code Complete by Steve McConnell: “We will always need people who can bridge the gap between the real-world problem to be solved and the computer that is supposed to be solving the problem. […] As long as we have computers, we’ll need people who tell the computers what to do, and that activity will be called programming.” [1]
The focus of this book is not on typing code in a specific programming language—AI assistants are indeed perfectly capable of doing that. Instead, it teaches you how to think through what you want your code to accomplish and how to translate those goals into a high-quality software design that you could then implement with AI assistance. You’ll also learn best practices that enable you to assess the quality of the produced code, as well as techniques for improving it when needed.
Give Me Feedback, Please!
I’m always looking to improve the contents of this book (or any other resources you can find on my website). Please send me an email to hey@franziskahorn.de
, if you have any suggestions for how this book could be improved!
Specifically, I’d really appreciate some feedback on
- Where you got confused or lost or have an unanswered question.
- Where you disagree, or have different experiences.
- Where you started to get bored and felt like skipping ahead or giving up.
- Anything you found especially interesting or helpful.
Thank you so much & enjoy! 😊
Acknowledgments
I would like to thank Marcel Lengert, Sarah Nomura, Ana Moga, and Robin Horn for their thoughtful feedback.
A big thank you also goes out to Eva and Karin Zink for creating the cover image.
The texts in this book were partly edited and refined with the help of ChatGPT, however, all original content is my own.
How to Cite
@book{horn2025cddsci,
author = {Horn, Franziska},
title = {Clarity-Driven Development of Scientific Software},
year = {2025},
url = {https://franziskahorn.de/rsebook/},
}
Just in case, this tutorial provides a concise overview of the Python concepts used in this book.↩︎