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?"
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 atouchFileCommand
. Generic code paths that now look for a single execute method recursively should instead look for the firstCommand
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?"