Settings

Theme

Duke Nukem 3D Code Review (2013)

fabiensanglard.net

15 points by erikano 11 years ago · 3 comments

Reader

tibbon 11 years ago

A serious question; did developers in the 90's simply not know things that we know to be good and true today (mutability can induce bugs, consistent naming is good, global state is almost always bad, huge switch statements bad, various code smells, etc), or were doing some of these things not efficient enough for the computers of the day for various reasons?

Like, there's definitely some smart thinking in this code, but there are also several things that just floor me. A 3000 line switch?

I also see this in JavaScript from the 90's. Everything global. No patterns. Its just weird.

  • JoeAltmaier 11 years ago

    Haven't seen it, but a large switch can be for implementing a state machine. Which is a good structure to put a whole lot of application code in. You can tell if all the states and events are handled; you can find exactly where code for a state transition lies.

nerdy 11 years ago

Really nice review of source for a truly classic game.

It's cool that we have source available and even better that it's so easy to digest with the help of the review like this.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection