[Tex/LaTex] Why do people use braces around the control sequence in \newcommand

macros

I've seen in every introductory material on LaTeX and in a lot of code of other people (event experts) that the \newcommand command is used by wrapping the first argument in braces, even if it seems unnecessary to me.

The braces are consistent with the usual way arguments are passed to LaTeX commands (since usually the braces are used even if the argument is made of a single token, for consistency and clarity), but in this single case they appear very ugly to me and in my opinion they lower readability.

But these are opinions, while the question is technical: is there any technical reason why one should write this:

\newcommand{\mycmd}[1]{Hello #1}

instead of this:

\newcommand\mycmd[1]{Hello #1}

Best Answer

The official latex syntax, as described by the LaTeX book only ever uses the braced form, and similarly always uses x^{2} rather than x^2.

However the unbraced form works fine and for arguments that are necessarily a single token such as the first argument of \newcommand. That is effectively also supported syntax and you will find many examples from the LaTeX Project team using that style.

Of course dropping braces technically also works even when the argument isn't necessarily a single token, people go \frac12 instead of \frac{1}{2} or even, x^\frac12 instead of x^{\frac{1}{2}} but really, they shouldn't....