Co-founder of Strumenta. Essays on software languages, legacy systems and the craft of building tools.

281 articles · since 2009

Rows of wooden barrels in a brewery storehouse
Legacy systems & modernization · 28 min · 5,531 words · 4 of 40 in this topic · by

Legacy Modernization with LLMs: is a large translation consistent with itself?

When we translate 600,000 lines of RPG, DDS, and CL into more than one million lines of Java code using LLMs, we want to know whether the resulting Java application will be consistent or it will look like a collection of incoherent code. We answer this question in this article.

We describe the experiment setup in article 1. We have seen that an application of this size does not fit in one agent session, so we divided the work into 49 phases following a plan of the dependencies, and each phase was a separate session that could only see the files already written by the previous ones.

This raises a question that does not exist for a small application: are all those sessions writing the same kind of code? In article 2 we saw that three independent translations of the same code take different design decisions, and 49 sessions working on the same codebase are, in a way, 49 translators who never talk to each other. Is this an additional issue to consider? To answer our question, we measured the entire codebase, using the snapshots taken after each phase.

This series

  1. Article 1: the experiments, the costs and the answers in short
  2. Article 2: what changes when we translate the same code three times, and the decisions behind it
  3. Article 3: whether the translations behave like the original
  4. Article 4 (this one): whether a large translation is consistent with itself
  5. Article 5: how I would approach a migration now

The experiments and their labels

  • 1A, 1B and 1C are the three translations of five selected programs from Large, with access to all of Large’s source.
  • 2A, 2B and 2C are the three translations of all of Small.
  • Large was translated once, in separate sessions following a dependency plan produced by Strumenta’s tooling.

All runs used Claude Code with Opus 5.5. Our prompt said “Organize the project as you see fit”, and the agent ran headless: it could not stop to ask a client. We had no running IBM i, so when I say that a run agrees with the RPG, that comes from analysing the source, not from running the original.

Names are masked with asterisks or replaced by neutral names like Row, FIELD and ChildProgram. You know, privacy and all. The code shown is excerpted; … means omitted code or declarations joined from different locations.

Is the Java code consistent with itself?

At first sight, the answer is yes. To answer this question, we measured all 5,737 Java files and the 49 snapshots taken after each phase: what we see is that the programs use the same runtime helpers for accessing files and for the RPG operations, that the names of the classes follow the names of the source programs with a handful of exceptions, and that records and screens are uniform. This is not surprising: in article 1, we discovered that the agent wrote some code generators for an important subset of the code. Those are deterministic, and of course produce consistent results. To give an idea of this uniformity, here are two programs that open a file, with neutral record names.

Keyed access. The program supplies a record definition and constructor.

KeyedFile<RecordA> records =
    KeyedFile.open(db, RecordA.DEFINITION, RecordA::new)

Arrival-order access. Another program uses the same abstraction with a different access mode.

KeyedFile<RecordB> records =
    KeyedFile.arrival(db, RecordB.DEFINITION, RecordB::new)

The access mode is different because the source is different, while the shape of the call is the same, and this is the rule: of the 2,738 classes in the package of the translated programs, 1,353 access files through this same KeyedFile abstraction and only 5 use JDBC statements directly. As for the names, 1,723 of the 1,727 program classes carry the name derived from the source member (on IBM i, source code is kept in source files such as QRPGLESRC, and each program, file definition or CL script is a separate member of one of them, so a member is what other platforms would call a source file), and the 92 classes with descriptive English names, like CustomerStatistics, are helper classes created to share code between programs that are variants of each other.

When we look more closely, though, a few problems appear.

The translated code is not refactored as the runtime evolves

The first issue is that later sessions never revisit the work of earlier ones. 97.9% of the files were never touched again after the phase in which they were created, and while the agent added 29 helpers to the runtime after phase 3, not a single one of them is used by a class that was created before the helper existed. Each session builds on top of what it finds, and what it finds stays as it is.

The style drifts: the indicators example

The second problem is that the style changes gradually as the phases go on. Take the resulting indicators that RPG sets on file operations: in the early phases the agent translated them away in 89% of the programs that had them, while in the late phases it kept them inside an Indicators object in 88% of cases. This is the same RPG idiom: a read setting an indicator when no record is found, as written by an early session and by a late one:

// early phase: the indicator has disappeared
RecordA rec = fileA.chain(key);
if (rec == null) {
    ...
}

// late phase: indicator 33 is still with us
RecordB rec = fileB.read();
in.set(33, rec == null);
if (rec != null) {
    ...
}

Both choices can be defended, but a codebase mixing the two is harder to read than one that picked either of them and stayed with it.

The runtime is not always leveraged

Something more puzzling happens with the numbers that must fit in a field: since phase 6 the runtime offers a helper for that, and nevertheless 213 of the classes written afterwards do the arithmetic by hand.

// using the helper of the runtime
count = (int) Num.fitInt(count + 2, 2);

// by hand, in another program
b = (rec.getCounter() + 1) % 1000;

MOVE and MOVEL, two of the most common operations in RPG, go through a dedicated helper in 42% of the programs, through a generic function for fixed-length strings in 36%, and become a plain Java assignment in 15%. And the arithmetic for fixed-format operations has no handling of the field size at all in 16% of the programs.

The structure can be inconsistent, too

The same lack of a common line appears with the programs that are variants of each other, of which the original application is full. The agent handled them in three different ways, mixed in every range of phases: 147 became subclasses of their sibling, 78 forward to a shared helper class, and 128 were translated again from scratch, producing a class that is at least 90% identical to another one.

…and generators get out of sync

A different problem is that the generators do not reproduce all of their own output, a point I’ll come back to at the end of this article. We ran all seven generators again and compared their results with the files that were delivered, finding that about 30 of the roughly 3,700 generated files differ in their behavior. Most of them are old screens that were never regenerated after the generator learned to handle new keywords, and in a targeted test, the same input set an indicator in one version and not in the other.

I do not think anybody (well, any session) decided to change conventions at some point. Each session did what seemed best at that moment, and there was nothing that reconciled the results afterwards.

Helpers rewritten in each program instead of being shared

There is a fourth problem, and it is the one that worries me the most when I think about who will have to maintain this code. When a session needed a small utility, it wrote one inside the program it was translating, instead of adding it to the shared runtime or looking for one that was already there. The conversion of a date into the day-month-year format, called dmy, is declared in 27 different classes, with 20 different bodies.

Let me show you five of them, because I think one has to see them to believe it. The first two do exactly the same thing, written in two different ways:

private static int dmy(int ccyymmdd) {
    return (ccyymmdd % 100) * 10000 + (ccyymmdd / 100 % 100) * 100 + ccyymmdd / 10000 % 100;
}

private static int dmy(int ccyymmdd) {
    int yy = ccyymmdd / 10_000 % 100;
    int mm = ccyymmdd / 100 % 100;
    int dd = ccyymmdd % 100;
    return dd * 10_000 + mm * 100 + yy;
}

The third one returns a text instead of a number and, before doing anything else, takes the absolute value, so that with a negative date it behaves differently from the two above:

private static String dmy(int ccyymmdd) {
    int v = Math.abs(ccyymmdd) % 1000000;
    int ddmmyy = v % 100 * 10000 + v / 100 % 100 * 100 + v / 10000 % 100;
    return Edit.editCode(BigDecimal.valueOf(ddmmyy), 6, 0, 'Y');
}

The fourth one starts from a Java date and gives back a decimal:

private static BigDecimal dmy(LocalDate d) {
    return BigDecimal.valueOf(d.getDayOfMonth() * 10000L + d.getMonthValue() * 100L + d.getYear() % 100);
}

And the fifth one has the same name but goes in the opposite direction, from the number to the date:

private static LocalDate dmy(int ddmmyy) {
    try {
        return RpgDate.dmy(ddmmyy);
    } catch (DateTimeException e) {
        return null;
    }
}

So we have five methods with the same name, four different return types and two opposite directions, while the runtime already contains RpgDate.dmyNumber, which does what the first two do. And it is far from being an isolated case: 52 classes declare their own private date conversion, 54 declare their own helper for arrays (the runtime offers none), and there are 37 helper names that are declared in five or more program classes, 35 of which with more than one body.

If we measure how much code is repeated somewhere else, we get 0.3% for the runtime, which is clean, and 32% for the programs the agent translated by hand, a figure that grows from 24% in the early phases to 45% in the late ones. Part of this repetition was already in the RPG, which is full of programs that are variants of each other, but the helpers were not: this duplication has been created by the agent.

Now think about what this means when the date conversion has a bug. You do not fix it once: you have to find the 20 versions, understand in what each one differs from the others, and fix them one at a time. In a human team, this would not have survived the first code review.

The generators the agent wrote

One thing I found fascinating was that the agent started writing small transpilers. We had not asked it to do this. Apparently, even the LLM thinks transpilers are a good idea.

AI-generated illustration.

The LLM produced seven Python generators, to cover:

  • DDS,
  • display files,
  • print specifications,
  • SQL tables,
  • queries,
  • CL,
  • and menu definitions.

A large part of the million lines comes from these tools. They are specialized translators, not a general RPG compiler. Here are actual excerpts from three of them, so you can see what the agent built.

Nobody asked for them. The agent decided by itself to write these code generators, and then ran them to produce parts of the application. In a sense, they help it be consistent: a decision written in a generator is applied in the same way to every file definition, screen or CL program, whatever the session in which it is used. It is not a coincidence that the generated parts are the most uniform part of the system.

What strikes me as a Language Engineer is how basic these generators are. But let’s see some examples.

From file definitions to Java types

DDS describes files and their fields on IBM i. The agent’s dds2java.py reads those definitions and generates Java record classes and metadata. This function chooses the Java type and the getter to use for a field:

def field_java_type(f):
    """(java type, getter expression, setter needs overload)"""
    t = f["type"]
    if t == "CHAR":
        return "String", 'getString("%s")'
    if t == "TIMESTAMP":
        return "LocalDateTime", 'getTimestamp("%s")'
    if t == "DATE":
        return "LocalDate", 'getDate("%s")'
    if t == "TIME":
        return "LocalTime", 'getTime("%s")'
    if t == "FLOAT":
        return "BigDecimal", 'getDecimal("%s")'
    if f["decimals"] == 0 and f["length"] <= 9:
        return "int", 'getInt("%s")'
    if f["decimals"] == 0 and f["length"] <= 18:
        return "long", 'getLong("%s")'
    return "BigDecimal", 'getDecimal("%s")'

A character field becomes a String. An integer field with up to nine digits becomes an int; a longer one can become a long. Decimal fields fall through to BigDecimal. This is one of the design decisions discussed in article 2, now written as a rule that the generator applies repeatedly.

Later, the generator uses that choice to write a Java getter. Here jt is the chosen type and g is the getter name:

accessors.append("    public %s %s() {" % (jt, g))
accessors.append("        return %s;" % (getter % f["name"]))
accessors.append("    }")

The Python writes Java source as text. The generated getter then delegates to the record runtime, which still has to implement the field’s behavior correctly.

From display definitions to screen metadata

The agent also wrote devf2java.py. This excerpt converts properties from a display definition into calls to a Java builder. An overlay lets a screen keep existing content; a subfile is a list of records displayed on the screen:

if f["overlay"]:
    body.append(".overlay()")
if f.get("subfile"):
    body.append(".subfile()")
if f.get("sflctl"):
    if "sflsiz" not in f or "sflpag" not in f:
        raise ValueError("%s: SFLCTL %s without SFLSIZ / SFLPAG" % (m.rel, f["name"]))
    body.append(".subfileControl(%s, %d, %d)" % (js(f["sflctl"]), f["sflsiz"], f["sflpag"]))

The generator writes Java code with calls such as .overlay() and .subfileControl(…). It also rejects a subfile-control definition without its size or page size. The shared display runtime uses this generated metadata to present the screen. So the tool is making decisions about screen behavior, not just copying labels.

Parsing CL expressions and emitting Java

CL is the command language used to control jobs and call programs on IBM i. In cl2java.py, the agent built an expression parser. These methods parse OR and AND expressions into intermediate nodes:

def or_(self):
    e = self.and_()
    while self.peek()[0] == 'op' and self.peek()[1] in OPS_OR:
        self.take()
        e = Expr('or', args=[e, self.and_()])
    return e

def and_(self):
    e = self.not_()
    while self.peek()[0] == 'op' and self.peek()[1] in OPS_AND:
        self.take()
        e = Expr('and', args=[e, self.not_()])
    return e

The OR parser calls the AND parser for its operands, giving AND higher precedence. Later, a separate part of the tool emits Java statements. This is the start of its handling of an IF node:

elif k == 'if':
    cond = self.cond(n[1])
    out.append(ind + 'if (%s) {' % cond)
    out.extend(self.body_of(n[2], level + 1))

It translates the condition, opens a Java if, and generates the body. These are familiar pieces of a transpiler: parsing, an intermediate representation, and code generation. The agent decided to build them while doing the migration.

How the seven generators are made

After looking at the excerpts it is worth stepping back to see the whole picture, because these tools tell us a lot about how an LLM approaches the problem when it is left alone. The seven scripts amount to about 5,000 lines of Python; they use only the standard library (regular expressions and little else), and they appeared at different moments of the translation, each time the agent met a new kind of source with many members of the same type:

Generator Lines First appears in phase What it reads What it produces
dds2java.py 800 1 DDS of physical and logical files Record classes with fields, keys and select/omit rules
sqltable2dds.py 89 2 SQL CREATE TABLE members DDS, which is then given to dds2java.py
devf2java.py 925 3 DDS of display and printer files Screen and print classes, subfiles included
ospec2java.py 191 16 Output specifications of an RPG program A Java skeleton to paste into the program and complete by hand
qryd2java.py 608 44 Query/400 definitions exported as SQL Query classes, with the SQL rewritten for the runtime
cl2java.py 2,299 46 CL programs and command definitions One Java class per program
mnu2java.py 160 48 DDS menus Menu classes

None of them is based on a grammar. DDS is a language in which the meaning of a character depends on the column where it is written, and the two DDS generators exploit this in the most direct way possible, which is by padding each line to 80 characters and cutting it at fixed positions:

kind = line[16]
name = line[18:28].strip()
ref = line[28]
length = line[29:34].strip()
dtype = line[34]
decimals = line[35:37].strip()
kw = line[44:80]

The keyword area, which is the only part of a DDS line with a free syntax, goes through a small tokenizer written by hand that takes care of quotes and nested parentheses, and the lines that continue on the following one are joined before that. The result is kept in a few simple objects, from which the Java comes out by concatenating strings, as we saw in the excerpts above.

The CL generator is the only one that resembles a small compiler, and it is also the largest. It first reassembles the commands that span several lines, keeping track of comments and quotes, then it separates the name of each command from its parameters by counting parentheses; after that, it parses the expressions with the recursive descent parser we saw before, and finally, it builds a tree of blocks (IF, DO, SELECT, the MONMSG attached to a command) on which it performs a small analysis before emitting the Java. That analysis is needed to decide the signature of the generated method, because a parameter becomes a plain String when the program never changes it and a Parm<String>, which the caller can read back, when it does. A GOTO becomes a loop around a switch on the label, which is the usual trick for a language without GOTO.

The generator for the queries works on the tokens of the SQL and rewrites what the runtime expects in a different form, while the information that the export of a query loses, such as the kind of output or the break levels, is supplied through a JSON file that the agent filled in separately.

What these generators do well

These “transpilers” are basic and poorly designed if we compare them to “proper” transpilers. However, they do not aim to be that: they are just throwaway scripts the LLM put together to facilitate its work. Seen in this light, they do an honest job.

Each script starts with a long comment that lists precisely the subset of the language it supports and that ends with a sentence like “anything else stops the conversion with an error”, and the code keeps that promise: in the CL generator alone there are 47 points in which the conversion is interrupted with a message saying what was found and where. A generator that refuses what it does not understand is much better than one that produces something plausible, and it is exactly the opposite of what the agent did when translating by hand, where, as we saw in article 2, it filled the gaps with guesses.

The CL generator also refuses to overwrite a class that already exists unless it is explicitly forced to, so that the programs translated by hand in the earlier phases are preserved, and the DDS generators go and read the definition of another file when a field refers to it.

To understand how far this subset goes, I ran the generators again, on my machine, on all the members of the two main libraries that they are able to read, which are 3,558:

Kind of source Members Converted Stopped with an error
Physical and logical files 1,193 1,193 0
Display and printer files 660 656 4
CL programs 1,085 1,074 11
Queries 582 582 0
Menus 38 38 0

So 15 failures out of 3,558, which is a remarkable result for tools written as a side effect of another job. It is also, as we are going to see, a result that says more about how well the tools were fitted to this codebase than about how general they are.

Where they stop even though the code could be translated

The 15 members on which the generators give up are interesting, because in almost all of them there is nothing wrong with the source: it is the generator that does not know a construct. And since the generators work in an all-or-nothing way, one line that is not understood means that no class at all is produced for that member, however long and however ordinary the rest of it is.

The four display files that fail all do so on the same keyword, DFT, which is nothing more than the explicit way of writing the text of a constant on the screen. The generator handles constants written between quotes without any problem, so everything needed to translate these screens was already there, and what was missing was one line telling it that the two forms are the same thing.

For the CL programs, the picture is this:

  • Eight programs use a command that is not in the list. The generator knows about a hundred commands, each one associated by hand with a method of the runtime, and for any other it ends with this line: raise ClError(‘command %s not supported: %s’ % (name, text)). The commands on which it stopped are perfectly standard ones, such as CRTLIB, DSPDTAARA and RMVMSG, plus one command defined by the application itself. CL has a couple of thousand commands, all of them with the same syntax made of keywords and values that the generator parses without difficulty, so the limit is not in understanding the source but in the fact that every command has to be added to the list one by one.
  • One program has a MONMSG placed right after a label, at the end, to ignore any error during the final cleanup. The generator expects to find a MONMSG only after a command or at the beginning of the program, and it reports it as a command that is not supported.
  • One program writes an IF followed directly by a command with several parameters, without enclosing it in THEN(…), and the table that the generator uses for the positional parameters does not foresee this form.
  • One program declares a file that was not migrated, and this is the only case of the fifteen in which the generator is right to stop.

Two of these programs are present in the translated system anyway, because the agent had translated them by hand in an earlier phase, when another program needed them, which is the best demonstration that they could be translated. It also means that for those two classes, the generator is not able to reproduce what was delivered. The other members have no Java counterpart at all, because they were not in the migration plan and the generators were never run on them.

What they leave out without saying it

Stopping with an error is the visible limit. The less visible one is a list, in the generator for the screens, of about seventy DDS keywords that are simply dropped. Most of them make no difference on a text console, like the one that makes a field blink (used in 44 of the 482 display files) or the one that sounds the alarm (21). But in the same list there is CSRLOC, with which the program decides where to put the cursor when the screen is shown, and it is used in 16 display files: those screens are generated without errors, and the cursor ends up somewhere else. This is a decision on the behavior of the user interface that was made once, inside a Python list, and that nobody would find without reading the generator.

This is also the sort of thing that users with muscle memory would complain about, expecting the cursor to be where it used to be and them being able to type the value they had in mind.

Tools that only work for this application

Reading the code, one also sees how much these generators are tied to the codebase for which they were written. The CL generator contains tables with the names of specific programs to decide, for example, which parameters are arrays (the names are replaced here):

ARRAY_PARMS = {('PROGRAM_A', 0): 3, ('PROGRAM_B', 0): 3, ('PROGRAM_C', 0): 3}
GROUP_PARMS = {'PROGRAM_D': (0, 12)}

The Java package and the source tree location are stored in the scripts. And the generators are not connected to each other through a common model of the application: when a CL program declares a display file, the CL generator does not go back to the DDS but opens the Java class that the other generator produced, in a directory whose path is fixed, and extracts the fields from it with a regular expression:

for m in re.finditer(r'FieldDef\.(chars|zoned|packed|binary)\("([A-Z0-9#@$_]+)", (\d+)(?:, (\d+))?\)', src):

It works as long as nobody changes the way in which the first generator writes a field. I discovered it the hard way, because when I ran the CL generator on a copy placed in another directory, 24 programs that are converted correctly in their original position failed. Finally, there is not a single test for any of the seven generators: the only verification that they work is the fact that the Java they produced compiles.

There is no generator for RPG

The most important thing about these generators is perhaps what is missing. DDS, menus, and queries are declarative, CL is a simple language, and all of them have a regular syntax, so the agent automated them. RPG, which is where the logic of the application is, was translated by hand, one program after the other, with the consequences in terms of duplication and drift that we saw in the first part of this article.

I think the reason is in the nature of RPG. Of the 1,492 members in the main RPG source file, 416 contain blocks in free format, while 310 use free-form declarations, mixed with specifications in fixed format in the same member (member in the IBM i sense of the term, see above), plus there are RPG III members. Cutting lines at fixed columns, which is all these generators know how to do, works for the fixed-format part and is useless for the rest, where one needs a real grammar for statements and expressions, and the two styles have to be handled together because they refer to the same variables. The only tool that touches RPG, ospec2java.py, confirms it: it reads the output specifications, which exist only in fixed format; it does so for RPG IV and for RPG III, and what it produces is not a class but a skeleton that the agent then pasted into the program and completed by hand.

How this compares with a parser built on purpose

Since building parsers and transpilers for these languages is what we do at Strumenta, I could not avoid comparing the generators written by the agent with ours, and I think the comparison is useful to understand what one gets and what one does not get from tools written on the fly.

Aspect The agent’s generators Our parsers and transpiler
How the source is read Fixed columns and tokenizers written by hand Formal grammars, combined with the column layouts where the language requires them
RPG Not covered, apart from the output specifications in fixed format Fixed format, free format and the two mixed in the same member; RPG III in a preliminary form
CL commands About a hundred, listed one by one; any other stops the conversion Any command is parsed through a generic rule, and about two thousand have a specific type
A construct that is not supported The whole member is abandoned It is recorded as an issue on that point, and the rest of the member is processed
Model of the code A few ad-hoc objects per generator A typed syntax tree shared by all the tools
References between sources Resolved by reading other files when needed, in one case by reading generated Java A separate phase that connects names to definitions, programs to files and fields to the files they refer to
How Java is produced Concatenation of strings A syntax tree of the Java, from which the code is printed
Tests None Around a thousand for the RPG parser alone

The point of this table is not that ours are better, which after years of work on them would be a rather modest claim, and they have their own limits too. The point is to see which properties are lost. The generators by the agent are fitted to one application; they do the easy part of the job, and they do not tell us what they did not understand except by stopping. A parser built on purpose also reads the difficult part, which is RPG in all its forms; it keeps going when it finds something unexpected and gives us the list of what it found, and it produces a model of the whole application on which we can ask questions, such as which programs use a certain file, before deciding how to translate anything. On the other hand, the agent built its generators while it was doing the translation, without anybody asking for them, and on this codebase they converted more than 99% of what they were given.

For somebody who has spent years building language tools, there is something quite funny about this. I asked an LLM to translate an application, and it decided that writing translators was a sensible way to do the job.

The next section examines a case where regenerating a screen changes the behavior of a program.

When regeneration changes the result

The system was translated once, so this is an internal comparison. Rerunning the supplied display generator changed a screen definition. The following excerpts show the same part of its builder chain:

Delivered Java. The builder goes from the function key to the screen text.

.cf(24, 24)
.text(1, 2, "********")

Regenerated Java. A record-change setting appears between them.

.cf(24, 24)
.recordChange(25)
.text(1, 2, "********")

The original DDS specifies CHANGE(25). In a targeted execution test, entering 123 into the same field through the same scripted terminal produced these results:

Same runtime and input

Version Field value Indicator 25
Delivered Java 123 false
Regenerated Java 123 true

Same screen, same input, same runtime: the indicator is false in one version and true in the other. They cannot both be right.

Either the generator the agent wrote is wrong, or the code it delivered is. Something in that logic does not hold. Here, the regenerated version is the one that agrees with the DDS, so the delivered Java is the problem. And it is not the only case: when we ran all seven generators again and compared their output with what was delivered, about 30 of the roughly 3,700 generated files differed in their behavior. Most of them are screens generated in the early phases and never regenerated after the generator learned to handle new keywords, which is the same pattern we saw above, with later sessions improving a tool and not going back to apply the improvement. So the agent gave us generators and generated files, and they do not agree. If you want to maintain the generator, you have to check this first.

What this means for who maintains the code

If I had to maintain the resulting system, the Java itself would not be my problem. My problem would be that a correction is never done in one place: with a third of the code of the programs existing also somewhere else, and the same utility declared in 27 classes with 20 different bodies, I would have to find all the copies, understand in what they differ and whether the difference is wanted, and fix them one at a time, hoping not to forget any. And having learned how things are done by reading one program, I could not assume that the next one follows the same rules, because the conventions depend on the session that wrote it.

There are encouraging parts too. The runtime is clean, its helpers for operations such as MOVE and keyed file access have comments explaining their rules, and the generated parts are uniform.

Conclusions

Is a large translation consistent with itself? On the surface it is: a shared runtime, stable names, generated records and screens. Underneath it is the sum of 49 sessions, each of which did what seemed best at that moment:

  • 97.9% of the files were never touched again after the phase that created them, and improvements to the runtime were never applied to the code already written;
  • the same RPG construct is translated in one way at the beginning and in another at the end;
  • programs that are variants of each other are handled in three different ways;
  • small utilities are written again in each program, to the point that a third of the hand-translated code is duplicated;
  • about 30 of the generated files no longer correspond to what their generator produces.

None of this prevents the application from compiling or its tests from passing, which is exactly why it is easy to miss. It is the kind of problem that a team would prevent with conventions, reviews, and somebody responsible for the architecture, and that an agent working session after session, without anybody playing that role, does not prevent by itself. How to move forward and get the best of both worlds is what we present in the last article of this series: article 5.

One letter when there is something worth sending.

Written by Federico · Torino

Scroll to Top