Hacker News new | past | comments | ask | show | jobs | submit login
Why I Two-Space (stevelosh.com)
77 points by dcope on Oct 12, 2012 | hide | past | favorite | 102 comments



This is quote possibly the most beautiful blog I have ever seen.

That said, it's a stupid argument. If you want to two-space, fine, but be aware that most people believe and understand you're living in the typographic stone age alongside people who indent their paragraphs and use Whitesmiths.

Two-spacing is a result of monospace typewriters, which couldn't provide the "space and a half" spacing that traditional typesetting put between sentences, however these days most of the people I see doing two-spacing are in their forties or older, and probably used a typewriter before they used a computer.

Even when using a monospace font, I prefer single spacing. Why? It's easier to be consistent. If I forget to two space, or have a typo and miss a two-space, short of creating a really nasty regex I'm not going to be able to find it.


You rebut the author by reiterating arguments he already addressed in his post ("most people don't like it", "only typewriters need it", plus a consistency point he didn't address). Do you feel his rebuttals to those arguments were insufficient? What do you think of the concrete benefit he suggested of two-spacing in vim?


That's easy: how you write your prose or your code should not be dictated by the limitations of your tools. Tools are tools and must satisfy their user's needs. That's the whole point of a tool. If a tool doesn't satisfy your needs and you can't modify it you must find another one.

It's going to be hard if you are emotionally attached to that tool, though.


I'm in my 20s and have never touched a type writer. I use the two space method almost exclusively because that's what I was taught. Sure I mess it up sometimes, but this article does make a fantastic case for why to use it for parsing. If I do mess it up that will show in my parsing, and I'll be able to go back and fix the spacing in the future.


Did you even read the whole article? He directly addressed your first reason. The second reason is weak IMO. What if you forget a period? What if you forget a space between words? If you double space, forgetting it is a typo just like any other typo.


If you capitalize the first word of each sentence it becomes rather obvious if you forget a period.


Since proper nouns are also capitalized, it is ambiguous and you can't script around it.


Then there's also context to fallback on, but that would require a human parser.


> If you want to two-space, fine, but be aware that most people believe and understand you're living in the typographic stone age alongside people who indent their paragraphs and use Whitesmiths.

Is there really any reason to disparage people who don't agree with you? Just accept it as a personal preference or something done because that's how people were taught and move on. Not everything needs to be a "but I'm right" thing.


why is it stupid? it seems quite coherent: he's using monospace in the editor and wants the clarity; the processing for presentation strips it out so it's not present where it's not needed. that seems reasonable, consistent, and sensible.


Steve's arguments aren't stupid. The argument itself is stupid.


ah, ok. maybe "pointless debate" would be clearer than "stupid argument"? i don't think i'm the only one that misunderstood...


The heading showing up dynamically in the margin as I scroll I found to be quite distracting while reading. Text fading in and out while you scroll and read only serves to compete for your attention.


Yes, it was quite nice the first time I scrolled down, then became somewhat distracting.

The fade in happens after you scroll past the relevant heading for me (Firefox, Ubuntu 12.04, 1080p screen).

https://dl.dropbox.com/u/8403291/stevelosh.png

and

https://dl.dropbox.com/u/8403291/stevelosh2.png

show what I mean.

I actually do like the marginalia, like in Tufte's books, side boxes as a sort of commentary or summary of the main text. I'd prefer them to always be there. Lets face it, on a widescreen monitor of modest resolution, the page looks thin otherwise.


>This is quote possibly the most beautiful blog I have ever seen.

At least on my Chrome on Windows 7 the fonts look horrible. I've had that in other places too, I wonder what's wrong with my setup.


This is what happens in Chrome on Windows 7. Its rendering of remote fonts is horrible, and the Chrome team should be ashamed of themselves. @font-face is incredibly common now and Chrome on Windows just ruins many very well-done designs.


Thanks for the heads-up. A quick google later and I see it's a common issue. It even seems to be unstable when I zoom in/out, whereas some levels of zoom are sometimes at least readable but bringing it back to the default zoom will show a different rendering than initially. Very odd indeed.

I've tried fiddling with the Cleartype settings but it doesn't seem to help.


Same here. As far as I was able to discern with some research, it has to do with the rendering engine that Chrome uses - I think GDI+ instead of DirectDraw, or perhaps vice-versa, whereas Firefox and IE use the better one, and IIRC Safari has its own.

EDIT: This page has more info, but I'm not sure if it's up-to-date: http://www.smashingmagazine.com/2012/04/24/a-closer-look-at-...


There are sometimes font rendering bugs, and you might want to check your ClearType settings. There's a tuning wizard in the control panel.


Well, his floaty text on the left of the column is a fixed distance from the left margin, so it overlaps the column unless i make the window fullscreen.


Really? It shouldn't, and doesn't for me on Firefox and Chrome: http://i.imgur.com/yGQSK.png

What browser are you using?

(Note: it will overlap if you resize the window horizontally, but should fix itself as soon as you scroll a pixel in any direction)


Chrome. Yeah, it does move to a sane position when I scroll.

Perhaps it should move when I resize as well.


Good point -- fixed.


I use Windows, so I don't know how to use an application if it's not fullscreen.


You're going to love Windows 8.


> and use Whitesmiths

I beg your pardon.


When editing text source, I press return after every sentence. It doesn't affect the compiled product and makes diffs much easier to read. The alternatives seem to be (a) longlines-mode or similar with one very long line for the whole paragraph or (b) fill-paragraph with text wrap at 80 chars or whatever you like. Diffs are much more difficult to make sense of in either of these cases.


This is a neat idea. Now I have to go change all my LaTeX files.


Lots of bizarre logic here:

> Not only is it not a large portion of your keystrokes, but the space bar has your two strongest digits dedicated solely to it!

double-tapping a key is harder to execute than other key pairings.

> Well that’s not right! Vim can’t easily tell the difference between the period after “Mr” and the end of a sentence. > Two-spacing provides more semantic information,

If this is your concern, it's far more appropriate to use a different symbol/glyph for non-breaking dots.

> So the next time you see that arrogant Slate article, feel free to be arrogant right back.

True. That Slate author's writings are unjustifiably smug.


It's funny, when I read or hear programmers arguing about where to put braces, whether to use tabs or spaces, and whether semicolons are good or bad, I've occasionally been depressed by the kind of petty debates we in software seem to enjoy. But this is a reminder that it's not just programmers, it's humans!

(Not to say that this is really a petty issue, I found the OP interesting enough, but it's about as important as spaces and tabs in the large domain of writing in general)


After reading this I still don't understand why he uses two-space.

He sets up some arguments against two-space and counters them, but I still don't see what the point of two-space (or n-space). From the post all I can gleam is 1) it looks better in his opinion, 2) Vim sentence selection. Neither of which are convincing arguments to me I'm afraid...


It's more nuanced than "it looks better in his opinion".

Typewriters used monospaced fonts. The old consensus on the "two spaces" rule came about because it made things easier to read on typewriters. Source code editors are also monospaced, so why not the same rule for the same reason?


It also allowed him to more easily modify the text in his editor. The problem with this blog post is people are taking it to mean "two spaces are superior", when he is really saying, "two spaces are better for me, with my tools".


I use two spacing simply because that is what I was taught in school. After having it drummed into my head for the better part of 10 years, I'm never going to change for anyone.


It's thinking like this that's making progress difficult.

"Gay marriage? After having it drummed into my head for the better part of ten years that it's a bad thing, I'm never going to change for anyone."


Really?


Really.

If you don't pause to re-evaluate your beliefs once in a while, you're doing it wrong.


No, "really", you're comparing typing style to issues of morality.


Really.


It's over thinking things that people think about like this is what makes progress difficult... I think.


The same is true for me. Damn typing classes would mark you down if you didn't two space, so that drove me into two spacing everything, as well. I've been trying to push myself into single spacing for a while now, though...It's tough.


The program we used for "keyboarding" class required two spaces, too. (This was in 1998, but the program looked like something from the '80s.) The teacher had me evaluate a newer program (that looked more "Windows 95-ish") later in the year and it required a single space. I made a lot of typos that day.

I can't remember what my college course required because I only had to go five or six times to prove my proficiency. (Yes, my university's computing program required a typing course because they had students that couldn't touch type.)


In 1994 my typing class was still using Apple II's. I didn't appreciate it at the time, but I find it quite impressive that I was using the same computers in my senior high school class as my 1984 1st grade computer class.


Slate is typical. Arrogance is pretty much a given in any grammatical/typographical discussion. In the land of the pedants, the man who says "you and I" is king.

The vim ambiguity is part of the greater English punctuation suckage. If I end a sentence in Jr. or St., am I supposed to double up on the periods on the end, or will that just make me look stupid? I already had a period followed by a comma there, which looks pretty bad, and "My personal hero is Martin Luther King Jr.." just seems wrong.

Also, I think I'm supposed to write a comma after a quotation, but I would have done that I would have written '..",'. That's pretty bad, and only compounded by the period at the end. I'm not sure that it's in the right place, either - should it be inside the quotation marks according to the normal rule or can I put it outside the quotation marks to avoid ambiguity? Why is it so difficult just to write a sentence without it going horribly awry?


Neato.

If you also want to end your sentences with two periods or separate thoughts with two commas, go for it.

Please just don't pretend it is somehow proper or logical. As long as we're clear that you're doing it your own weird way just because... I see no harm. Carry on, two-space warrior! shrugs


> To recap, the arguments for single-spacing are: 1. Two-spacing is ugly in proportional fonts. [..] Number 3 is false, because two-spacing gives you two advantages over one-spacing: It looks better in your editor.

I beg to differ. I find that two-spacing feels wrong even in monospace. And even code is not write-only, so it's a stab in my eye every time I 'develop'.

Also, since both HTML and markdown use single-newline chars as word - not paragraph - delimiters, the semantic argument doesn't hold because I'll counter it with [0].

[0] http://rhodesmill.org/brandon/2012/one-sentence-per-line/


I would love to use that "one sentence per line" approach, but I can't get lines to soft-wrap in a sane way in Vim. The closest I got was this solution: http://contsys.tumblr.com/post/491802835/vim-soft-word-wrap

But it wraps at the full width of my terminal (80-some characters per visual line), which is too long. And it won't display a partial line at the bottom of the screen. That is, if something wraps to 3 visual lines, but starts on the second row from the bottom, instead of displaying the first 2 visual lines, it shows two '@'s.

This prevents me from using the one-sentence-per-line approach nicely. Any Vim warriors know a solution?


This will tell vim to display "as much as possible of the last line in a window".

    set display+=lastline


I found as I switched away from the two space style that I was taught in school back to a single space (coincidentally, after reading the referenced Slate article), there was a short period where the single space felt and looked weird.

Nowadays, I use monospace fonts everywhere, and that second space looks downright horrible, and completely extraneous. I feel like the author here countered a fairly well-reasoned article (Slate) with a very subjective point.

Regarding the note on Vim's sentence handling, I'll probably deal with the occasional failure on a word like Mr. rather than having to type out that extra space after every sentence.


>Not only is it not a large portion of your keystrokes, but the space bar has your two strongest digits dedicated solely to it! If any fingers are going to wear out from typing, it won’t be your thumbs.

I beg to differ- as someone who DID get RSI-stricken thumbs from typing, even one space occasionally feels too much, thankyouverymuch.


Steve's point about vim is the first rational argument I've heard for using two spaces. Saying two spaces looks better with monospaced fonts is an opinion, one which I don't share. But I can buy into two spaces being semantic to your text editor.

I used to use two spaces before the web because that's how I learned it. Way back when I realized that browsers collapse consecutive spaces into one I stopped using them. This argument makes me rethink my position. It also reminds me that I really need to learn more of vim's shortcuts.


Yup, I noticed that as well.

In the UK, we were not taught to use two spaces after a full stop, but as my text files are for me only, they are fed through a formatting program before sharing, I may try this.

Use of 'semantic line feeds' obviates the issue. See

http://news.ycombinator.com/item?id=4642395

Random information: the Bash formatting utility follows the two spaces convention. The 'par' program uses one space. On Ubuntu...

   keith@xeon:~$ fmt textfile | gedit
or

   cat textfile | par j | gedit
The latter produces justified monospace text for that retro look.


By default, Emacs considers a period followed by two spaces or by a newline as the end of a sentence; a period followed by just one space indicates an abbreviation, not the end of a sentence. Accordingly, the fill commands will not break a line after a period followed by just one space. If you set the variable sentence-end-double-space to nil, the fill commands will break a line after a period followed by one space, and put just one space after each period. See Sentences, for other effects and possible drawbacks of this.


> Text editors use monospaced fonts!

> It doesn’t matter what editor you use. Vim, Emacs, TextMate, Sublime Text, Eclipse, Gedit, Notepad++? All of them use monospaced fonts.

No they don't. What silliness is this?

From the author's list, Sublime Text, Eclipse, Gedit, and Notepad++ all support proportional fonts.

Of the other editors I use frequently, Komodo IDE, Visual Studio, UltraEdit/UEStudio, XML Marker 2, and MarkdownPad among others all support proportional fonts.

So write in a monospaced font if that's what you prefer, but nobody is making you do it.


Do you use a proportional-width font for viewing code?


Yes I do, and greatly prefer it. Just as the written word is more readable in a proportional font, code is too. And more of it fits on the screen!

The only thing that doesn't work in a proportional font is column alignment tricks. (Basic indentation works fine.) That problem is easy to solve by not using column alignment at all. I find code easier to read and much easier to maintain when it doesn't use column alignment. When reading someone else's code that does use column alignment, I just switch to a monospaced font for that file.

I wrote on this at more length here:

http://news.ycombinator.com/item?id=4625340

If you're heavy into column alignment styles as in the examples from that comment, then a proportional font won't be for you. But if not, give it a try. It may seem strange at first but give yourself a chance to get used to it. You may find you like it, and if not, no harm done.


All plain text isn't edited or displayed in a fixed-width font. Proportional fonts are used in email, IM, and IRC applications, full screen writing applications, note taking applications, Markdown editors and some LaTeX editors, and text areas on websites. Many email applications display plain text messages in a proportional font and without collapsing spaces.

The two space convention originally became popular to match the practice of inserting wider spaces between sentences in print, but that has more or less fallen out of use.

In many ways, simple typographic conventions are also more esthetical. Does there need to be a distinction between spaces that separate words and spaces that separate sentences? The additional semantic markup isn't worth the extra complexity in many cases. Having two different conventions also adds complexity. Single spaces could eventually become the only format people need to know about, but two spaces couldn't.


Why I two-space: because I use Emacs, whose auto-fill-mode treats treats single spaces behind a dot as unbreakable. My text, my editor, my rules. I will happily one-space in a project where it is the convention though.

Did we need so much text?


My arguement against 2 spaces and for 1 space is that 2 spaces is semantically wrong and 1 is semantically correct. We use a space to separate 2 words and a full stop (etc.) is used to indicate the end of a sentence. We don't need full stop and 2 spaces.

Now, traditionally, to increase readability, typographers used 1 and a half spaces after the end of a sentence. It looks pretty good and so someone decided that would be 2 on a monospace typewriter. However, our PCs are slightly (ish - not by much) more powerful than said typewriters and can work out when to use 1 and a half spaces if necessary.


> a full stop (etc.) is used to indicate the end of a sentence.

If I may, I call your attention to the first of the two sentences endings in the quoted snippet.


Oh come on, he clearly means that the diglyph ". " is a sentence end.


Awfully convenient that the etc. happened to be in brackets then. I guess the previous sentence ends at the etc. when I don't put it in quotes and after then if I do.


It's relatively common usage to omit the full stop when it doesn't signal a sentence end - ie like this. :)


But you should always use "i.e." because it's an abbreviation for two words. And I can't even think of a case that you wouldn't follow it with a comma (i.e., "i.e.,"), so that doesn't conflict with the ". " end-of-sentence pattern.


There are many style guides[0] that treat i.e., e.g. and the other Latin abbreviations specially in always punctuating them - it's rather rare to find someone talking about the former U.S.S.R., T.C.P. packets, or N.A.S.A.'s missions to the I.S.S. - to all intents & purposes, ie is the exception, not the rule. It's worth pointing out that i.e. is exceptionally difficult to type on a lot of mobile devices.

[0] http://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style#Abbre...


> We use a space to separate 2 words and a full stop (etc.) is used to indicate the end of a sentence.

So your sentence above ends just after the characters e-t-c, right?

Or do we use a period for other things than just ending sentences?


Oh, I remember

Two spaces after end of a sentence © GNU coding standards

http://www.gnu.org/prep/standards/standards.html#Comments


This is a pointless rant; the Slate article is clearly about presentation, and he's basically agreeing with it. He's right in that double-spacing what amounts to source code might be a good idea, but that doesn't change the fact that two-spacing in Word is Bad and lots of people still do it.

This is an example of a typical geek habit of jumping on the edge case and trying to use it to disprove a well-meaning article. That Slate article isn't for you; nobody cares or judges your Latex/HTML formatting.


I don't understand why people get so worked up about this. I personally one space, but I feel like the difference between the two is so minute that it shouldn't really matter...


For someone that cares so much about two-spacing I'd assume he'd also set up his HTML/CSS so that it actually preserves his two spaces after a period by some insertion of an HTML entity. As it stands now, if you View Source he definitely uses two spaces after a period but when outputted to the browser it's only one because the white-space is coalesced together by the rendering engine.


Have you read the article?


He mentions why it does that, but he doesn't say why he opts not to preserve the two spaces: http://www.w3.org/TR/CSS2/text.html#white-space-prop


Except that he does. He only argues that two spaces doesn't look ugly in monospaced fonts but should be changed to smaller spacing when presenting variable fonts. No further explanation should be required as to why he doesn't go out of his way to break that.


He isn't trying to say "two spaces are superior", he is more saying "two spaces are more helpful for me, with my tools". Just because he prefers one form doesn't mean he hates the other.


He talks about this in the article.


What an absurd thing to spend time debating. For anyone else that thought this was going to be about working spaces, it's actually about why double-spacing after a period is superior. The arguments amount to "because I like it" and "because it lets me do end-of-sentence regexes in vim without catching things like 'Mr.' and 'Etc.'".


> Another widely-used format, LaTeX, splits the difference and actually uses somewhere between one and two spaces (by default).

Actually, it doesn't. TeX (the actual typesetter; LaTeX is a macro system on top) inserts a space that is slightly more stretchable than the space between words.


LaTeX does have the frenchspacing option, which does try to make wider spaces between sentences. What's nice about LaTeX is that you can actually tell it what you mean, like "Dr.~Strangelove" has a non-breaking space, while "add the eggs, etc.\ to the mixture" has a non-sentence-ending space, and "I went to the DMV.\@ Then I went to work." has a sentence-ending space before 'Then', since TeX takes capital+period to be an abbreviation. I suspect that Unicode has some of these things, and that no one ever bothers to use them.

Anyhow, the two-space thing is sort of interesting trivia: http://www.techwr-l.com/archives/9907/techwhirl-9907-01344.h...


I two-space because it is was ingrained in me by my elderly typing teacher in school.


This sounds like a rationalization for a behavior he already does. Likely the author was used to two spaces so, rather than change, he instead creates a framework of justification. Using his logic, why not three spaces? Or four?


For those who want a more nuanced view, including cited sources and research, head over to http://www.heracliteanriver.com/?p=324


All I can say is: when I'm editing other people's text (say, on Wikipedia), I remove their silly two space silliness. I have a Vim command wired up that runs a regex for that purpose and I run it before saving.

Extra pointless bytes are extra and pointless.

(And, yes, I realise they will exist in the previous versions. And, no, it doesn't matter. I just like imposing my will on this to make up for the fact that I am currently single and lonely. I also like consistency, and if people are going to be consistent, they may as well be consistent in a way I like.)


Tl; dr bikeshedding and sentence manipulation in vim


> Posted less than a minute ago on October 12, 2012.

What is this broken cache-incompatible time-tracking system he is using?


It has nothing whatsoever to do with caching. It's jQuery timeago. The incorrect time was coming from the lack of a timezone in the date, which I just fixed. If you reload the page it should now look correct no matter what timezone you're in.


Narcissism of small differences, anyone?


I two space to ensure that each sentence is given clean separation between the previous and next sentences.


markmm, your account was hellbanned 7 days ago.

moron, your account was hellbanned 72 days ago.

lean, your account was hellbanned 345 days ago.


Many modern text editors (can) use proportional fonts. It's quite nice. You should try it out sometime.


Jesus that font is unreadable


I'm guessing you have a shitty version of Palatino installed, because Palatino is gorgeous: http://i.imgur.com/EXQMj.png


I'm on Linux, whatever that blog falls back to is dreadful.


Looks great to me on Ubuntu—very similar to the screenshot two levels up, only slightly differently spaced.


unless you use Chrome on Windows http://i.imgur.com/aoPOh.jpg


If you use chrome on windows, pretty much any web font is going to look like shit. I don't understand why google, one of the biggest pushers of web fonts, can't make a browser that renders them sanely.


Interesting that he uses only one space after each of his colons.


The (American?) usage where colons end sentences (two following spaces, then a capital letter) is so very very wrong.


"You could get pedantic..."

But the author doesn't like the competition.

:-)


is it just me, or does that article not use two-spaces?


It doesn't on display, which is part of his point; allegedly the source two-spaces.


Did you even bother to read it?


yeah, my reason for two spacing is just because it's right. One space after a period already means something (see his Mr. Smith example). So I'm left with something else to signify "I'm done with this sentence, gtfo."

But, more importantly, it's because people that don't two-space are big old dummies.




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

Search: