I do alot of graphics related programming and alot of vector things I was wondering if anyone has ever thought of adding diagram possibilities to a compiler. I realize that it would seem wierd to add some diagram possibilities to a compiler but I'm sick of making ascii text diagrams in my code.
Is this possible?
Miscellaneous Forums/General Discussion/Is this possible? This is one of the weirder feature requests I've read.
Might be because I don't have a clue what you've asking about :D
Might be because I don't have a clue what you've asking about :D
Lets say that you are making a dungeon and have a variable for each room. How do you keep track of the room labels since the rooms arn't linear? Adding a diagram would be handy for this.
Possible? Yes. Well not so much to the compiler (which could care less) but you could certainly add them to an IDE.
How do you keep track of the room labels since the rooms arn't linear?
Use a non-linear data structure, like a graph? Well personally I'd organize them in an appropriate data structure. An array, most likely.
EDIT: Oops, missed the bit about the rooms being non-linear. Not an array then.
EDIT: Oops, missed the bit about the rooms being non-linear. Not an array then.
Well yes you could do that, here is another example. What if you had a vector image made of labled points, an image would be a quick way to organize spacific points. Basically, It would just add a layer of organization to your project. Perhaps you could explain a process better with pictures to someone who is learning from your code. There are some possiblilites. I have notepads full of my programming images.
Or you could use TYPEs... each room would have an individual ID so you would know what it was and where it was etc.
I thought Ryan was talking about being able to document code with diagrams/pictures, instead of just using text REM statements and ASCII art? I would find this ability useful but can't really think how it could be done. A source file that requires other external files for documentation isn't a good idea, I don't think.
You could have an ide that uses tags to build a diagram, e.g.
<diagram>
<line length="2.0" angle="90.0" startx="0.5" starty="3.8" colour="0A9F2C">
<oval width="2.5" height="3.1" centrex="10.2" centrey="0.5" angle="0.0">
</diagram>
This would be built in to the code then.
<diagram>
<line length="2.0" angle="90.0" startx="0.5" starty="3.8" colour="0A9F2C">
<oval width="2.5" height="3.1" centrex="10.2" centrey="0.5" angle="0.0">
</diagram>
This would be built in to the code then.
I guess that would work if the IDE had a built-in WYSIWYG editor to create the diagrams easily - I don't like the idea of having to build them programatically. The tags would have to begin with a REM, too, so the source would still work in other IDEs.
Does anyone agree that it migt be usefull? Especially when defining parts of a graphic object. What side of the triangle is side a? Well. if you had a diagram you could easly tell. I just think it would be pretty usefull and add a second layer of organization. Sometimes visual commentry would be easier than written commentary.
I, personally, don't seen it as being useful to me in the least. But if you do, then you can't be the only one.