I have a large collection of macros that do different things but all eventually use the same macro internally (call this macro \tasks). Sort of like this, but with better macro names:
\newcommand{\aa}{... \tasks}
\newcommand{\bb}{... \tasks}
...
\newcommand{\zz}{... \tasks}
The \tasks macro has several parts which should be executed conditionally. This could be done using etoolbox or just plain \if, something like this:
\newbool{subtaska}
\newbool{subtaskb}
...
\newcommand{\aa}{... \booltrue{subtaska}\boolfalse{subtaskb} ... \tasks}
\newcommand{\bb}{... \booltrue{subtaska}\booltrue{subtaskb} ... \tasks}
...
\newcommand{\tasks}{
...
\ifbool{subtaska}{...}{}
\ifbool{subtaskb}{...}{}
...
}
But all of this could also be performed using \let.
\newcommand{\subtaska}{...}
\newcommand{\subtaskb}{...}
...
\newcommand{\aa}{... \let\xsubtaska\subtaska\let\xsubtaskb\relax ... \tasks}
\newcommand{\bb}{... \let\xsubtaska\subtaska\let\xsubtaskb\subtaskb ... \tasks}
...
\newcommand{\tasks}{
...
\xsubtaska
\xsubtaskb
...
}
I know that the approach using \let won't work if arguments need to be passed to the subtasks, since \relax (or \@empty) wouldn't be happy with that, but that isn't an issue for me.
Is there any advantage in taking the conditional approach versus the \let approach (ignoring the issue of arguments with \let)? For example, are there any performance benefits (yes, avoid premature optimization...) or special additional pitfalls one way or the other?