# How bad is slack \makeatother discipline really?

Following Will Robertson's admission that Fwiw, i'm not aware of any troubles with a missing \makeatother, but you're right. It's a bad habit of mine to omit it, and my own progressive slackness about the same thing following my realisation that I never see it matter, I wonder how important the \makeatother discipline is?

The worst consequence I can think of for experienced users from slackness about closing with \makeatother is that one's slackness might spread to omitting \ExplSyntaxOff with expl3, which is very far from trouble-free. But that's not a mistake anyone is going to get used to making.

The insidious worry is that not following the discipline means that some people might become unclear about the distinction between "package/Knuth namespace" and "user namespace".

But I can't say that either of these considerations seems very urgent. It doesn't seem important in the same way as such a programmatic discipline as eliminating avoidable state in interfaces. Is there something more compelling?

-
You soon know when you forget \ExplSyntaxOff! – Joseph Wright Feb 22 '11 at 18:59
Heh, I guess I shouldn't have admitted that! – Will Robertson Feb 22 '11 at 22:04

In theory it would be possible that there is a @ direct after a macro in the users document or in one of the auxiliary files. Without the \makeatother this would cause trouble.

A second source of trouble are special packages which read user input and compare them using \let/\futurelet and \ifx. I'm not sure how the array package parses a potential @ in the column definition of tabular, but e.g. my tikz-timing package allows @{<code>} sequences and I was wise enough to test for @ with catcode letter and other. If I wouldn't have thought of that a missing \makeatother would break certain user code without much idea why.

In general it is good programming practice to close everything you open explicitly by yourself. This can be \makeatletter/\makeatother or \openout/\closeout or anything like it. This doesn't apply when the change was localized using a group.

-
Good answer. There are some small packages around that don't check for the catcode of @ so you're absolutely right. – Will Robertson Feb 22 '11 at 22:06
I'm convinced. Incidentally, the question arose from this edit. – Charles Stewart Feb 23 '11 at 8:53

A problem with slack \makeatother discipline is that it clashes with the use of \@ to reset the space factor after non-sentence-ending periods.

\documentclass{article}
\begin{document}
Articles from the Proc. Amer. Math. Soc.

Articles from the Proc.\@ Amer.\@ Math.\@ Soc.

\makeatletter
Articles from the Proc.\@ Amer.\@ Math.\@ Soc.
\end{document}

-
Ah, this seems so because TeX doesn't remove spaces after the special single character macros. AFAIK it doesn't have to because it doesn't have to look ahead for the rest of the macro name because it is by definition only one character long. If the @ is a letter more letter could follow and the space is removed like after every normal macro. – Martin Scharrer May 17 '11 at 11:39
Thanks for providing the explanation. I was in a bit of a rush, so I hadn't. – Bruno Le Floch May 17 '11 at 11:48
This is an excellent point. It's also one that could easily be overlooked when proofing copy. – Charles Stewart May 17 '11 at 13:20