I do use, and want to use, UTF-8 (and selected Unicode blocks) in comments, because they should convey the information with minimum cognitive load, and I personally do need UTF-8 to do that.
For the same reason as browsers allow users to set a default font for serif/sans-serif/monospace, I do believe it would be useful to have a "standardized" comment form that will be rendered in a separately-selectable monospace font with wide Unicode coverage. I fully understand tggzz's font worries above, but often the most comfortable character set for code in your code editor does not have good Unicode coverage at all. This is exactly where
my suggestion about a standard Unicode comment form would be particularly useful: it would allow programmers to use their preferred Basic Latin or ASCII font for code and comments, but a wider-coverage font for Unicode comments.
Technically, U+002F U+002F U+2003 or
"// ", the third character being
em-space, would be near-perfect, except it is very hard to type.
This is why
I suggested "//|" for C and C++ for exactly this, as it is easy to type, and is somewhat aligned with existing practices, and should be easy to add to existing editors.
It does not affect me personally that much, because I use
UTF-8 Everywhere, and a monospace font (NoTo/DejaVu Mono/FreeMono) with wide Unicode coverage for my source code and plain-text documentation files.
I just wanted to show how using Unicode (especially for math expressions) via UTF-8 can yield
better code comments, and maybe spark some ideas (and hear any objections) others have related to that. I do know some people really don't like UTF-8.
I do strenuously reject comments that refer to documentation, except for naming a specific documentation file. For math-heavy projects, this leads to documentation being split into multiple files.
(As an aside: what file format to use for rich text? HTML+CSS+JS works in a browser even locally, but is annoying to edit. LaTeX and word processing formats save horrible HTML, but quite nice PDF files. LaTeX, TeX, and MathJax and various markup languages, can produce very nice output in various formats, but one needs those document authoring tools installed to edit the documentation, and if it takes too much time/effort, it will not get done.)
I personally do like plain text files with UTF-8 for documentation (except LibreOffice + Math for reference book style math with proofs, or LaTeX for physics), assuming the file is displayed with a monospace font that covers at least Unicode blocks
Latin 1 Supplement (Ä, ö, é, ç, ×, ÷, ·, µ, ±, °),
General Punctuation (non-breaking space, ' ' aka em-space for graphics, ―, –),
Greek and Coptic (π, φ, ω, λ, β, etc.),
Box Drawing (┤,╦, ╱, ╲, ╳, etc.),
Block Elements (▘, ▞, ▙, █, ▓, ▒, ░, etc.),
Arrows (←, ↑, →, ↓, ↔, ↕, ⇐, ⇒, ⇔, etc.),
Mathematical Operators (≃, ≈, ≠, ≡, ≢, ≤, ≥, ∂, ∑, ∏, ∫, ⊕, ⊖, ⊗, ⊘, ⊙, ⊚, ⊛, ⊜, ⊝),
and ballots (☐, ☑, ☒) from
Miscellaneous Symbols.
Enclosed Alphanumerics can be very useful for dense (single-character) 2D matrices or tables with 20 (numbers ①, ②, ‥, ⑲, ⑳; ⑴, ⑵, ‥, ⒆, ⒇; ⒈, ⒉, ‥, ⒚, ⒛) or 26 (uppercase letters Ⓐ, Ⓑ, ‥, Ⓩ) single-character elements; the enclosed lower-case letters (ⓐ, ⓑ, ‥, ⓩ) are often not very legible.
Within code comments, the set I need is basically the same, except for Block Elements, Miscellaneous Symbols, and Enclosed Alphanumerics. (In documentation, Block Elements contains the 15 glyphs needed (+ space) to display 2×2 graphics, so it can be useful for dense boolean or binary 2D matrices. Other than those, they're often used for banners.)