Thursday, March 12, 2009

Not Code, but Data...

I've spent countless hours trying to come up with clean, elegant, concise and readable systems/APIs. Hours spent trying to see if a Design Pattern will help me, refactoring code, reading about best practices, etc.

But one day I had a Zen-like revelation.

It's not about the code, it's about the data!

See, all a computer/program does is transform and move data from one format to another. All we do when we try to come up with fancy interfaces are just ways for us humans to understand how the computer/program will transform the data.

Of course, you still need to program the APIs in a nice, clean, elegant and readable way, but keep in mind that the end product is just transforming/moving data. Streams of bits and bytes get split up, operated on, and joined into new streams of bits and bytes.

So in games programming/engineering, you need to figure out what data you need. Come up with a transformation function, and then clean up/refactor/humanize the code without losing performance.

I think that's the meat of games programming.

No comments: