The real truth is that I first had
\apptocmd{\@part}{\gdef\theparttitle{#2}}{}{}
with no initialization. Then I realized it was better to have \parttitle{#2} and a macro for setting \theparttitle anywhere needed. Then I remembered that an initialization was necessary.
But this style is very common in Knuth's macros. For example, in plain.tex
225 \outer\def\newcount{\alloc@0\count\countdef\insc@unt}
226 \outer\def\newdimen{\alloc@1\dimen\dimendef\insc@unt}
<other similar lines>
236 \outer\def\newlanguage{\alloc@9\language\chardef\@cclvi}
237 \def\alloc@#1#2#3#4#5{\global\advance\count1#1by\@ne
238 \ch@ck#1#4#2% make sure there's still room
239 \allocationnumber=\count1#1%
240 \global#3#5=\allocationnumber
241 \wlog{\string#5=\string#2\the\allocationnumber}}
Again
264 \outer\def\newif#1{\count@\escapechar \escapechar\m@ne
265 \expandafter\expandafter\expandafter
266 \def\@if#1{true}{\let#1=\iftrue}%
267 \expandafter\expandafter\expandafter
268 \def\@if#1{false}{\let#1=\iffalse}%
269 \@if#1{false}\escapechar\count@} % the condition starts out false
270 \def\@if#1#2{\csname\expandafter\if@\string#1#2\endcsname}
271 {\uccode`1=`i \uccode`2=`f \uppercase{\gdef\if@12{}}} % `if' is required
Presenting \@if before defining \newif would make it difficult to understand. It's always better to define auxiliary macros after the main one (if possible), so the role of each macro is clearer.
Last example
1017 \newbox\rootbox
1018 \def\root#1\of{\setbox\rootbox
1019 \hbox{$\m@th\scriptscriptstyle{#1}$}\mathpalette\r@@t}
1020 \def\r@@t#1#2{\setbox\z@\hbox{$\m@th#1\sqrt{#2}$}\dimen@\ht\z@
1021 \advance\dimen@-\dp\z@
1022 \mkern5mu\raise.6\dimen@\copy\rootbox \mkern-10mu\box\z@}
Allocating registers is best done before they are used, like declaring variables in programming languages. One might argue that in the code that started the discussion, \theparttitle is like a variable. However, TeX is based on macro expansion, so \theparttitle is actually a helper macro. If this had been written in LaTeX3, I'd have declared a token list variable beforehand.