breck7 / scrollsdk

Build on top of Scroll.
https://sdk.scroll.pub
380 stars 17 forks source link

Move away from single core functions, switch to decorators across method calls that better explain what the method is doing #109

Closed breck7 closed 1 month ago

breck7 commented 3 years ago

In grammar langs we have execute methods.

But then the problem is execute is not a very helpful name.

In fact, it's a pretty terrible name.

So we should have a decorator command function strategy. So instead of a Stamp file node having an execute method, it should have something like a touchFileCommand. Generic code paths that now look for a single execute method recursively should instead look for the first Command function and call that.

This way, when I return to a language a few years later, I'll be able to know what a function does by reading the name, and won't have to wonder "wtf does execute mean for a file node?"

breck7 commented 3 years ago

related: https://github.com/publicdomaincompany/jtree/issues/137

breck7 commented 1 month ago

Just doing this gradually as we go.