[Tex/LaTex] the purpose of \raggedright

plain-tex

I thought that \raggedright is used to get text: 1) not exceeding certain width, 2) with natural interword spaces, 3) without hyphenation. But it turns out that hyphenation is done with \raggedright. So, what this macro was conceived for? Why was not it defined as \myraggedright, instead of \actualraggedright? (see examples below)

And why is it bad to use \rightskip=0pt plus 1fil in \myraggedright for ragged right effect (as said in the following passage from TeXbook, page 101, second paragraph)? It seems to work flawlessly.

For example, a person can set \rightskip=0pt plus1fil, and every line will be filled with space at the right. But this isn't a particularly good way to make ragged-right margins, because the infinite stretchability will assign zero badness to lines that are very short.

Example 1:

\def\actualraggedright{%
  \rightskip=0pt plus 2em
  \spaceskip .3333em \xspaceskip .5em\relax
}
\magnification=\magstep5
\actualraggedright
\frenchspacing
\noindent
There are not many different types of question that can be asked on Fourier series so, if you practice,
you should not have any surprises in the exam. In addition to the questions in the mock exam papers
and the blue book, there are many Fourier series questions available in maths text books or on-line.
\bye

Example 2:

\def\myraggedright{%
  \rightskip=0pt plus 1fil
  \spaceskip .3333em \xspaceskip .5em\relax
}
\magnification=\magstep5
\myraggedright
\frenchspacing
\noindent
There are not many different types of question that can be asked on Fourier series so, if you practice,
you should not have any surprises in the exam. In addition to the questions in the mock exam papers
and the blue book, there are many Fourier series questions available in maths text books or on-line.
\bye

Best Answer

\raggedright is for cases especially narrow text blocks where full justification will not produce a good result.

If you allow arbitrary stretch then you can get very ragged text which can usually be improved by restricting the raggedness.

Compare these two settings of the same text.

enter image description here

\magnification=\magstep5
\noindent X\hrulefill X

\frenchspacing
{\raggedright

\noindent
There are not many different types of question
that\-can\-be\-asked\-on\-Fourier\-series\-so,\-if you
practice, you\-should\-not\-have\-any\-surprises\-in\-the exam.
In addition to the questions in the mock exam papers
and the blue book, there are many Fourier series
questions available in maths text books or online.

}
\def\myraggedright{%
  \rightskip=0pt plus 1fil
  \spaceskip .3333em \xspaceskip .5em\relax
}

\bigskip

{\myraggedright
\noindent
There are not many different types of question
that\-can\-be\-asked\-on\-Fourier\-series\-so,\-if you
practice, you\-should\-not\-have\-any\-surprises\-in\-the exam.
In addition to the questions in the mock exam papers
and the blue book, there are many Fourier series
questions available in maths text books or online.

}
\bye