Thursday, July 19, 2007

Comments & Annotations

Code should be well commented. While methods and variables can have names that speak for themselves, most aspects of a system need to be written down somewhere else for future programmers to understand it.

This is -uhm- problematic these days, and with a powerful development environment it will be worse. Immersive Development should enable us to create systems far more complex than those we build today. As I wrote before: our sense of orientation in a 3D environment is very powerful. Commenting will therefore be more important.

Today, I can comment code and "pin" editors. That way, I can always have the relevant information in focus, and I can leave myself notes in the comments I write.

In a 3D environment, I would probably stick yellow notes with comments onto the objects. And I would use a telescope tool with a shortlist so I can quickly find the objects I am currently working on.

But there could be lots of other ways:

Remember those key-ring beepers? Stick a virtual beeper onto an object and it will shine or flash when you "call" it.

Create a shortcut to an object and stick it behind your virtual ear, onto your virtual forehead, or onto the back of your virtual hand.

Stick a huge flag into the object so you can see it even when you "are far away". Or paint the object with some neon colour.

Or what about this: you are currently working on two aspects of the system: one is the caching system you created to limit database access. The other is some complex functionality triggered by a button on the UI. Zoom out and grab the whole system. Turn it around slightly. Now pull all objects (classes, interfaces, libraries) implementing the cache towards you so you can see them. Grab the whole system again and turn it around some more. Now grab the objects involved in the calculation and pull them towards you. You can now just turn the whole system around slightly to switch your point of view. Had an idea for the calculation? Turn the system to the right and work on it. Then turn it back and continue on the cache.

And I'm sure there are more ways then I could even count...

1 comment:

Unknown said...
This comment has been removed by a blog administrator.