Monday, August 21, 2006

Getting the big picture of source code

The way I see it, you should be able to look at program code, and pretty much work out what's going on straight away. And I mean "the big picture", like how all the files and classes work together, and which classes are used by which other classes. Unfortunately, that never happens, cos there is no standard or good way at the moment to see "the big picture". Maybe UML comes close, but no cigar. Is there a good Java class analyser out there?

When you look at code, you're doing just that - looking at 20-30 lines of one file of a program that could come be comprised over any number of files (including source, data, xml etc..). Who knows where this particular file fits in? Is it the Main file? Or is it the code to some abstract "missile" object that gets shot by the player, and is sub-classed for specific weapons? Until we sort this out, programming is always going to be hard.

Before you can take an open-source project and mould it into your own vision, you need to know the whole project, and that takes too long. Okay, you can fix the odd bug here and there, and change the names, but until you know it from top to bottom, you're only going to introduce bugs.

Programming shouldn't take a lifetime

I have a dream, that one day I will be able to write a game (after having the idea) in less than a day. Nay, in hours! Maybe I'm too impatient, but if I suddently think "yeah, a network RTS this feature x, y AND z would be great", I don't want to waste a week of my life writing it. I want it in a day! And why not? I'm not talking about using the latest "3D Gamemaker Pro" or whatever, I'm talking about having the power to write something quickly, but also get down to the nitty-gritty of the code if need be.

I'm still trying to think how this could be acheived; some kind of "code objects" that can be dropped into a framework. Re-usable classes would be a good idea. I suppose that game objects are too specific to be able to be written generically. You could have a generic "missile" object. Could that be used in an RTS and a 2D shoot'em up? Not without changing the code I fear.