i feel like this discussion is why i’d like to see...
# thinking-together
g
i feel like this discussion is why i’d like to see a language/compiler/IDE that treats code editing as a sequence of transformations that get saved. it’s the best argument i think for structural editing: if you have semantic understanding of the syntax changes you’re making, “undoing” an abstraction would be a simple edit to the history where you undo the abstraction, or an append case where you “unroll” it into the result of the abstraction. eg: “inline” a function in one command to replace all calls with the function’s body with the called arguments filled in
👍 1
p
Also reminds me a bit to Uncle Bobs Transformation Priority Premise
d
I've been using revision control software for a long time now. It lets me roll back changes. Let's say you created an abstraction a year ago. It seemed like a good idea at the time, but now it is getting in the way of the changes you want to make. Eliminating that abstraction is far more complicated than simply rolling back those changes you made a year ago, because this rollback invalidates a bunch of changes that have been made since you introduced the abstraction. I'm facing this issue right now in my current project. The abstraction isn't a function, it's a class inheritance hierarchy with a complex protocol. It's a typical OOP thing: to eliminate boilerplate, you define a set of subclasses, and override virtual functions according to various patterns. Now that the class hiearchy no longer works for me, it's going to be complicated to redesign the code to meet my new requirements. I don't see how I can push a button to get the job done, and I'm not sure how a slightly higher level view of my code change history will substantially help.
👍 2
g
yeah, it would have to be a custom language and environment. you’d need something like unison’s content addressing system. if i were to buzzword it i’d call it a “semantic addressing” system