Al said:
I am about to start rewriting a fortran program to ansi C++.
Step 1: use f2c, to translate Fortran source into complete C source that
compiles and runs. F2C is so stable that many use it as their Fortran
compiler. They never read the C intermediate.
Step 2: Read the C intermediate. It is not that bad, once you learn how
stereotypically it wraps all the Fortran nuances. But it won't be C++. Don't
ask it to be and you'l do fine. You can make minor tweaks to code in this
state.
Step 3: Write a billion unit tests that completely characterize this legacy
code. Many tests can pass sample data, collect sample results, and compare
them to golden references.
Step 4: Erase the source, and make each unit test pass by writing new
source.
Notice that at each step you can stop and have something useful to work
with.