# Macro naming best practice?

Is there a preferred or generally accepted idiom for naming user defined macros? I notice that in the change from Tufte 3.5.0 to 3.5.2, for example, the names of the debugging macros have change, for example from

\TufteDebugInfoNL


to

\@tufte@debug@info@noline


Does this correspond to some agreed to practice?

-
Don't think there is agreed standard, but using the prefix @tufte (but just as good as Tufte) is a good idea to help avoid name collisions, and the use of @ signs makes it even less likely to have name collisions as that requires special handling in regular code (i.e., \makeatletter ... \makeatother). –  Peter Grill Mar 16 '12 at 0:39

LaTeX does try to encourage a naming scheme

Document level commands (\section) lowercase.

Package interface commands (\DeclareTextCommandDefault) CamelCase.

Package or kernel internal commands (\@text@composite@) lower@case@with@.

TeX primitives (\expandafter) lowercase.

Mostly this convention is not enforced, and of course one might notice that the top and bottom layer using the same convention makes enforcing anything difficult. LaTeX3 addresses this by renaming all the commands at the bottom layer.

So the command you mention has changed from using a "package interface name" to an "internal name" but whether that is appropriate in this case I couldn't judge, not knowing that class.

-
How does that work out, to just decide that all commands on the bottom layer are to be rewritten? It feels like that means a lot of rewriting of packages and classes. –  StrawberryFieldsForever Jun 15 '12 at 9:26
I think "renaming" in this case means defining aliases. –  marczellm Sep 6 '13 at 17:01
@marczellm defining aliases and undefining the original names –  David Carlisle Nov 11 '13 at 22:21
@DavidCarlisle Can you undefine a primitive? –  marczellm Nov 11 '13 at 22:23
@marczellm \let\def\undefined –  David Carlisle Nov 11 '13 at 22:27