Hacker News new | past | comments | ask | show | jobs | submit login

I had one minor quarrel with this article: The use of spaces (of any kind) before and after the em dash or any dashes.

Personally, I am fond of using either a hair space or a thin space before and after the em dash. Not a full space!

To explore the various options, I wrote a little program to print the various combinations of dashes and spaces. I think what looks best depends a lot on what typeface you're using. But let's see how they look in the Verdana font used here. You should be able to paste this into your favorite word processor to see it in other fonts:

ASCII 0x2D hyphen-with no spaces

ASCII 0x2D hyphen - with U+200A hair spaces

ASCII 0x2D hyphen - with U+2009 thin spaces

ASCII 0x2D hyphen - with 0x20 full spaces

Unicode U+2010 hyphen‐with no spaces

Unicode U+2010 hyphen ‐ with U+200A hair spaces

Unicode U+2010 hyphen ‐ with U+2009 thin spaces

Unicode U+2010 hyphen ‐ with 0x20 full spaces

Unicode U+2013 en dash–with no spaces

Unicode U+2013 en dash – with U+200A hair spaces

Unicode U+2013 en dash – with U+2009 thin spaces

Unicode U+2013 en dash – with 0x20 full spaces

Unicode U+2014 em dash—with no spaces

Unicode U+2014 em dash — with U+200A hair spaces

Unicode U+2014 em dash — with U+2009 thin spaces

Unicode U+2014 em dash — with 0x20 full spaces

It looks like HN is really mangling this. Hair spaces are rendered wider than thin spaces?

If anyone wants to experiment, here is the Python code:

  from dataclasses import dataclass
  
  @dataclass
  class Character:
      char: str
      name: str
  
  DASHES = [
      Character( "-", "ASCII 0x2D hyphen" ),
      Character( "\u2010", "Unicode U+2010 hyphen" ),
      Character( "\u2013", "Unicode U+2013 en dash" ),
      Character( "\u2014", "Unicode U+2014 em dash" ),
  ]
  
  SPACES = [
      Character( "", "no" ),
      Character( "\u200A", "U+200A hair" ),
      Character( "\u2009", "U+2009 thin" ),
      Character( "\x20", "0x20 full" ),
  
  ]
  
  for dash in DASHES:
      for space in SPACES:
          print( f"{dash.name}{space.char}{dash.char}{space.char}with {space.name} spaces\n" )



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: