3 ms·
> Tree editors that only create grammatically correct code [...] should have been the norm decades ago. idk... i like the idea in principle. but consider a tas
by uryga 6y ago
> Tree editors that only create grammatically correct code [...] should have been the norm decades ago.
idk... i like the idea in principle. but consider a task like turning a big list-of-pairs literal into a dict literal¹ – the code spends quite a while² being completely syntactically invalid. if the edits can only be AST -> AST transformations, the editor would need a super-powerful way of describing them, or a mind-reading autosuggest... because you're pretty much interactively writing a lisp macro
---
¹ or anything where most of the line stays the same, but you need to reparenthesize things a bit
² even if you're using something like multiple cursors to batch-edit
- hhas01 6y agoMore importantly, being syntactically invalid isn’t wrong, just incomplete; a work in progress. Any editor that fights the user over that won’t be used for long before it’s kicked to the kerb in disgust.