Carmack’s code at the time was kind of amazing. In the most complimentary way possible, I call Carmack a “coding insect.” Like how a bee knows how to build a hive, Carmack codes with a complete picture in his head of what parts he needs to make a whole. Back then with every generation game engine he’d start over from scratch—I mean really from scratch, not namby-pamby “I rewrote some of the code and called it scratch.” Since his engines ran on a variety of machines and OSes, he wrote every damn function himself. Carmack needs to log something? Carmack writes a logging function. New generation of engine? New logging function. EVERYTHING from SCRATCH.
Because I was young, super-anal, and wasn’t on SSRIs back then, I once asked Carmack why he didn’t use libraries for common functions that he could share between engine revisions. Carmack’s a super-nice guy, but on this one instance he used the “Well, I think my methods work pretty well…” defense. I never suggested coding style changes again.
But, really, for him it made no sense to share code, because, like a bee, it was just as fast to write new code. The template was in his head, he types really REALLY fast—why bother importing something?
Don’t take this to mean his code was spaghetti—it was actually some of the easiest-to-understand code I’ve ever worked with. It has an almost indescribable quality of “obviousness.” Like, you know when a really good teacher explains something, it seems obvious? That’s what his code was like. I mean, OF COURSE there’s a loop where you service the pending events and call a refresh on the UI layer.
– Wil Shipley, “My ‘Doom’ 20th Anniversary Stories“