Listening to: Hawkwind, Chronicle of the Black Sword.
I've been reading a lot of VMS BASIC[1] source code from the early 1990s[2] recently, and the one lesson it has taught me is that refactoring source code is vital for maintainability. Much of this source code originated in one program that was copied and edited whenever a new program was needed, so each new program generally ended up with a lot of rag-tag odds-and-ends code from the original program that was not actually needed for the functionality of the new program. Unfortunately, when one is trying to change some existing functionality one has to look at each and every program and figure out if that functionality is actually implemented and used in that program, and to do this you have to mentally trace the execution of the code! The moral? When you copy code, delete everything you don't actually use! Refactor, refactor, refactor!
And why didn't we use %INCLUDE more? There
are hundress of lines of external function declarations that are used
time and again in several programs; we should have put them in a
couple of include files.
I really wish VMS Basic allowed redimensioning array formal parameters, but I understand why it's not allowed. (Perhaps there should have been a specific descriptor for arrays that can be redimensioned?)
I was shocked to rediscover that there was no way of reliably building the system from the source code. MMS was too expensive for us at the time and if MMK existed we didn't know about it. We used a bunch of ad-hoc DCL command procecudures to compile whatever program we were working on (most of them were all in one source file, and linked against one library of utility routines) and these were never collected. So, you couldn't easily tell if the current set of executables was actually built from up-to-date source. Since I've been doing the odd bit of maintenance on this system every six months or so I finally broke down and created DESCRIP.MMS files for use with MMK, and I'm much easier in my mind now.
There were a number of things in this system that I think were well done, though, so it hasn't been all pain looking at it again.
[1] I'm working with it on an Alpha so I can't call it VAX BASIC anymore.
[2] The original version of this system ran on PDP-11 running RSTS/E. I've been involved in two major conversions of systems running on PDP-11 RSTS/E to VAX/VMS, both using the POISE DMS on both RSTS/E and VMS, with extensive homegrown applications written in VMS BASIC and using the POISE SPL API.