Frame-Based Editing
greenfoot.org
greenfoot.org
• Experiments in Code Typography (McDirmid, Microsoft) http://research.microsoft.com/en-us/projects/liveprogramming...
• Typography of Code (MAX 2010): https://youtu.be/mG0lyGekGDs (alternate recording: https://youtu.be/r2JePjrDggE)
• Elastic tabstops: http://nickgravgaard.com/elastic-tabstops/
Of course, there's also numerous projects with more significant visual representation, like Blockly, Scratch, flow programming, etc. And, of course, real-time feedback/simulation is another arena of usefulness e.g, http://research.microsoft.com/en-us/people/smcdirm/managedti..., Bret Victor's works, etc. But, I digress.
Some more info here: http://lambda-the-ultimate.org/node/4695
Paper with some screenshots: http://www.soe.berkeley.edu/boxer/20reasons.pdf
And another more contemporary document: http://www.pyxisystems.com/file/BoxerStructures.pdf
It goes beyond framing a bit, making things like variables concrete (they are actual boxes that contain a value). But it doesn't do full Scratch-style pluggable programming, the statements are still text, as in "Frame-Based Editing".
diSessa's book http://www.amazon.com/Changing-Minds-Computers-Learning-Lite... has more on the philosophy and the experience with kids using it. The writing style's a bit of a slog.
LISP used to have very structured editors. One of the features of INTERLISP was that you could select a subexpression and pull it out as a function. A call to the function, with the correct parameters, then replaced the function. Conversely, you could select a function call and have it expanded in line. These were safe operations; they would not change the program semantics.
That's the key. The editor understood the semantics of the language, not just the syntax, and only performed safe transformations. This sort of thing is useful in program maintenance; when faced with a large function, you can safely break it apart into smaller ones.
C++ could really use a tool like that. It would be very hard to write. The tool has to perform only valid transformations, so it needs to know the language.
We will start to tag actions like we label commits. Transforms will be parameterized so we can pull them into our tree, merging them with our own transformations.
If you use an IntelliJ product, you can put the carat inside an expression and iteratively expand the properly bounded selection with alt-up-arrow
Also, tree editors make implementing additional editor features. You don't get that benefit with emacs + paredit since the data structure is still a text string at the end of the day.
I shouldn't have said paredit - I thought it had become a general term (is there one?) Most of my experience is with Cursive's 'Structural Editing' (sounds general, but is it?) features, and that's what I had in mind.
I wouldn't give a newcomer emacs (or vi) but I would give them the concept of paredit. The problem with that is fundamentally the keyboard, and it's a problem for the more seasoned of us too. I would kill for a programmable numpad-sized keyboard with removable caps that can be labelled by design so I can have a physical button for the operations I perform most often. I know similar things can be achieved with midi pads, but they're far from perfect. Programmable, configurable keyboards were a thing when I was at school (around the tail of the BBC Micro era) - where did they go?
This is exactly what I was suggesting
However, it is an extremely effective way to get students interested in Java, and that is often the most important objective.
I agree with the premise (code is structured, and shouldn't be handled as flat files). I've played with the idea of using my own card-tree editor as a LISP editor before: http://blog.gingkoapp.com/features/gingko-as-a-lisp-editor
It's an avenue I definitely want to explore.
You can reflect the entire AST in your structure editor, so all text is parsed (just identifiers, or perhaps keywords). But then since basically all editor actions involve manipulating frames/ast nodes, you need to make the UX extremely smooth -- shortcut keys for high-level actions alone won't cut it.
and http://leoeditor.com/ to edit python code as outline