The Idea ToDo

The Idea

IDEs suffer from lack of knowledge: tools like CVS and DocBook have no knowledge of each other. ad-hoc parsing can solve some of this. The meaning of a comment, even when being external documentation can have several purposes: compare reference guides (each class, method), examples of usage (illustrative beyond the single method) and full-blown tutorials (how to get started with a package).

Coding guidelines suffer even worse: placement of braces, how big is a TAB, do I write "if (guard)" or "if( guard )". By storing the code in a hierarchical way (including semantics), layout is merely a View onto a Model (a la MVC). Note: this doesn't hold as much for Ruby, since it doesn't use very many braces and the languages enforces placement part of the time.

Naturally, anything integrated in an IDE (and things not yet integrated) can be helped by these semantics.

Example

Nothing in this example about packages, classes and such. Example is given a few times, with different XML.
<license id="lgpl" name="GNU Lesser General Public License"
	url="http://www.gnu.org/licenses/lgpl.html"/>
<code since="v0.0.1" license="lgpl">
def hello(str)
  puts "Hello, #{str}!"
end
</code>
Very simple, leaves code intact.
<code method="hello", implements_feature_request="1" params="str"
	author="Kero" copyright="Kero" impl="puts \"Hello, #{str}\""/>  
Adds a bit of semantics to the code snippet.
<method name="hello" params="str">
	<statement solves_bug="42" code="puts \"Hello, #{str}\""/>
</method>
xml element is <method>, which takes it all to a different semantic level. You'd also have <while> (and maybe things like <new_thread>?).
First thought of it (a few lines on freenode#ruby-lang): Wed 24 Sep 2003
First publication (on the web): Sat 27 Sep 2003, 10:35 CEST
Reason to put it here: prevent a patent on it. I mean, it's obvious. And there are a gazillion ways to use the XML.
Kero
The Idea ToDo