Should additional groups like \begin{algorithm} ... \end{algorithm}
be generally avoided and the use of \algorithm...\endalgorithm
be preferred?
By additional is meant, that there is at least one other group. For clarification see this answer and it's comments.
Some answers where it's told to do so:
I also made small changes to the environment definitions. The \begin and \end are not needed. They add an additional group and will lead to misleading error messages if there is some erroneous input.
from Typesetting chord progressions
Secondly, rather than writing \begin{algorithm}...\end{algorithm} inside your environment I would just use \algorithm...\endalgorithm. The two are almost the same except that that the first version puts everything inside its' own group, which isn't really necessary here because your environment starts its own group.
from Multiple Counters on algorithm
I'm unsure if When to use or avoid grouping? is related.
Where it isn't done:
In Group statements, avoid pagebreak the use of \begin{xyz} ... \end{xyz}
is chosen.
\documentclass{article} \newlength{\foolen} \newenvironment{foo}{\setlength{\foolen}{17pt}}{} \begin{document} \begin{foo} \end{foo} \the\foolen \foo \endfoo \the\foolen \end{document}
. The grouping mechanism is established within the environment, so\foo
and\endfoo
are sufficient. Using\foo
and\endfoo
outside of the environment group there will be no group, unless\foo
and\endfoo
are explicitly defined this way, see the various examples inlatex.ltx
\end...
instead of\end{...}
, as far as I know