4 ms·
At a terminal, when I type on my keyboard the key that physically has the symbol "-" written on it: ... $ echo -n "-" | hexdump -C I get 2d. That's ASC
by TacticalCoder 3y ago
At a terminal, when I type on my keyboard the key that physically has the symbol "-" written on it:
... $ echo -n "-" | hexdump -C
I get 2d. That's ASCII. It's minus sign.
Case closed. Anyone arguing for Unicode hyphen should be shot dead on the spot, no trial.
P.S: I hope it's not lost on people that both echo and hexdump took a parameter here, and that that parameter was passed preceded by the ASCII minus sign. Which is the whole point.
- tedunangst 3y agoIn which case the entire troff manual should be discarded and replaced with plain text. What you see is what you get. Case closed.
- _dain_ 3y agothat would be an improvement.
- theamk 3y agoThere is plenty of formatting to be applied to plain text, and which cannot be done manually by author (clang-format, anyone?). - Wrapping the lines to terminal window width - Indenting blocks - _Basic_ formatting (bold, underline - OK, colors - NO) - Common blocks (like option descriptions) which apply consistent combination of rules above Everything else should be plain text, just like the the computer code or shell commands. (There is an interesting question of why is bold text accessible in manpage but not in code.. I think the answer for that is code's equivalent is syntax highlighter. Computer languages are regular enough that we can have computer highlight various syntaxical elements; while human languages are not, so we need to ask manpage authors to highlight them for us)
- mananaysiempre 3y agoIn the overwhelming majority of fonts, it’s not a minus sign, as you can see from it being vertically positioned in the middle of a lowercase n instead of in the middle of a lining digit, like the plus sign is. (Neither is it a dash, being both too short and too thick.) It’s a weird hybrid of a hyphen and a minus that was introduced on typewriters to save a key and the accompanying mechanics. (For the same reason and with about as much respect for typography, many of them neglected to have numerals 0 and 1 separate from the Latin capital letters O and I.) Unicode, unlike typewriters and ASCII, but following half a millenium of book printing tradition, encodes a hyphen and a minus separately. (Also a number of dashes, though perhaps fewer than medieval printers used.) The weird thing it resorts to calling HYPHEN-MINUS also has to be encoded and will probably persist in computer code (including Unix program arguments) forever, but in texts targeted at humans it has no place. The inadequacy of your (and my) keyboard is regrettable, but doesn’t really make for a great argument here.
- deleted 3y ago[deleted]
- _dain_ 3y agowhy should anyone spend a single second of their lives thinking about this?
- db48x 3y agoBecause readability is really important. We can't do much to improve monspaced environments such as the terminal, but most documentation, even man pages, is read in the browser. Using an ASCII ‘-’ to indicate a minus sign in a mathematical expression is quite bad for readability. It is usually less of a problem to use it as a hyphen, but a real hyphen will generally look better.
- smegsicle 3y agosome people like trains− others, dashes let us not judge
- WirelessGigabit 3y agoFor command-line parameters, yes. For everything else, I can understand that the writer would want to express more semantics in the character than just 'minus'. In fact, I would guess that anything else than 2d as a command-line parameter prefix is a bug (bar using a /). That said, normalization when searching is useful.
- gnubison 3y agoThere is a way, of course, of getting the correct hyphen-minus, and that’s by using ‘\-’. Almost all manual pages do this, including manual page generators, because the “problem” (which is just troff syntax) is well known and well documented.