What is the necessity of "Code Sample" button in the "Markdown Editor" of this site?
Even if the term "Code Sample" is not exactly "right" for this domain (English Language and Usage), it allows for the
<pre>tag defines preformatted text.
Text in a pre element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks.
It can be useful, for instance, when you are quoting poems which may use special indentations, using several spaces. In the simple HTML this editor allows, "several spaces" are not easily done.
Except in preformatted text.