Legacy Code Confessions#
Legacy Fortran is full of code that works, has survived for decades, and is difficult to change. Despite their success, these legacy systems can be hard to understand, test, maintain, or modernise. To help, we are collecting the patterns that give legacy systems these qualities, together with tried and tested alternatives that can help. This is not about blaming the people who wrote the code. Constraints change, and many of these choices were reasonable at the time. The goal is to give the next developer a map: what to recognise, why it is risky, and where to start improving it.
If you have knowledge to share, please continue reading and contribute today!
What makes a useful contribution?#
Tell us about one specific pattern. This won't necessarily be a bug and the code may still appear to work. These patterns can usually be identified through their code smells that hint at deeper design or maintainability problems; It might involve a language feature, a build or testing practice, or an organisational habit around a codebase. The most useful reports include:
A short summary naming the pattern.
The code smells that help a developer identify the issue;
The benefits of moving away from this pattern;
Optionally, you can also provide:
A small example showing the pattern; and
An updated code example showing the solution.
For example, the short summary could be "Break large procedures into smaller
units". The code smells might be that multiple dummy arguments are updated in a
single procedure (i.e. many intent(out) arguments) or simply that a line of
code is deeply indented. The benefits could include that procedures with only
one purpose are much easier to unit test as well as being easier to fix should
a bug be introduced. A small example can show the original procedure updating
multiple dummy arguments, followed by an updated set of multiple procedures for
each task.
Learn more#
This project grew from the fourth Back to the Fortran Future workshop, held as a satellite event to the 10th annual Research Software Engineering Conference in Sheffield on 8 September 2026. The workshop brought together people working on one of Fortran's persistent challenges: developers inheriting large, important codebases without the context needed to maintain them confidently.
One outcome will be a practical guide for developers who need to understand and modernise legacy Fortran. We also want the resulting entries to be structured enough for tools and AI assistants to use responsibly: a recognisable pattern, the benefits of its removal, and examples grounded in real experience. Share your experience above to help build this resource.
This guide will live in the Software Carpentries Incubator, and may grow into a dedicated Carpentries-style workshop linked to the larger Fortran Carpentries curriculum.