(@ChathuraGH your deleted post raised a valid concern.)
On devices that support touch input—including a lot of Windows laptops—Discourse’s editor toolbar makes it hard to find the Preformatted text button that inserts a code block:
The code button is hidden inside the gear menu.[1] (But Insert date/time is included in the main toolbar
.)

Discourse decides toolbar contents based on presence of a touch input device, rather than responsive layout (it just wraps wide toolbars). On non-touch devices, Discourse includes the code button early in the editor toolbar, no need to dig around:
To fix this, we could customize Discourse’s CSS+JS (thread starting here) or add a theme component that shows the code button in all toolbar layouts.
(Also, it might be helpful to call this button “Code” rather than “Preformatted text.” I think that’s configured in Discourse under Admin > Customize > Text > js.composer.code_title.)
The gear/cog button has its own usability problems: a gear usually means “settings” or “preferences” (including elsewhere in Discourse itself!), not “more toolbar commands.” And nothing about it suggests it will pop up a menu. ↩︎

