4 ms·
The main problem with structured editing is that it requires programmers to write code in a certain order that is often goes against their "flow;" enforcing a r
by seanmcdirmid 13y ago
The main problem with structured editing is that it requires programmers to write code in a certain order that is often goes against their "flow;" enforcing a rigid flow is a huge usability negative. Even without structured editing, we see cases where increased flexibility improves flow; e.g. in dynamically typed languages. Unfortunately, improvements in flow often lead to reductions in feedback (e.g. via static typing).
There are things we can do to have our cake (flow) and eat it (feedback) also. Code completion was one of the great boons of structured editing (introduced in Alice Pascal circa 1985), and by the late 90s we learned how to create "language aware" editors that could leverage this feature without flow disrupting structured editing. The same goes for static typing: we can, through some heavy type inference, infer semantic information responsively while the user is typing, and use that to provide responsive feedback.
I'm in the camp where the programming experience should be considered holistically. The IDE is a part of that experience, and so language design should occur concurrent with IDE design. With some smart incremental compilation magic along with language-specific rendering in the IDE, we can build programming experiences that provide the benefits of structured (and projectional) editing without the flow costs. Or at least, that is the premise of my research :)
- joe_the_user 13y agoThe main problem with structured editing is that it requires programmers to write code in a certain order that is often goes against their "flow;" enforcing a rigid flow is a huge usability negative. I agree that structured and visual editing paradigms have failed. But ultimately all you're saying here is that structure approaches haven't offered enough positive to offset the cost of learning them. That may be true but it would be good to know why. My guess is that the data structures generated by the text of programs is just too varied and complex for any visual representation system to be of use. The programmer is interested in the final structure of their application and every intermediate one. Creating a program to represent those visually should be harder than implementing the application. Multiply that by every application that could exist.
- seanmcdirmid 13y ago> But ultimately all you're saying here is that structure approaches haven't offered enough positive to offset the cost of learning them. That may be true but it would be good to know why. No, I'm claiming that bad flow, even after you've learned and adapted to a structured paradigm, needs to be solved directly. Even if you can provide really great feedback, the bad flow will still exist and cause inefficiencies not offset by enhanced feedback, which is aimed at an orthogonal set of problems. Edit: a good analogy might be between agility and armor in a tank. You can obviously make the tank more survivable by improving either one, but its overall usage becomes more limited when emphasizing one feature at the expense of the other.
- 6cxs2hd6 13y agoThere's a structured editing mode for Emacs called Paredit, to use for s-expression languages like Lisp, Racket, Clojure. Since the AST for such languages is s-expressions, and some people struggle with parens, this is an interesting "fun size" example of editing the AST. The thing is, paredit is quite challenging for most people to adopt, due to what you mentioned about the "flow" they've already learned. Magnar Sveen has a great video about this at http://www.youtube.com/watch?v=D6h5dFyyUX0 http://www.youtube.com/watch?v=D6h5dFyyUX0 Best quote: "If you think paredit is not for you, then you need to become the kind of person that paredit is for." EDIT: To clarify, Magnar is quoting technomancy a.k.a. Phil Hagelberg.
- MBlume 13y agoAvailable for vim as well. This is one of the things that consistently makes my life better. http://www.vim.org/scripts/script.php?script_id=3998 http://www.vim.org/scripts/script.php?script_id=3998
- calibraxis 13y agoYes, Paredit's not really a straitjacket, but your editor having new concepts — verbs which operate on code units. It overrides some deletion commands to maintain your code well-formed, but there's simple ways (like cutting text) to break those rules, so it's ill-formed. (Currently, paredit won't start if it sees you're editing ill-formed text. But if it's already started, it'll continue running.)
- 6cxs2hd6 13y agoRight, I realize it's not an inescapable straitjacket, and I'm definitely not putting down paredit; upvoted your comment. I mention it because it's an example of structured editing of an extremely simple AST. And even people who want to use it (who want to leverage the so-called "straitjacket"), often find it quite hard to change their flow and adapt it. That seems not to bode well for this being enthusiastically used generally. OTOH I suppose you could argue that a lot of people like auto-completing IDEs, and/or hate to type, so who knows.