This is a very general question. Apparently a duplicate of:
Other than syntax what is the difference between \dimen0= and \setlength{}{}?
What is the difference between \fboxsep=1cm and \setlength{\fboxsep}{1cm}?
In order to set lengths, in the documentation and in the various posts, the following syntax is used, where x is the target measure value:
\setlength{\lengthname}{x}
However, it is also possible to type, much more simply:
\lengthname=x
Is there any reason why the \setlength variant, while heavier, less convenient, is apparently widely favored?
Is there any difference with respect to the effect of either command, or potential restrictions?
\documentclass{article}
\begin{document}
\noindent
First Paragraph.
Second Paragraph.
\setlength{\parindent}{3em}
Third Paragraph.
\parindent=5em
Fourth Paragraph.
\end{document}

\parindent 5emis a valid syntax (i.e. the=is optional), similar to the case with\let– Udi Fogiel Feb 14 '23 at 01:50\parindent5cmwork? Apparently yes! It becomes much lighter than\setlength, I think it is safe to use this simplified syntax inside a document. – Vincent Krebs Feb 14 '23 at 01:52plus, I would get into troubles withyello \hskip 10pt plus blue gives the color green. In this case you would need to add\relax, just as\setlengthdoes. – Udi Fogiel Feb 14 '23 at 02:03