A Conversation for The H2G2 Programmers' Corner
Visual Programming
26199 Started conversation Oct 11, 2003
Hi folks,
I'm about to start a one-year programming project on my compsci degree course... currently I'm doing some research, so, what better place to ask than h2g2?
The project is basically to turn Java into a visual language. I'm going to make an editor which will let you create a Java program, modify it, then output the source code, all via an interface which minimises unnecessary text/formatting and maximises the amount of visible structure.
So -- visual languages... any good? Can you point to any which I can actually play with? What are the advantages and disadvantages over plain text?
And, for those who use Java (or C/C++, really)... is consistent layout/formatting a problem? Is navigating in a program something that could be made easier with a graphical representation? How about readability? Is my project even remotely sensible?
I should point out at this stage that I'm not talking about a system for showing classes, relationships between classes, and so on -- I'm talking about doing a similar thing right the way down to the source level. Hopefully
Any thoughts, opinions, flames, and so on, would be great
Visual Programming
Dogster Posted Oct 12, 2003
No particularly great suggestions I'm afraid, but I'd certainly be interested in seeing what you come up with. I feel like there is so much structure in a typical C++ program that there must be a better way of representing that structure rather than just the source code.
One thing I do like, although I think it's a small thing compared to what you're aiming at, is some editors will hide / show the contents of a { } pair when you press a key. So, you might have
int main()
{
...
program goes here
...
}
but you press one of the F keys (say F6) when the cursor is over int main() and it changes to just
int main()
except it's now in bold, or highlighted or something
You could do the same thing with any {} pair, for loops, do loops, etc. If you could represent a control structure like that as an icon (or perhaps just a piece of highlighted text), which when you click on it opens up in another window (or expands in the same window if you prefer), that might be quite nice for readability and understanding the structure. You could attach a comment to the icon/highlighted text which appears when you hover the mouse over it, and so on.
I think you could take it a lot further than this though. One possibility would be to integrate your visual editor with the algorithms your program uses. For example, searching is a common algorithm, you could have a visual display of a search algorithm. It would have to have a representation of what was being searched, the search algorithm and the searching criteria. If you were doing it with C++, the STL would provide a good model. (This would encourage modular programming as well, which would be good for maintaining programs.) You'd be able to look at your program and say "Ah, that picture means he's searching through the ... array for something that matches criteria ..." without having to read the code. So instead of something with lots of horrible std::list::iterator i statements you'd just have a small and simple summary. You could have an iconic, "compact" or "expanded" representation, as well as the full code as options.
I don't know if Java has an equivalent to the STL, but I think it would be a good thing to look at if you wanted to do something like the above.
Visual Programming
26199 Posted Oct 12, 2003
Hmm, yep, those are the lines I'm thinking along... and if it goes as planned it will be fairly straightforward to apply it to C or C++ instead of Java. In theory
I'll let you know if/when there's a website about it... no doubt there will be at some point.
Visual Programming
Calculator Nerd 256 Posted Oct 12, 2003
i must be confused
don't most ides do that sort of thing?
in my java class (pun intended) at skool, we have to use an ide
i prefer text editor and cli, but i dun get a choice
>8^B
Key: Complain about this post
Visual Programming
More Conversations for The H2G2 Programmers' Corner
Write an Entry
"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."