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

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

    2. Re:False assumption by Anonymous Coward · · Score: 1, Insightful

      I really don't see the justification for arguing the space equivalent of a tab - the whole point is so that everyone can set their tabstop however they prefer and not impose their particular preferences on anyone else.

      Using spaces is as antisocial as encoding your editor's syntax highlighting into the source code as a bunch of ASCII control codes.

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

    4. Re:False assumption by afabbro · · Score: 3, Insightful

      Kernel is 1 tab, which is always 8 spaces. This is completely different from 8 space indent.

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

      --
      Advice: on VPS providers
    5. Re:False assumption by ronocdh · · Score: 2, Insightful

      Efficiency has nothing to do with it.

      The reason you add two spaces is because the additional space aids your eyes in determining individual sentences. Two spaces gives the eyes an additional visual cue, and thus is far easier to parse.

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

    6. Re:False assumption by cfulmer · · Score: 2, Insightful

      Computers really aren't very good at figuring this stuff out -- how would it space "Mr. Smith" or "Prof. Jones" or "M. Chevalier"?

      Personally, I'd rather have the computers figure out "Oh... period followed by two spaces followed by Capital letter. Must have started a new sentence" and correct appropriately.

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

    8. Re:False assumption by Peach+Rings · · Score: 2, Insightful

      You can't just pick your own indent convention. Things get incredibly painful when people use editors that auto-indent to different widths.

    9. Re:False assumption by Co0Ps · · Score: 2, Insightful

      In the real world when working on collaborated projects indenting with tabs is a pain due to the people who mix up tabs and spaces making the source code look completely broken. Then people will fix what they think is broken in their editor, making it even more broken in others. It's easy to accidentally indent with spaces, and since most editors does not display the difference between spaces and tabs, having a "tabs only" standard is bound to create a mess, as people are not perfect. I've worked on many collaborative projects and what I have found best is a spaces only convention with a fixed length of 4. Telling people to set the IDE to automatically convert tabs to the required number of spaces does the trick. Also, it seems like you think people should be amazed that your are able to replace tabs with spaces in your IDE? Welcome to new millennium. Here we use graphical IDE's with something called "Find & Replace". It does not require you too read a manual to understand how too use, and it supports regular expressions. Just matching tabs however does not. You can actually copy paste tabs as normal characters.

    10. Re:False assumption by LateArthurDent · · Score: 2, 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.).

      The ability for you to view it however you want is precisely what I'm trying to avoid when I set space indentations. Code should be no wider than 80 characters, so I can use cat in a standard terminal and see the results without them being wrapped around at illogical locations. That means we all need to agree on using monospace fonts, 2-space indentations to maximize available screen space, and you need to wrap your code manually at locations where it makes sense to do so, at or before the 80-char mark. If you edit it with your own custom view, you can't follow these guidelines. Then when I look at the code, it's going to suck in a way I can't fix with a script or style change.

      You're on my lawn. Get off it.

    11. Re:False assumption by Anonymous Coward · · Score: 2, Insightful

      Now all you have to do is set your editor to always do that for automatic indentation, instead of inserting tabs for 8-space multiples and filling the rest with spaces.

      And also remember to never use the TAB key, only the space bar, to create such spacing even if your function name is anImpossiblyLongFunctionName()

    12. Re:False assumption by xaxa · · Score: 2, Insightful

      It works fine. Using ____ for tab and . for space:

      if (thing) {
      ____do stuff;
      ____and do some really
      ________long stuff;
      ____but-here(I'd like,
      ____.........these arguments,
      ____.........to align);
      }

      Changing ____ to ________ (or whatever) isn't a problem.

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

    Well fuck you too, then.

    --
    sic transit gloria mundi
  3. Not just problem for automatic parsers by CannonballHead · · Score: 3, Insightful

    It's easier for a human to determine sentence structure when sentences are set apart by two spaces, too.

  4. What battle!!!! by Anonymous Coward · · Score: 1, Insightful

    A epic battle? Where! There is only a link to wikipedia FFS!! And even then its still more history orientated! Nor has it anything to do with programming!

    This isnt news, this is bollocks!

  5. 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
  6. 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
  7. Re:Monospaced or proportional by Tumbleweed · · Score: 1, Insightful

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

    That seems backwards to me. One space in a proportional font should be much smaller than one in a monospaced font. You'll get a HUGE difference between those two your way. Unless that is your intent, for some unknown reason.

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

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

  10. Re:What does slashdot say? by Anonymous Coward · · Score: 1, Insightful

    Is it readable, and is it consistent?
    If so, then it's good.

  11. 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!
  12. Re:Two spaces, bitches. by gstoddart · · Score: 2, Insightful

    Yeah, if you are a douche bag. It's 1 space. WTF is the reason for 2? Your eyes so poor you cant see the delineation?

    Because some of us are old and spent many years in a monospace font, and liked it.

    Seriously, I've been doing two spaces after a full-stop for so long that I'd never be able to stop doing it (I've been typing since the early/mid 80's). It just becomes part of how you do things. The reality is, it may or may not render in such a way as anybody will notice it -- that doesn't mean I'm going to stop doing it.

    If you were taught to use the two spaces, you're likely to always use that.

    --
    Lost at C:>. Found at C.
  13. Re:Monospaced or proportional by JesseMcDonald · · Score: 2, Insightful

    I disagree. Even with proportional fonts one space at the end of a period makes the text look crowded.

    If that's true, why do you only use a single space in your comments?

    --
    "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
  14. Re:One space by Culture20 · · Score: 2, Insightful

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

    Oh yeah? I've been a typer for 25+ years now. Two spaces (but HTML will render it as one without manual spacing which has always bugged me since 1994).

  15. Re:Two spaces, bitches. by Audacitor · · Score: 2, Insightful

    You could have entered tons of spaces after that period. Depending on which comment post mode you're using, it may be using standard HTML behavior, which strips out superfluous white space, including double spaces between sentences.

  16. Re:How to get out of work on a progeamming team by Anonymous Coward · · Score: 1, Insightful

    If that last one provokes even a little discussion, step 6 should be "find a new job". Braceless ifs are a great way to cause mysterious bugs when somebody modifies the code down the line...

  17. Re:One space by commodore64_love · · Score: 2, Insightful

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

    No. Two spaces separate the sentences further apart, and make it easier to read the document without accidentally running two sentences together.

    --
    "I disapprove of what you say, but I will defend to the death your right to say it." - historian Evelyn Beatrice Hall
  18. 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.
  19. Re:Monospaced or proportional by Tumbleweed · · Score: 2, Insightful

    No because a typeface is (should be) designed with spaces in mind.

    Yeah, the world should be a better place, but...

    I've seen all too many (very popular) proportional fonts that even with two spaces, LOOK like one. And kerning seems to be a lost art these days. Ugh.

  20. Re:HTML decides for you by eln · · Score: 2, Insightful

    The fact that HTML decides for you is irrelevant anywhere that isn't using HTML. HTML strips out any repeated whitespace, regardless of whether or not it's at the end of a sentence. HTML also does all sorts of other nutty things with formatting that may or may not make any sense depending on what you're trying to do.

  21. Re:How to get out of work on a progeamming team by orasio · · Score: 2, Insightful

    Number 4. :
    Yes.

    Not leaving brackets around one-liners is an invitation to mistakes.
    If you want to add a debug line to the one-line block, you need to add brackets.
    If you remove it, then remove the brackets.
    Using them always gives you one less thing to think about.

  22. Re:Monospaced or proportional by arielCo · · Score: 2, Insightful

    Read above, re HTML collapsing multiple spaces into one. He'd have to type one of the two as  .

    --
    This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
  23. Re:Monospaced or proportional by SleazyRidr · · Score: 4, Insightful

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

  24. Re:What does slashdot say? by david.given · · Score: 2, Insightful

    Any period followed by two spaces is the end of a sentence.

    Or a newline.

  25. Re:One space by Civil_Disobedient · · Score: 1, Insightful

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

    That is not an argument. Or rather, it is an exceedingly poor argument. Much like, my penis is larger than yours, therefor I am correct.

    Try using reason next time.

    For example: two spaces are easier to visually parse than one. That's testable, verifiable, and reproducible.

  26. Re:XML To The Rescue by DaveV1.0 · · Score: 1, Insightful

    Parsing failure: Invalid nesting at line 11. No end tag for element "word" before end of element "sentence".

    --
    There is no "-1 offended" or "-1 you don't agree with me" mod options for a reason.
  27. Re:How to get out of work on a programming team by Anonymous Coward · · Score: 1, Insightful

    no way! the only correct way is of course

    If (foo=true) {
        a=x;
    }

    *g*

  28. Re:One space by Mongoose+Disciple · · Score: 2, Insightful

    But we all write all the time, if not intended for publication.

    Should 1% or less of all writing dictate what should happen to the other 99%+ of writing?

  29. Re:Two spaces, bitches. by Kazoo+the+Clown · · Score: 2, Insightful

    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.

    Perhaps. I'm in the habit of putting an   after periods when I write for HTML. Problem would be solved, if it wasn't for comment editing code that strips them out (such as here on Slashdot which you can see here since I put 4 nbsp's separated by spaces after the periods in this paragraph, and despite the fact they are preserved through the preview, they are having no visible effect). The deficiency is not strictly with HTML, but with some of the editors that work with it.

    Though I agree that HTML does not make it easy to maintain double spaced sentence separation. I hate reading single-spaced sentence text, I always notice it and it looks ugly. Perhaps I should insert

    <br>

    after every sentence, and while that would look ugly too, at least it would show my displeasure with the sentence police who have apparently decided that we will not use two spaces...