Slashdot Mirror


Sentence Spacing — 1 Space or 2?

An anonymous reader noted an epic battle is waging, the likes of which has not been seen since we all agreed that tab indenting for code was properly two spaces. He writes "Do you hit the space bar two times between sentences, or only one? I admit, I'm from the typewriter age that hits it twice, but the article has pretty much convinced me to change. My final concern: how will my word processor know the difference between an abbr. and the end of a sentence (so it can stretch the sentence for me)? I don't use a capital letter for certain technical words (even when they start a sentence), making it both harder to programmatically detect a new sentence and more important to do so. What does the Slashdot community think?"

50 of 814 comments (clear)

  1. Re:False assumption by biryokumaru · · Score: 2, Informative

    Microsoft used to be pretty fond of 8 spaces... that was painful...

    --
    When you're afraid to download music illegally in your own home, then the terrorists have won!
  2. Re:False assumption by conteXXt · · Score: 4, Informative

    I think this is the joke.

    --
    The truth about Led Zep should never be told on /. (Karma suicide ensues)
  3. One space by GuJiaXian · · Score: 5, Informative

    I've been an editor (copy editor, proofreader, senior editor, etc.) for 10 years now. One space.

    1. Re:One space by morgan_greywolf · · Score: 3, Informative

      No, he's not loco. He's correct, at least if he's going by the AP style guide or, indeed, many other such materials. It's one space for any proportionally-spaced font. (Fixed-spaced fonts (Courier, American Typewriter, Lucida Console, Bitstream Vera Mono, etc.) aren't used in most professionally-published work, except for stuff like code in a technical publication.)

    2. Re:One space by bluefoxlucid · · Score: 3, Informative

      It's one space for any proportionally-spaced font.

      I use a lot of proportionally spaced fonts, including Times New Roman and Arial from Microsoft's True Type Fonts as well as whatever open-source fonts come with Linux. I can tell you that not only is a space narrower than an 'n', but it's also the same width regardless of if it comes after a period or not. Spaces are wider when using justified alignment, but across a whole line rather than just at periods. Further, periods themselves are extremely narrow: the spacing after a period is non-existent, and kerning will make the situation even worse by placing the period inside a 'W' or 'Y'.

      As a result, single-space provides more of a problem for today's proportional fonts than fixed-width fonts, since spaces are extra-wide with fixed width fonts anyway (as in, not more narrow than an 'n'). It's hard to read either Courier New or Arial, in any case, with single spacing: my eyes wander while my brain processes a chunk of text, so I grab 3 or 4 words at a time and then have to identify where I am. Without the geographical landmarks of extra white space scattered about a paragraph, I have a lot of difficulty returning instantly to wherever I was every few milliseconds; it can take several seconds to reorient my vision sometimes if a bug or some other piece of movement distracts me for the briefest fraction of a second.

    3. Re:One space by Thinboy00 · · Score: 4, Informative

      Wikipedia's featured article on the subject (happens to be today's, actually).

      --
      $ make available
    4. Re:One space by fahrbot-bot · · Score: 3, Informative

      Oops, I guess an ellipsis can end a sentence too.

      In this case, 4 periods are actually used....

      --
      It must have been something you assimilated. . . .
    5. Re:One space by Anonymous Coward · · Score: 1, Informative

      point of fact: an ellipsis is not a collection of periods, but a single, distinct character in its own right.

  4. Monospaced or proportional by ThrowAwaySociety · · Score: 5, Informative

    Two spaces are appropriate for typewriters and similar monospaced fonts (Courier, Monaco, Andale Mono, Consolas, Vera, Deja Vu mono)

    One space for proportional fonts (Times, Helvetica, almost everything.)

    1. Re:Monospaced or proportional by Improv · · Score: 2, Informative

      Oh, p.s. if, considering my argument below, you really prefer standards bodies above the consensus route, "The Chicago Manual of Style (1), the AP Stylebook (2), and the Modern Language Association (3) all recommend using one space after a period at the end of a sentence. ", as noted by "Grammar Girl" at:

      http://grammar.quickanddirtytips.com/spaces-period-end-of-sentence.aspx

      (she provides references to back up that assertion).

      I should note that I'm more of a "rough consensus" guy myself and that this is a matter where I don't think there's a right answer between one and two -- I think reasonable people may disagree and that it comes down to style.

      --
      For every problem, there is at least one solution that is simple, neat, and wrong.
    2. Re:Monospaced or proportional by nabsltd · · Score: 2, Informative

      What about forestalled sentence termination due to interrup-- Hey, I'm talking here!

      I believe the correct way to format that last bit is: due to interrup—Hey, I'm talking here!

      Unlike the question of how many spaces should be used after a period, the n-dash and m-dash are punctiation marks. As such, they have rules for use that are much more hard and fast. One of those is that there should be no space between the letters on either side of the dash and the dash itself. This rule applies to all dashes (hyphen: twin-engine, n-dash: 9–5, m-dash: Shatner—is speaking).

  5. Sentence stretching? by Anonymous Coward · · Score: 1, Informative

    Sentences are not stretched, paragraphs are.
    (and they have their own invisible sign(s))

  6. Depends on the font by jpatters · · Score: 4, Informative

    It depends on the font. If it is monospaced (such as on a typewriter) it should be two spaces. If you are using a proportional font, use one space.

    --
    "Remember, there never were pineapple-almond cookies here."
  7. OLD NEWS (1989) by starglider29a · · Score: 5, Informative
    http://www.amazon.com/Mac-not-typewriter-professional-level-Macintosh/dp/1877932051/ref=sr_1_4?s=books&ie=UTF8&qid=1280942506&sr=1-4

    The Mac is not a typewriter not only lays down guidelines, but explains the logic behind them, such as why punctuation should be hung, why there should not be two spaces after periods, why text set in all caps should be avoided.

  8. Early 20's, two spaces. by Anonymous Coward · · Score: 1, Informative

    I'm in my early 20's, so I'm relatively young. I was taught to put two spaces between sentences when learning how to type. I think it's still taught that way, so may people are just getting lazy.

  9. One space between sentences by ExRex · · Score: 1, Informative

    At least, that is the standard in the publishing industry. Two spaces is a convention invented by typing teachers for reasons which I've never understood, and which screws up justification once the document needs to be set. One of the first things that has to be done when bringing a document into a page layout program is to search for periods followed by two spaces and replace them with periods and one space. PITA for the Quark/InDesign/Scribus operator.

    --
    The closer you are to the code, the happier you are. - Ancient Geek Proverb
  10. Re:a suggestion by Anonymous Coward · · Score: 2, Informative

    Actually, there are multiple types of spaces in typesetting, with multiple widths. A properly typeset book will use a single em-space (a widened space approximately the width of the letter "m") between sentences and a narrower space between words. FWIW.

  11. Re:Twice by AndyAndyAndyAndy · · Score: 2, Informative

    As an interesting note, the iPhone auto-enters a period when you double space, so the tradition is still partially alive, at least.

    True, but it inserts a single space with that period.

    --
    It's always confirmation bias!
  12. Re:2. Duh. But... by Anonymous Coward · · Score: 1, Informative

    That's your browsers rendering. Take a look at the source...

  13. We're talking text, not code by ProppaT · · Score: 4, Informative

    If you read the question, we're talking about text, not code. I couldn't care less what you do with your code; however, as a professional writer, the new standard is one space.

    If you really want to get into the the theory behind it, it's actually quite simple. We now use one space to avoid "rivers of white" in text. In short, if you look at a sample of documents that have been double spaced after the punctuation, you'll start to notice lines of white that run throughout the document. This distracts the reader and lowers the readability of the document. In typewriter days, two spaces made a lot of sense. Due to the large variation of widths in characters, it helped keep a more uniform space between sentences. With modern word processors and fonts, the need for the double space as been eliminated.

    Now, when you get into typography and design, you're dealing with aesthetic and this will vary on a case by case basis. Letter spacing, kerning, and leading all come into play and it's less about the number of spaces you use and more about how you're using your spaces. In coding, I could see the use for even more than two spaces.

    *NOTE* - It might seem contradictory that I'm advocating single spacing, yet I've double spaced between all my sentences. I'm an old school typewriter guy and old habits die hard. This is why modern technology is so great. I have all of my software set to only allow single spacing between sentences. I always do document searches for double spaces. All of my professional writing goes out single spaced. All of my personal writing goes out double spaced, completely out of laziness.

    --
    Wise men say, "Forgiveness is divine, but never pay full price for late pizza."
  14. Re:Use LaTeX. by WillAdams · · Score: 5, Informative

    Not really fringe cases, and requires a bit of effort, unless one uses \frenchspacing (which is not the default) so one _will_ need to think about it, since TeX by default adds more space after a period, so one must indicate which periods do not require additional spacing, e.g.:

    Dr.\ Knuth was very concerned with the typography of his published articles and books. This resulted in his development of \TeX\ when early systems for page composition were unable to match the old styles. While it handles many things automatically, it does require a certain attention in the preparation of the text, i.e.\ indicating normal width spaces by preceding them with a backslash.
    \vfill\eject\bye

    William

    --
    Sphinx of black quartz, judge my vow.
  15. The bible says One by mretondo · · Score: 3, Informative

    When the "Fifteenth Edition of The Chicago Manual of Style" (the bible on grammar) came out around eight years or so ago, the authors were on WGN radio in Chicago promoting the book and taking questions. Someone called in asking this very question about one or two spaces at the end of a sentence (I wanted to call and ask the same question). The authors were very clear, one, even for mono space fonts.

  16. Re:False assumption by ronocdh · · Score: 3, Informative

    The best jokes are never understood on first telling.

    Back to the subject at hand, however, why not consult the Chicago Manual of Style? To cut to the chase:

    So, in our efficient, modern world, I think there is no room for two spaces after a period. In the opinion of this particular copyeditor, this is a good thing.

    Seems pretty reasonable to me, and it's from quite a credible source. Read the full page for justification (no pun intended).

  17. When in doubt, Search your Chicago Manual of Style by tyrione · · Score: 2, Informative

    I don't care if you're a casual writer or developer, having the Chicago Manual of Style [15th Edition myself] on hand will teach you to become a much better typesetter in your work.

  18. Re:Two spaces, bitches. by HTH+NE1 · · Score: 5, Informative

    Notice when you read shit on the internet it is single spaced after punctuation, and not double spaced?

    That's only because HTML decided that consecutive whitespace should be compressed to a single character. I may put two spaces after full stops followed by new sentences, but I'm not going to make one of them   to (try to) force it.

    HTML, also by not employing indentation at the start of paragraphs by, has steered people toward double-spacing between paragraphs. Print media prefers not to waste the line between paragraphs and sticks with indentation of the first line of paragraphs. Books tend to reserve double spacing between paragraphs for a change of scene within a chapter, and if it occurs at a page break, a line with one to five asterisks, spaced, is employed, on whichever page it will fit.

    --
    Oh, say does that Star-Spangled Banner entwine / The myrtle of Venus with Bacchus's vine?
  19. From the Chicago Manual of Style, 15th ed. by OldeTimeGeek · · Score: 2, Informative

    "A single character space, not two spaces, should be left after periods at the end of sentences (both manuscript and in final, published form) and after colons."

  20. The answer (though it's not very satisfying) by bfootdav · · Score: 2, Informative

    I've given this a lot of thought over the years and I believe you can break it down into three circumstances

    1) If you're using a monosaced typeface or a typewriter, use two spaces. It's the convention and I personally think it makes reading the text much easier. Of course how often does this situation arise these days? Not very.

    2) With a typesetter or typesetting software a "space" has no specific length as it varies depending on the needs of the typesetter. That said some typesetters pad the space after a period and some don't. Either way it will look good and consistent. Trust your typesetter. Though if you use TeX you have your choice of which style to go with. It doesn't matter which you choose, it'll look fine.

    3) If you're using a word processor it doesn't matter. Word processors produce crap for output. By using one you are stating up front that you don't care how the final product looks. By definition you are producing an informal text and as such you can use as many spaces as you want since it's not going to affect the aesthetic value or readability of the text any more than the decision to use a word processor in the first place. If you do care about how it looks and reads use typesetting software.

  21. Re:False assumption by rickb928 · · Score: 2, Informative

    ASCII back when there was 'just' ASCII, was an 8 space tab. MS adopted that where it was needed, and in my world, 8 spaces for a tab is standard.

    If you're just indenting, whatever you like. If your envirenment or prefers a different standard, either adopt it or be prepared to cause problems.

    I tend to indent 1 or 2 spaces, because I can make sense of it. But some editing software has its own ideas.

    And this is not the most important topic for us to consider.

    --
    deleting the extra space after periods so i can stay relevant, yeah.
  22. Re:TAB is the one true indentation by noidentity · · Score: 3, Informative
    Yes, tab represents the intent, rather than the implementation. And before anyone complains that the code will format wrong if you do view it with the wrong tab spacing, that's because you're using tabs wrong. Where horizontal alignment between lines is important, you should be sure they align no matter what the tab spacing.

    But I think this discussion is about putting spaces after the period that ends a sentence, not whether to use one or two spaces for indention. Applying the above here, you should represent sentences in a way that your typesetting program can apply its stylesheet to sentences, rather than individual characters.

  23. Re:Two spaces, bitches. by computational+super · · Score: 2, Informative

    Actually that ought to be: s/\([.?]\) /\1 /g Since you don't want to lose the "." or the "?". You also need to do: s/\([.?]["']\) /\1 /g

    --
    Proud neuron in the Slashdot hivemind since 2002.
  24. Re:False assumption by Obfuscant · · Score: 4, Informative
    ASCII back when there was 'just' ASCII, was an 8 space tab.

    ASCII when there was just ASCII had a tab character which was commonly interpreted as "tab to the next multiple of 8 column". If you were in column 4, a tab would not look like 8 spaces, it would look like 4 spaces.

    On the keypunch I used, TAB meant "advance to the next tab column as indicated on your drum card." For FORTRAN, that meant the first tab skipped to column 2 (line number), the next tab to column 6 (continuation), the next to 7, a few every four spaces, and then off to column 72 (card number).

    Every reasonable typewriter I used had tab stop settings so you could define what columns a tab took you to.

    If your envirenment or prefers a different standard, either adopt it or be prepared to cause problems.

    Thus was created "indent", which converts code from all those other people's atrocious formatting styles into your preferred on and back.

  25. Re:Two spaces, bitches. by 19thNervousBreakdown · · Score: 3, Informative

    Slashdot doesn't strip the spaces, your browser's HTML parser does. <-- There's two spaces there, look at the source.

    --
    <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
  26. Re:Two spaces, bitches. by horigath · · Score: 2, Informative

    HTML, also by not employing indentation at the start of paragraphs by, has steered people toward double-spacing between paragraphs. Print media prefers not to waste the line between paragraphs and sticks with indentation of the first line of paragraphs. Books tend to reserve double spacing between paragraphs for a change of scene within a chapter, and if it occurs at a page break, a line with one to five asterisks, spaced, is employed, on whichever page it will fit.

    For the last decade we've had a thing called CSS and you can indent your first lines to your heart's desire. Typesetting software for books doesn't do it unless the designer asks for it either.

  27. Re:Two spaces, bitches. by larry+bagina · · Score: 2, Informative

    TeX is the one true typesetting program. By default, it indents paragraphs (except for the first paragraph in a section).

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  28. Re:False assumption by Chris+Burke · · Score: 2, Informative

    With tabs each person can set their tabstop however they want.

    And if they want it to look right, they need to set it to exactly what the original author did. Every time you decide to break up a line of code, you're making a decision that locks the reader into a particular spacing in order to have legible code.

    Do you want to have legible code? Yes? Use spaces then. And if you can't handle reading code that doesn't use your "preferred" spacing, then it is you, not the code author, who has the puppy-killing control issues.

    --

    The enemies of Democracy are
  29. Re:TAB is the one true indentation by ejtttje · · Score: 3, Informative

    Ah, yes that setting avoids spaces-per-tab issues by not using tabs, but your personal spaces-per-indent setting is still being hardcoded in the source.

    The original question was: how do I tell it to use tabs for indentation instead of spaces? Best solution I know is to go into each mode (c++-mode, java-mode, etc.) and tweak the indentation setting to match the tab width, which looks like:
    (defun my-mode-hook ()
    (setq tab-width 2)
    (setq truncate-lines t)
    (setq c-basic-offset 2))
    (add-hook 'c-mode-hook 'my-mode-hook)
    (add-hook 'c++-mode-hook 'my-mode-hook)


    (ugh, why do I need to 'program' my editor to configure a setting... sigh.)

  30. Re:TAB is the one true indentation by tuffy · · Score: 2, Informative

    That was my fault for misreading the question. SmartTabs is probably best for a "tabs everywhere" approach that degrades gracefully on other editors, regardless of tab width.

    --

    Ita erat quando hic adveni.

  31. Re:False assumption by BasilBrush · · Score: 4, Informative

    The reason you add two spaces is because the additional space aids your eyes in determining individual sentences

    That was the reason in the days of typewriters. And it continues to be the reason if you are writing in a text editor using a monospaced font. But a word processor will space a document properly, such that the space between sentences IS wider than a space between words.

  32. Abbreviations, such as Dr., Ms., etc. by tomhudson · · Score: 2, Informative

    Two spaces after a period that ends a sentence.

    Otherwise, Dr. Ms. Mrs. Mme. Mr. Mlle. etc. eng. fr. and all those other abbreviations look like they end a sentence.

    Tab, of course, is ASCII 9, not "n * 0x20", where n==some value between 1 and whatever. Look at python code, where leading white space counts - mixing tabs with spaces is dumb.

  33. Re:False assumption by networkBoy · · Score: 5, Informative

    because HTML is broken. There is two spaces after the preceding period but you can not see them.Now you can because I used &nbsp; tags. (no you can't because /. is broken and does not render the tag properly...)

    --
    whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
  34. Re:False assumption by number6 · · Score: 2, Informative

    Thank you. People who indent with spaces should be shot. Indent with tabs all you want and I can view it the way I want (2 space, 4 space, etc.).

    If you use spaces instead of tabs, I'm going to have to take two seconds to run some elisp to fix it ;-)

    Problem with tabs is when you're lining up code on multiple lines (e.g., variables, where many people use whitespace between the type definition and the name to line up the names), a different tab size breaks the alignment. You either have to force everyone to use the same tab size, or suffer ugly code.

    If you're aiming to keep line length down (back in the days of 80 character displays), switching between tab sizes could cause code to become an unreadable wrapped mess if it'd been written using 2 space tabs (and fitted nicely into the editor window) and you viewed it with 8 space tabs (at which point it no longer did).

    These days it's almost irrelevant. Most IDEs allow you to reformat the whole file with a single keypress to whatever style you want. Then reformat back to project standard before submitting to source control.

    --
    I'm a number, not a free man!
  35. Re:False assumption by Korin43 · · Score: 2, Informative

    They probably have Slashdot set to "HTML Formatted", so any whitespace is converted to one space. Example: Look at the source for this post.

  36. Re:False assumption by Chris+Burke · · Score: 2, Informative

    No. You indent by tabs to the correct level, and add spaces for effect afterwards where necessary. Even if you end up adding more spaces than a tab width. That way it looks right no matter the tab width.

    And then they set their tab width to something less than you did, and then the next level of indentation is indented less than your split line. It no longer looks right, it now looks the opposite of right, as in wrong.

    Tabs break things. If you use any tab stop other than exactly 8 spaces, and mandate that everyone else does to, you will break code formatting for someone, somewhere (terminals and line printers use 8-space tabs). And mandating 8 space-tabs breaks the alleged "advantage" of tabs in the first places.

    Tabs are broken. Spaces are the only way to ensure anyone viewing your code will see it correctly formatted. This is vastly more important than being able to tailor other peoples' code to your preference.

    --

    The enemies of Democracy are
  37. Re:False assumption by qengho · · Score: 2, Informative

    Please explain why you used one space between all sentences in your post.

    He actually used two spaces. Unfortunately for him, browsers collapse multiple spaces into one. He lacks commitment; a true Double-Spacer would have used two non-breaking spaces.

  38. Re:False assumption by Moxon · · Score: 5, Informative

    The way around this is to _indent_ with tabs and _align_ with spaces.

  39. Re:False assumption by Grishnakh · · Score: 4, Informative

    God forbid I line up some stuff to make it more readable.

    You can do both: use tabs for indentation, and spaces to line things up.

    So, if you have a statement like this:

            printf("testing 1 2 3 %d %s",
                            var1, var2);

    the printf would have a tab, and that's it. On the second line, there would be one tab (to match the line above it), and then the rest would be filled in with spaces, like this: (underscore indicates a space)

    printf("testing 1 2 3 %3 %s",
    ________var1, var2);

    That way, you can set your tab stop to whatever you want (2, 4, 8, 3, 5, 16, whatever), and it will look correct.

  40. Re:False assumption by thoromyr · · Score: 2, Informative

    You are almost correct. The reason that two spaces *used* to be added after a sentence instead of a single space was that typewriters were monospaced. If you use a monospaced font and only use a single space after a period to indicate a sentence it *is* visually ambiguous due to the large amount of extraneous white space between the edges of adjacent characters. So much white space, in fact, that you can often insert a character between two others (I've done this in manuscripts rather than retype a page).

    If you are producing a document using a monospaced font then you *should* use two spaces to help the readability of the text. On the other hand if, like most people, you are producing a document with a proportional font then only use one.

    In summary: the "rule" about using two spaces after the period ending a sentence was for typewriters and arose because typewriters had a (wide) monospacing.

  41. Re:False assumption by Obfuscant · · Score: 2, Informative

    Quote: Indent only indents, it doesn't insert or delete newlines...

    Incorrect.

    if (foo) { a = x; } else { a = 5; }

    is trivially converted to GNU format by "indent -gnu a.c", and becomes:

    if (foo)
      {
        a = x;
      }
    else
      {
        a = 5;
      }

    Looks like some newlines  have been inserted. And running that through K&R indent:

    if (foo) {
        a = x;
    } else {
        a = 5;
    }

    Newlines deleted.

  42. Re:False assumption by Grishnakh · · Score: 2, Informative

    Whoops, I just noticed that my "tabs" disappeared. It should look like this:

    [tab]printf("testing 1 2 3 %3 %s",
    [tab]________var1, var2);

  43. Re:False assumption by Anonymous Coward · · Score: 1, Informative

    Sorry, you're seeing an artifact of the font you are using + the enlargement + kerning.

    ie.
        1) you are using a font designed for 12pt.

        2) the '.' glyph has spacing built in it. (pull it up in fontforge or equivalent to verify)

        3) kerning is moving the period closer to the previous letter, but there is no kerning between characters & spaces.

        4) you enlarged the font 3x so the space built into the glyph was magnified 3x.

    The difference you noticed of 5 pixels at 36pt (77 - 72) is insignificant compared to the spacing difference spoken about here. Using your numbers a double-space should be 144px vs the 77 you're seeing.

    rho