This one is a completely contrarian comment to the current what NOT to touch scenario and it is a tale that espouses the SHEER JOY of finding something utterly refreshing TO REDO!
Waaaaaaaay back in the day in the late 1980's when the predecessor to a certain north Canada Data centre was NOT having its circuit breakers used to flash cook and explode Ham Hocks and Turkeys at 400,000 volts and 500 to 1000 amps or so, a crusty old manager far above my pay grade, wrote an entire 1000 Server board cooling system regulation software system entirely in COBOL and a few or many years later, our boorish, whiskey-and-rum besotted DBMS admin-rated and mechanical engineering crew were unceremoniously paid some pretty big CANADIAN PESOS to take a gander at our crusty now-well-retired-and-Tuscany-Italy-living code master to see how we could upgrade the then VAX-6XXX-something cooling code to run on a UNIX system in Objective-C/C++ which was just about that time getting REALLY popular with coders!
Lo and Behold! What we saw and we were utterly MADE IN AWE OF, was the FINEST, most well-commented, most well-documented, most easy-to-read code we had EVER SEEN where even the equivalent of X = X + 1 was turned into "NOTE: Control variable for water level control loop at 27 C to 48 C narrow operational temperature range. Ensure any decision-tree code using this value to decided when to change a flow value during this loop, has a lower and upper bounds check of +27 C to +48 C (NEVER go below and never go above) and ensure anytime coolant flow temperatures get down to 30 C or up to 45 C raise warning semaphore FlowTemperatureWarningSemaphore to a value of 1 for temperatures 30 C and below and to 2 for temperatures 45 C and above and set to ZERO for nominal all-is-well 31 C to 44 C temperatures, and when temp is out-of-bounds do show warning line of text on CRT screen #2 which is the local machine control diagnostics screen which is to ALWAYS be placed to the LEFT of the centre operating console to ensure one needs only glance slighty to the left to see the bright yellow background line colour with dark navy blue text in high contrast."
Such COPIOUS code notes told us everything we needed to know! We simply wrote a set of functions in C that ingested all the COBOL code and ALL COMMENTS and converted and exported out the KEY COBOL operators and comments to C/C++ and all key iterative loop code and all equivalent if-then-else statements which took but a snowy weekend to do!
By the time the next Friday rolled around, we were ITCHING to flash cook another winter turkey into megawatt pieces but NOT due to frustration but rather IN GREAT CELEBRATION as a 100,000+ LINES of ultra-well-documented COBOL code was pretty much ENTIRELY auto-recoded into C++ AND WAS ACTUALLY WORKING VERY VERY WELL on a physical water loop test circuit all running on a SINGLE BOARD BOX that was an oil-cooled VME-bus dual Intel 80386 CPU-based real-time hard-interrupt-base UNIX system that comprised of a single 50 cm by 50 cm by 50 cm black box with four RS-232/RS-422 and four SCADA-like control ports on the back and two fail-safe real-time UNIX OS'es that could fail-over in less than 3 seconds to the other running-at the-same time OS keeping the last known GOOD cooling level intact!
What a dream to see fail-overs working correctly! What a stunning victory to see coolant levels at a nearly-constant 36 C !!! What a stunning almost-too-easy code-conversion task that MANY had said would take up to 18 months to 2 YEARS to complete when it took a mere 11 days of recoding and 14 days of 24/7 testing and that was only because at least a FEW of those days in our remote location had us too besotted and too sleepy to even THINK about getting out of our warm down-comfortor beds to even BOTHER looking at the code when the outside temperature was a moooose-tache crackling -46 Celcius in the morning!
AND WHAT A COMPLETE AND UTTER SURPRISE TO ALL when we reported back to our Admin Superiors that ANOTHER actual mechanical and electrical engineering team was needed RIGHT AWAY in our cold northern Canadian remote woods location in order to disconnect/switch out the current COBOL VAX boxes with the new single box system since it seemed EVERYTHING NEW was working JUST FINE in the test system!
After handing off the keys and the finely-detailed well-illustrated Aldus Pagemaker-made 300 dpi 120 page black-and-white printed 5th Grade ENGLISH MANUAL OF OPERATIONS AND MAINTENANCE that took a mere 6 days to write by merely copying the source code comments and rewriting them in grade-school English, we were sent off back home for 3 months and when we all came back to blow up another whole ham hock on a 400 KV test circuit breaker line, we were pleasantly surprised to find no more VAX and no more fan noise!
Twas met with a nearly silent oil-cooled industrial VME box securely bolted down in a properly air-conditioned, EMI/RFI-hardened AND well-padlocked closet connected to an analog pump controller that used a set of 24 volt signal generators telling which valves should route coolant at whatever desired temperature to whichever data centre motherboard at whatever time of day to keep the temperature at a safe +27 to +48 Celcius range ALWAYS!
I later found out much much later that the VME box had worked for a FLAWLESS 30 YEARS being replaced ONLY ONCE due to failing on-board capacitors and is STILL in the upgraded version of that data centre as of 2026 and another TWO SUCH STILL-VME-BUS BOXES are sitting well-packaged and re-tested thrice-yearly in the same control closet IMMEDIATELY READY to replace the currrent one, but containing motherboards that are all solid-state capacitors rather than electrolyte versions! The entire system will last another 65 years and that C++ temperature control code will be 100+ years old by then!
Sometimes things JUST GO PERFECTLY RIGHT and you get extremely lucky and can TOAST A COMBINED ONE HUNDRED GLASSES WORTH OF $250 Quid bottles of ROYALLY-embellished SCOTCH over-and-over-again to the utter greatness of an ULTIMATE FIGHTER CODER at their genius best!
Oh to the great, divine and well-retired Mr. M.C. Fetuzzi! We who are about to code in C++, Salute You!
May ALL code we ever meet and convert be as utterly well-commented and fully-documented as yours most certainly was!
We bow down to our knees to your COBOL CODING easy-to-convert-to-C++ source code making greatness!
V