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?"

44 of 814 comments (clear)

  1. False assumption by tedgyz · · Score: 4, Insightful

    we all agreed that tab indenting for code was properly two spaces

    Say what?!?? Who made that decision? In the java world, 4 spaces is pretty standard.

    --
    "No matter where you go, there you are." -- Buckaroo Banzai
    1. 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)
    2. Re:False assumption by chebucto · · Score: 5, Funny

      It's a well-known fact that God uses 3-space tabs. I don't want to go to hell, so that's what I use, but your eternal soul is your own call, buddy.

      --
      The English word fart is one of the oldest words in the English vocabulary.
    3. Re:False assumption by Cryolithic · · Score: 5, Insightful

      The linux Kernel is (was?) 8 spaces. The idea between 8 space tabs is that if your code is indented so far as to be a pain to read, then you should probably look into why it's so nested.

    4. 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.

    5. Re:False assumption by Civil_Disobedient · · Score: 5, Insightful

      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.

      Efficiency has nothing to do with it. In fact, efficiency is a complete red-herring, since presumably in our efficient, modern world we could simply write software to be intelligent enough to automatically add a space between sentences when it detects a period-space-word starting with a capital letter.

      The reason you add two spaces is because the additional space aids your eyes in determining individual sentences. If you only use a single space to delineate words and sentences, all paragraphs merge into a jumble. Two spaces gives the eyes an additional visual cue, and thus is far easier to parse.

      and it's from quite a credible source

      An appeal to authority is less argumentatively valid than an appeal to reason. The Chicago Manual of Style gives no reason except some hand-waiving about our "efficient, modern world," which is a huge, steaming pile of bunkum.

    6. 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.

    7. 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   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
    8. Re:False assumption by pdjohe · · Score: 4, Funny

      Just set your slashdot comment setting to code.  Then you can get two spaces with all their glory.

      And you'll get monospaced characters also.  Speaking of which, comments in code are monospaced.  Are two spaces after a sentence more correct there?  Personally, I think it looks too expanded.

    9. Re:False assumption by Traa · · Score: 4, Insightful

      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 ;-)

      People who indent with tabs should be shot. Indent with spaces all you want and I can view it the way IT WAS WRITTEN.

      There, fixed that for you.

      Really, using tabs only works in theory. You need to be pretty anal to never ever layout anything using spaces or the tabs argument breaks down. God forbid I line up some stuff to make it more readable.

      Yeah, yeah...this is religion to some. My argument is as moot as yours. Kinda what I'm pointing out.

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

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

    11. 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.

  2. "tab indenting for code was properly two spaces" by glwtta · · Score: 4, Insightful

    Well fuck you too, then.

    --
    sic transit gloria mundi
  3. What does slashdot say? by girlintraining · · Score: 5, Funny

    [Insert one thousand opinions here]

    The only one that matters: Is it still readable?

    We have bigger problems in the world than "one space or two" ... for example, people's atrocious speling.

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:What does slashdot say? by Hatta · · Score: 4, Insightful

      Two spaces makes it easier to parse with a regexp. Any period followed by two spaces is the end of a sentence. If you use one space, you might pick up sentence fragments with titles (Mr. Mrs., etc.)

      Of course, the question is really moot. LaTeX ignores whitespace and just does what it thinks is right. I am willing to trust LaTeX.

      --
      Give me Classic Slashdot or give me death!
  4. 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 Rob+the+Bold · · Score: 4, Insightful

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

      Why stop there? Really. Is even one space really needed? Doesn't a period, question mark or exclamation point denote the end of a sentence. Why go all redundant and put a space in at all . . .

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

      I'm not being snarky here. But I am thinking that the answer to the question "Why not zero spaces?" would be "Because that would make it harder to read".

      --
      I am not a crackpot.
    2. Re:One space by Thinboy00 · · Score: 4, Informative

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

      --
      $ make available
  5. 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 Zocalo · · Score: 4, Funny

      You forgot about the special case where you should use variable amounts of spaces, at random, to add to the horror that is is Comic Sans.

      --
      UNIX? They're not even circumcised! Savages!
    2. Re:Monospaced or proportional by Improv · · Score: 4, Interesting

      I was about to say the same thing. Because in fixed-width the period is so small, the space to the right of it in its block plus the space amounts to quite a lot of room. In proportional fonts, you don't need to worry so much.

      I am accustomed to working with and thinking about text through a terminal window - as a result I always singlespace my sentences now.

      --
      For every problem, there is at least one solution that is simple, neat, and wrong.
    3. Re:Monospaced or proportional by SleazyRidr · · Score: 4, Insightful

      Probably because html strips out the second space, and slashcode won't recognize &nbsp.

  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. The Slashdot Community Thinks... by Bieeanda · · Score: 5, Funny
    ...that you need to get out more. Adopt a dog. Maybe find a girlfriend.

    Seriously, dude. We're starting to worry about you.

    1. Re:The Slashdot Community Thinks... by noidentity · · Score: 4, Funny

      Adopt a dog. Maybe find a girlfriend. Seriously, dude. We're starting to worry about you.

      Oh damn, that's where I went wrong. I thought I was supposed to find a dog and adopt a girlfriend. The latter encounter didn't end well.

  8. 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.

  9. Word processor? by TheRaven64 · · Score: 4, Insightful

    If your word processor is using the whitespace that you enter, rather than typesetting your text according to whatever your style rules define, you need to get a new word processor. I tend to use two spaces at the end of a sentence, because I tend to edit text in monospace and it gives me a clear visual break between sentences, but that doesn't mean that I expect two spaces in the typeset output - even a web browser is more intelligent than that. Generally I find around 1.2-1.4 gives maximum readability. You want a slightly larger gap between sentences than between words, but double the width of a normal space gives too large a gap for easy reading. Of course, the width of a single space varies slightly from line to line when typesetting justified text.

    --
    I am TheRaven on Soylent News
  10. Use LaTeX. by R.Mo_Robert · · Score: 4, Insightful

    Use LaTeX (especially if you're typing technical things), then you won't have to worry about it. Type what you mean, and let the typesetter and styles handle the details.

    (I should note that if have a period followed by space that isn't a new sentence or a or a period following a capital letter that is, in which case you'll need to mark up the period with \ or @ to let it know, but these are generally fringe cases.)

    --
    R.Mo
    1. 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.
  11. One by mseeger · · Score: 4, Funny

    During the early area of the internet (around 1990) i held courses and taught new users, how to use the "blank" correctly. Rules were:

    • no space before ")" and ",",
    • no space after "(" and
    • one space after "." and ",".

    People who didn't followed the rule were convicted for excessive blanking.... at least here in germany.

    CU, Martin

  12. Depends on format by Geisel · · Score: 4, Insightful

    Myself, I'm a two-space typer. My finger know a sentence-ending period is followed by two spaces and they just do it. However, in certain formats, such as HTML, white space is ignored anyway and then formatted by the format-processor (obviously a web browser in the case of HTML).

    While I'm a two-spacer, the medium in which we type is largely making this a moot point.

    -geis

  13. TAB is the one true indentation by ejtttje · · Score: 4, Insightful

    This diverging discussion is the perfect example of why it is clear the ideal code indentation is a TAB. Set your editor to display whatever indentation width you like, don't expect to inflict that choice on everyone else. Plus it eliminates the possibility of sloppy partial indentations, and it's fewer keystrokes to boot. Win, win, win.

    1. Re:TAB is the one true indentation by gstoddart · · Score: 4, Interesting

      This diverging discussion is the perfect example of why it is clear the ideal code indentation is a TAB. Set your editor to display whatever indentation width you like, don't expect to inflict that choice on everyone else. Plus it eliminates the possibility of sloppy partial indentations, and it's fewer keystrokes to boot. Win, win, win.

      I'll grant you that on one condition ... if your fancy text-formatter is going to write in a consistent number of chars so that if it's rendered by another editor it still works, then fine. Otherwise, no.

      A former co-worker and I got into this argument. His emacs would use a single "tab" char to display between 1 and 40 tabs because it "knew" what it meant to do, but any other editor might render it like shit since it didn't have the right number of actual chars and relied on a specific mode.

      It caused huge problems with those of using different editors which didn't interpret the tabs the same way. Eventually, I locked him out of CVS until he fixed his emacs to adhere to our coding standard -- our manager agreed with me. :-P

      If you mean it to be 8 levels of indent, you need 8 placeholder items. Not one which is interpreted by your *^&%* editor (and only your editor). Otherwise, you end up with vast diffs specific to whitespace, and not what was changed. The resulting document must be properly rendered in any text editor, and it must do it consistently.

      But, yes. The Tab is the unit of measure, and your editor can render a tab as however many chars make you happy.

      --
      Lost at C:>. Found at C.
    2. Re:TAB is the one true indentation by Ragzouken · · Score: 5, Interesting

      Elastic tabstops (http://nickgravgaard.com/elastictabstops/) are the future.

  14. Ok by Thyamine · · Score: 4, Funny

    So I started reading this, thinking oh this sounds interesting to ponder. And then I got about halfway through the wiki entry and realized, ok no it's not. I learned with two spaces. Let me know when the discussion is done and I'll just do that.

    --
    I will shred my adversaries. Pull their eyes out just enough to turn them towards their mewing, mutilated faces. Illyria
  15. How to get out of work on a progeamming team by AnonymousClown · · Score: 5, Funny
    1 .Attend meeting with some sort of electronic device.
    Ask "Should I use spaces or tabs for newlines?"
    3. Hang out and serf web.
    4. Discussion settled? Ask "Should there be brackets around code even if there's only one line? Like this:

    If( foo == true)
    a=x;

    Or is it:
    If( foo = true)
    {
    a=x;
    }

    sit back and surf web for a few more hours.

    --
    RIP America

    July 4, 1776 - September 11, 2001

    1. Re:How to get out of work on a progeamming team by maxwell+demon · · Score: 4, Funny

      "Should I use spaces or tabs for newlines?"

      Neither. Depending on the system you're working on, use either a carriage return, a line feed, or a line feed followed by a carriage return. Fortunately the return key usually generates the correct newline marker for your system.

      --
      The Tao of math: The numbers you can count are not the real numbers.
  16. Semantic markup by itsdapead · · Score: 5, Funny

    <posting target-moderation="funny">

    <sentence tone="exclamation">silly boy</sentence>

    <sentence>you <contraction>should not</contraction> be mixing content with layout</sentence>

    <sentence>use an <acronym>extended markup language</acronym> schema that removes the ambiguity and allows the viewer to determine <alternative-list><item>his</item><item>her</item></alternative-list> preferred layout and punctuation <aside>or even see it presented in <abbrev>text message</abbrev>format allowing accessibility by teenage people</aside> </sentence>

    </posting>

    --
    In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
  17. "...we all agreed that tab indenting for code... by John+Hasler · · Score: 5, Interesting

    ...was properly two spaces."

    Like hell we did.

    --
    Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  18. 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."
  19. Re:Two spaces, bitches. by John+Hasler · · Score: 5, Funny

    Your eyes so poor you cant see the delineation?

    Not only that, they're so bad I can't even see the apostrophe in your sentence.

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

    One of the many deficiencies of HTML.

    --
    Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
  20. Consulting the Book of Armaments by Brett+Buck · · Score: 5, Funny

    Three is the number of the counting, and the counting of the number shall be three.

  21. 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 &nbsp; 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?
  22. Re:Two spaces, bitches. by Rob+the+Bold · · Score: 4, Funny

    End of discussion.

    Awesome.

    Next topic: emacs or vi.

    --
    I am not a crackpot.