# Why use \spaceskip and \xspaceskip here?

Plain TeX provides \centerline for centering, well, lines of text, but nothing to center a paragraph. LaTeX has \centering and the \center environment. Looking at the LaTeX code, it appears very similar to what Bechtolsheim proffers in "TeX in Practice":

\rightskip = 1in plus 4em
\leftskip = \rightskip
\spaceskip = .3333em
\xspaceskip = .5em
\parfillskip = 0pt
\noindent
On the other hand there are sometimes cases where you want to have a
sequence of lines, all centered, but you do not want to make the line
breaking decisions all by yourself. So here is a sample where \TeX{}
did all the work.

\bye


Bechtolsheim also gives a begin/end environment-like example using this code.

A previous stackexchange question has similar code: A center environment for plain TeX

My question is why does Bechtolsheim recommend the use of \spaceskip and \xspaceskip and how did he come up with those numbers? Why do LaTeX (I believe) and the solution @egreg provides in the previous question eschew them?

Admittedly I don't fully understand \(x)spaceskip so an explanation of them would be helpful.

p.s. I know the TUGboat and Amazon reviews of Bechtolsheim work (TeX in Practice) were only somewhat favorable, but I think the books are awesome. Yes, there are typographical and editing errors, but the content is great and I am finding the verbose examples extremely helpful and valuable. I would definitely encourage anyone who wants to learn the finer details of TeX to check them out. However, one should do at least a first reading of Knuth's "The TeX Book" first (dangerous bends being initially avoided), because Bechtolsheim does make some assumptions that the reader has a basic familiarity with TeX.

UPDATE: Great answer and comments. I think the ragged2e latex package documentation explains the issue quite well and points out that the Plain TeX version of ragged is in some ways superior to default LaTeX and attempts to fix it as well as the centering and raggedleft environments by essentially setting the fontdim2 value of a font (if available) to \spaceskip which provides optimal spacing while preserving the ability to hyphenate which is unfortunately lost when fil is used. I think a good Plain TeX implementation of centering, then should do something similar. It is also somewhat interesting that Schröder's package uses 2em instead of Bechtolsheim's 4em in the left/right skip registers.

-
They don't have stretch/shrink components, so the interword spaces keep at a constant "optimal" value. Same thing inside \raggedright. –  morbusg Jun 26 at 17:47
(and xspaceskip for after end-of-sentence) –  morbusg Jun 26 at 17:50
@morbusg In the @egreg and LaTeX implementations they use fil for the left/right skip (Bechtolsheim uses 4em). Does the fil make \(x)spaceskip unnecessary then? –  acarlow Jun 26 at 17:53
Good question! I'm not sure, but sure sounds reasonable. –  morbusg Jun 26 at 17:59
@acarlow yes.... –  David Carlisle Jun 26 at 18:08

The settings there use a finite amount of stretch so the text isn't too ragged (like ragged2e package \RaggedRight). But left on its own that would mean that any line stretching would be shared between the margins and the inter word space, so the spaceskip settings freeze those at fixed values.
@acarlow as wipet said. al,so see more discussion and side by side examples try texdoc ragged2e to see the ragged2e version of raggedright which is like the plain tex version with finite stretch –  David Carlisle Jun 26 at 19:57