# Making a character active vs assigning it a specific catcode

My query arises from my answer to Tab not as extra alignment tab and Andrey's rather nicer version. The question at hand involved making the TAB character usable for aligning tables. I assigned it to catcode 4, alignment, whereas Andrey used catcode 13, active characters, and then gdef'd it to &.

So my general question is: supposing we want to make a new character act like & or ^ or whatever, when is it best to reassign a character to a more specific catcode (like 1-4, 7, or 8), and when is it best to use the all-purpose catcode 13?

(In the related question Active characters let to a (non-active) character it was mentioned that it may not be a good idea to redefine existing characters in these categories to active versions of themselves, but I'm talking here about making new characters.)

• I made the character active for the sole purpose of detecting multiple tabs. Otherwise, the specific catcode would seem better and more "correct". The general rule, IMO, is avoid active characters unless necessary. – Andrey Vihrov Oct 3 '11 at 16:36

In Andrey's solution making ^^I active was necessary because he wanted to catch two consecutive tabs and reduce them to one:

\gdef^^I{\@ifnextchar^^I{}{&}}


\newenvironment{tabbedtabular}[1]
{\catcode\^^I=4 \begin{tabular}{#1}}

will do, but it won't catch consecutive tabs, interpreting each of them as if it were & (neither approach solves the original problem, in my opinion, but it's another matter).
I wouldn't forget category 9 (ignored). A category 9 character stops the scanning of a control sequence name, for instance. This approach is followed in LaTeX3: in .sty` files the space is ignored, which is very handy for avoiding the "spurious space nightmare".