Live data from Hacker News

How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

merriam-webster.com

421–430 of 492 posts

Re: How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

#421

If you are looking for alternative to kebab case to write identifier in programming language which reserve the - (U+002d) as an operator, chances are good you can use · (U+00B7 · MIDDLE DOT), that we use in middot case . So isMorePleasantToRead, is_more_pleasant_to_read or is·more·pleasant·to·read is up to you.

This is intriguing to me, do you know which (programming) languages tolerate this?

The reason this works in Rust is that Rust follows Unicode's categorization of which code points are useful as identifiers: https://www.unicode.org/reports/tr31/

MIDDLE DOT is Other_ID_Continue

I know less about the other languages but it wouldn't surprise me if they did similar things.

Re: How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

#422
post #308
post #165

Earlier quoted context omitted.

> EM dashes break things, such as sentences or thoughts Some style guides recommend "space, en dash, space" for this, and I prefer that myself – mainly because some software doesn't treat em dashes correctly as word separators for double click selection purposes. For example, I'm pretty sure that at least some Kindle models would highlight both the word before and after the em dash when selecting one of them, which m…

It's actually only your post that made me realize people don't normally put spaces around em dash. In French, Russian and a bunch of other languages proper typesetting is to use em dash as a standard dash character, and you always put spaces around them. So I did it in English as well, for many years now. (I also now looked up and found out that in Spanish, apparently, you are supposed to put space only on one side o…

What is a "standard dash character"? There is no such thing in English; only hyphen, EN dash, EM dash (and some odds and ends).

Re: How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

#423
post #263

I read Butterick's Hyphens and dashes some years ago and it stuck with me. Now I regularly use hyphens, en dashes, and em dashes correctly—I even memorized the Unicode sequences and enter them seamlessly on Linux with Ctrl-Shift-U! https://practicaltypography.com/hyphens-and-dashes.html

Came here to post the same link! That book is wonderfully opinionated and has helped clarify some typographic concepts for me

Re: How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

#424
post #308

Earlier quoted context omitted.

It's actually only your post that made me realize people don't normally put spaces around em dash. In French, Russian and a bunch of other languages proper typesetting is to use em dash as a standard dash character, and you always put spaces around them. So I did it in English as well, for many years now. (I also now looked up and found out that in Spanish, apparently, you are supposed to put space only on one side o…

people don't normally put spaces around em dash For what it's worth, I was in the last class in my high school to learn typing on IBM Selectric typewriters. We were taught to type two spaces, two hyphens, then two spaces. Incidentally, we were taught two spaces after periods and colons. To this day, I find it hard to read text that doesn't have proper spacing after periods. (HTML and WYSIWYG word processors handle fo…

Its funny that people think that conventions for typewritten text built around the limitations of typewriters define what is “proper” in environments where typewriters and their limitations are not involved.

Re: How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

#425
post #351
post #340

Earlier quoted context omitted.

I also put spaces around em dashes. It looks wrong—subtly wrong—to me to have the words glued together around the dash. It looks right — completely right — to me to have the dash standing on its own, as if it was a word in its own right.

The reason not to do this is observable in your post on my phone. The spaces cause the word wrapping algorithm to leave a dangling dash at the end of the line which looks ugly. Omitting spaces prevents the word break.

> The reason not to do this is observable in your post on my phone. The spaces cause the word wrapping algorithm to leave a dangling dash at the end of the line which looks ugly. Omitting spaces prevents the word break.

That's an interesting practicality but I don't think it's the cause of the rule: The rule probably long predates automated line breaking. Also, I think automatic line breaking will break compound words at the hyphen; it doesn't require spaces (which is also obvious from a software development point of view: the logic is relatively simple either way):

  Lorem ipsum dolor sit amet, consectetur adipiscing double-
  decker lorem ipsum dolor sit amet, consectetur ...

Re: How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

#426

Earlier quoted context omitted.

This test feels biased by the fact that, like others have said, macOS provides keyboard shortcuts. For example, I'm only Gen Z and yet have tried for many years to use the proper dash characters in the right places, which is made much easier by virtue of being on a Mac. Of course, I guess it's entirely possible—even accounting for OS—that this test remains statistically useful. It makes me kinda sad that my (very muc…

That has nothing to do with being on a Mac. Em-dashes and the compose-key work fine on Linux, and Android has them under the '-' of the on-screen keyboard when long-pressed. (Windows probably has some way, but those are rarely discoverable.)

EURKEY layout in particular has them easily accessible.

Re: How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

#428
post #308

Earlier quoted context omitted.

It's actually only your post that made me realize people don't normally put spaces around em dash. In French, Russian and a bunch of other languages proper typesetting is to use em dash as a standard dash character, and you always put spaces around them. So I did it in English as well, for many years now. (I also now looked up and found out that in Spanish, apparently, you are supposed to put space only on one side o…

people don't normally put spaces around em dash For what it's worth, I was in the last class in my high school to learn typing on IBM Selectric typewriters. We were taught to type two spaces, two hyphens, then two spaces. Incidentally, we were taught two spaces after periods and colons. To this day, I find it hard to read text that doesn't have proper spacing after periods. (HTML and WYSIWYG word processors handle fo…

I was taught that and abandoned it as a pointless anachronism. How often are you reading long form text in a monospace font?

Re: How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

#429

Earlier quoted context omitted.

I'm still doing it when I am typing at a physical keyboard. Hard habit to break. I learned it so long ago too. You can tell when I've edited something on both a phone and a physical keyboard, based on the inconsistent use of spaces.

Hard habit to break. I learned it so long ago too. Haha I learned to type organically, and it was only in my mid-40s that I retrained myself to type the correct way. It took something like 40 hours of practice on keybr.com before I could get close enough to my regular typing speed, such that I could switch over to the 'correct' method without it impacting my work. Retraining myself to stop doing double-spaces took ma…

Most word processors can be configured to flag double spaces. That gives feedback to break the habit.

Re: How to Use Em Dashes (–), En Dashes (–), and Hyphens (-)

#430

Earlier quoted context omitted.

people don't normally put spaces around em dash For what it's worth, I was in the last class in my high school to learn typing on IBM Selectric typewriters. We were taught to type two spaces, two hyphens, then two spaces. Incidentally, we were taught two spaces after periods and colons. To this day, I find it hard to read text that doesn't have proper spacing after periods. (HTML and WYSIWYG word processors handle fo…

Its funny that people think that conventions for typewritten text built around the limitations of typewriters define what is “proper” in environments where typewriters and their limitations are not involved.

Yes, this always grinds my gears too. There is already a slightly larger space after periods in contemporary typefaces.

The old typewriter typefaces were monospaced, ie. every character was the same width, but this is no longer the case. Virtually all typefaces today are proportionally spaced, not monospaced. So it’s redundant to leave extra room after periods.

Post reply on HN