Re:Just what does “code as data” mean anyway? (2014)
by didibus on Friday February 16, 2018 @02:41PM
(#16395339)
Yea, that's true, but your editor pane is a text editor non the less. The refactoring in this case is structured, even more so, its semantically accurate to a specific language. But your editor isn't. A structural editor does not allow you to make edits that would go against the syntax rules of your language.
[ Parent
| on HN ]
Re:Just what does “code as data” mean anyway? (2014)
by lazyasciiart on Saturday February 17, 2018 @09:00PM
(#16403997)
It sounds like you're saying a tool can only be a structural editor if it doesn't do anything else. I want an editor that can operate structurally AND as a text editor - I don't write new code as syntactically complete units in one keystroke.
Re:Just what does “code as data” mean anyway? (2014)
by jyounker on Saturday February 17, 2018 @08:49PM
(#16403951)
I'd argue that IntelliJ is a structured editor. If you look under the hood the entire system is build around a tree-representation of the code. The "text editor" is a thin varnish on top of that syntactic representation.
Re:Just what does “code as data” mean anyway? (2014)
by dmitriid on Friday February 16, 2018 @02:56PM
(#16395515)
> your editor pane is a text editor non the less
And the editor pane with paredit somehow becomes a magical structural editing machine?
Paredit knows exactly zero things about your code. The only thing it can do is match brackets/parentheses and move code between them. That's it.
In an actual code editing tool that actually understands code structure and semantics, I can:
- select and move semantically and structurally valid blocks of code
- extract parts of code into a separate variable
- extract parts of code into a separate function
- extract parts of code into a separate module
- safely rename variables and functions across multiple files
- simplify/split/extract/generify code
- ... many more ...