Now, I'm not Java's biggest fan. In fact, I'm on the Crispy side - Java is slow, crufty, and the Java Way encourages the proliferation of objects.
But there is one thing I think is quite nice about Java, and something that should be ported to BYOND - specifically, the Javadoc tool. There's a variant available in some other languages - Python, for example, has a similar utility called Pythondoc.
I want BYONDdoc.
What should BYONDdoc do? It should read through DM source, and construct the object tree, including variables, procs, and verbs. While doing this, it should search for special comments that indicate what follows is documentation for the below type, proc, verb, or variable, and store this information in the tree.
Finally, it should generate a (or a series of) HTML pages summarising the object tree with the documentation included.
For example:
mob
//@type - Type used for all basic 'creatures' in the game
creature
var
//@var - The current health of the creature
health
//@var - The maximum health of the creature
maxhealth
That would generate a HTML file that would contain this information:
creature
Path: /mob/creature
Type used for all basic 'creatures' in the game
Variables:
health - The current health of the creature
maxhealth - the maximum health of the creature
Now, this isn't a particularly useful example, because the 'documentation' comments are blindingly obvious. But this can be useful for documenting other things, and should make it a lot easier for BYOND programmers to document their libraries, and their games. I'm a frequent offender on this count - I don't think any of my libraries have decent documentation.
I know I'd use it if I had a utility like this available (Or even if, wonder of wonders, it was included in the IDE)
I'd write it myself, but I don't think I have the knowledge. I can't come up with an algorithm to parse source code for the object tree in all cases. It generally falls down at use of braces and slashes, or worst, parent_type. I could write one where you had to put everything in the comment:
//@type creature, /mob, blah blah blah
But that's a lot uglier then what I originally had in mind.
Anyone more experienced feel like making something like this?
In a bad way.
But nah, this sounds good. It'd be even more awesome if those HTML pages had links on them that allowed you to instantly go to the right line in dream maker, too (so clicking on "creature" would take you to the definition of mob/creature in the .dm files). Although I can't really see how you'd ever do that just using standard HTML.