I don't think I ever tried that. I had a toolkit for Mallard BASIC that gave it graphics commands, and I spent my time mucking around with fractals.
But in my first job, the company, CSL Delta, sold a custom payroll app tailored for Manx tax law, and the original version was entirely in GW-BASIC. It was a 300-400kB app, and GW-BASIC only allowed 64kB of code+data. (8086 "small" model, I think it's called: a single segment of RAM.)
The develop, my boss Alan Wright, worked around this with highly modular code: a main menu loaded other modules, but if you loaded a BASIC file from BASIC in the right way, it overwrote the code in GW-BASIC's memory but not the data. He had a big COBOL-style block at the start of every module specifying all the variables and warning you not to overwrite them, so the main menu created all the data structures, then submodules let you enter paypacket data, amend employees, run reports etc. -- all without recreating or initialising any variables.
It was actually very elegant, very carefully structured, and lavishly commented. Clear, easy to read, easy to work on.
My first and last ever programming job was amending the reporting module so it worked on an 80-column printer. The app had long ago sold enough to pay off its development so now was selling cheaply enough a customer bought it who was too cheap to buy a 132-column dot matrix.
I worked all Friday, took it home and worked all weekend in the PC Emulator on my Archimedes, finished on Monday morning and showed it to Alan.
He said my code was clean enough, but what if we wanted to drop a different column, or add one back?
I paled and said I could do that in another day or so.
He said no, why don't we just store a flags array, and if a column has a "1", print it, and if it has a "0" don't.
He ripped out my few hundred lines and replaced them with his routine, 10% of the size and far more flexible. It had some checks if stuff would fit and so on, too.
He didn't bother to sit down while doing it.
I never professionally wrote code again, apart from the odd shell script.
Anyway: yep, GW-BASIC could do that too.
Snag with the overlay structure: we couldn't compile it with QuickBASIC 3. Not without a major rewrite, anyway. (Side effect: all customers had full source code.)
Alan wanted to rewrite the payroll in QuickBASIC 4, which was fully modular, no line numbers, etc. Management refused to let him: it offered no functional improvement, and it was still selling profitably.
He quit, started his own company, and rewrote it from memory and proceeded to sell a few more copies.
no subject
Date: 2025-01-07 02:07 pm (UTC)Thanks for that!
I don't think I ever tried that. I had a toolkit for Mallard BASIC that gave it graphics commands, and I spent my time mucking around with fractals.
But in my first job, the company, CSL Delta, sold a custom payroll app tailored for Manx tax law, and the original version was entirely in GW-BASIC. It was a 300-400kB app, and GW-BASIC only allowed 64kB of code+data. (8086 "small" model, I think it's called: a single segment of RAM.)
The develop, my boss Alan Wright, worked around this with highly modular code: a main menu loaded other modules, but if you loaded a BASIC file from BASIC in the right way, it overwrote the code in GW-BASIC's memory but not the data. He had a big COBOL-style block at the start of every module specifying all the variables and warning you not to overwrite them, so the main menu created all the data structures, then submodules let you enter paypacket data, amend employees, run reports etc. -- all without recreating or initialising any variables.
It was actually very elegant, very carefully structured, and lavishly commented. Clear, easy to read, easy to work on.
My first and last ever programming job was amending the reporting module so it worked on an 80-column printer. The app had long ago sold enough to pay off its development so now was selling cheaply enough a customer bought it who was too cheap to buy a 132-column dot matrix.
I worked all Friday, took it home and worked all weekend in the PC Emulator on my Archimedes, finished on Monday morning and showed it to Alan.
He said my code was clean enough, but what if we wanted to drop a different column, or add one back?
I paled and said I could do that in another day or so.
He said no, why don't we just store a flags array, and if a column has a "1", print it, and if it has a "0" don't.
He ripped out my few hundred lines and replaced them with his routine, 10% of the size and far more flexible. It had some checks if stuff would fit and so on, too.
He didn't bother to sit down while doing it.
I never professionally wrote code again, apart from the odd shell script.
Anyway: yep, GW-BASIC could do that too.
Snag with the overlay structure: we couldn't compile it with QuickBASIC 3. Not without a major rewrite, anyway. (Side effect: all customers had full source code.)
Alan wanted to rewrite the payroll in QuickBASIC 4, which was fully modular, no line numbers, etc. Management refused to let him: it offered no functional improvement, and it was still selling profitably.
He quit, started his own company, and rewrote it from memory and proceeded to sell a few more copies.