Over time have seen csname but I never had to learn it until now.
But after reading @egreg's (beautiful!) answer to What exactly do \csname and \endcsname do?, I am not so sure if this is good coding.
Here is a test showing strange bahaviour:
\csname endcsname\csname endcsname \endcsname\csname backslash endcsname\endcsname
The first two worked as expected. i.e. they generated errors, but the last one gave no error. I would love to understand what I missed!?
(Certainly, there are pros: you may reuse code and you can tweak space etc.)
\csname..\endcsnamecan be used nicely for triggering expansion. Besides this\csname..\endcsnamecan be used for creating control-word-tokens whose names contain characters which are not of category code 11(letter). TeX does tokenize\ab12as tokens\ab,1,2.\csname ab12\endcsnameyields a single control-word token\ab12. – Ulrich Diez Dec 08 '21 at 14:43\csnameis for generating command tokens eg\begin{...}is more or less defined to be\begingroup\csname #1\endcsnameas it needs to convert the environment name to a command. So if you are defining such a "meta" command you may need\csnameif you are not, then you do not need it. – David Carlisle Dec 08 '21 at 15:36