In PEP 9 there's a requirement that PEPs must follow the "emacs convention" of 2 spaces after a period. (I didn't know this was an emacs convention, I thought it was a convention of people who used typewriters.)
I've tried hard to maintain this textual convention in my own PEPs, even though it's very unnatural to me. But I see from looking at the other PEPs that that this convention is very inconsistently enforced - some have it and some don't. Worse, I've had one person (who apparently wasn't aware of the rule) flag my use of extra space after a period as a bug in my PEP.
(When I first learned to type, I used one space after a period. Then years later, someone convinced me that two spaces was the proper style and so I switched to that for a few years. But later I switched back because I realized that most modern typographical layout engines seem to calculate inter-sentence spacing properly when the number of space characters after a period is one. And in HTML [which is how most people view PEPs anyway] it doesn't matter since the browser is going to filter out the extra space anyway.)
So if we're not going to enforce the rule consistently (and it seems as if we're not), can we then just remove it from PEP 9? I'm not saying that we should change the rule to one space, I'm suggesting that we just drop the requirement and let people use whatever they prefer.
-- Talin
Talin talin@acm.org wrote:
In PEP 9 there's a requirement that PEPs must follow the "emacs convention" of 2 spaces after a period. (I didn't know this was an emacs convention, I thought it was a convention of people who used typewriters.)
If the PEP is displayed as HTML, then one or two spaces after a period in plain text might not matter; any browser that I've bothered to check visually merges space characters unless they are intermixed/replaced with non-breaking space ( ). If ReStructured Text converts to non-breaking space, then they matter.
In terms of text text editing, I think that as long as one is consistant within a document, that's good enough.
Talin schrieb:
In PEP 9 there's a requirement that PEPs must follow the "emacs convention" of 2 spaces after a period. (I didn't know this was an emacs convention, I thought it was a convention of people who used typewriters.)
It's an Emacs convention in the sense that its auto-filling function expects that; it will not break lines after a period which is followed by a single space only. (These are the default settings, this being Emacs you can customize it.)
Georg
-- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Jul 23, 2007, at 10:18 PM, Talin wrote:
In PEP 9 there's a requirement that PEPs must follow
the "emacs
convention" of 2 spaces after a period. (I didn't know this was an
emacs
convention, I thought it was a convention of people who used
typewriters.)
[...]
So if we're not going to enforce the rule consistently (and it
seems as
if we're not), can we then just remove it from PEP 9? I'm not saying
that we should change the rule to one space, I'm suggesting that we
just
drop the requirement and let people use whatever they prefer.
As an emacs dinosaur, I'd prefer to keep the recommendation, but I
also acknowledge that the smaller mammals nipping at my heals will
eventually take over the world. I've recently had similar
discussions in another community and I was actually kind of amazed to
learn that auto-refilling of paragraphs itself was somewhat of an
anachronism.
Emacs will probably go the way of the vinyl record (though the latter
is seeing a resurgence lately :). Changing "must" to "should" in PEP
9 would encourage but not enforce consistency, and I think that would
be fine.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin)
iQCVAwUBRqXs7nEjvBPtnXfVAQLZWAP/UGGslCnGukFXJOvXoOyQE34baFAxKEyY NmXmZnpGfnhNOgASG1zxpAzPd6PtHQUMzwk0FXwlHVHpwg9Lb+IxFGZlRAgY2Tya KspvunDYlRFGAlG13Zg+GsQZI6cOOLqjKqwPsAcNXe9NIQhTA8hJ6vYcGSbE/I3q 73INGJg5uU4= =keXE -----END PGP SIGNATURE-----
I'm with Barry. I still use Emacs. Emacs's paragraph filling algorithm, whether invoked explicitly via M-q or implicitly via auto-wrap mode, distinguishes the usage of periods based on the number of spaces following them. Two or more spaces are used to separate sentences. One space (for example, G. D. Montanaro) following a period is considered a non-breakable space.
Skip
On Tue, Jul 24, 2007, skip@pobox.com wrote: >
I'm with Barry. I still use Emacs. Emacs's paragraph filling algorithm, whether invoked explicitly via M-q or implicitly via auto-wrap mode, distinguishes the usage of periods based on the number of spaces following them. Two or more spaces are used to separate sentences. One space (for example, G. D. Montanaro) following a period is considered a non-breakable space.
There's no need to invoke Emacs to argue for the superiority of two
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/
This is Python. We don't care much about theory, except where it intersects with useful practice.
On 7/24/07, Aahz aahz@pythoncraft.com wrote:
On Tue, Jul 24, 2007, skip@pobox.com wrote: >
I'm with Barry. I still use Emacs. Emacs's paragraph filling algorithm, whether invoked explicitly via M-q or implicitly via auto-wrap mode, distinguishes the usage of periods based on the number of spaces following them. Two or more spaces are used to separate sentences. One space (for example, G. D. Montanaro) following a period is considered a non-breakable space.
I made this argument in private to Talin before he went here for a second opinion. Apparently it wasn't strong enough. :-)
There's no need to invoke Emacs to argue for the superiority of two spaces after each sentence, according to this vi user.
Indeed. After all, we're talking about PEP 9, which is a plaintext format. Check out http://www.python.org/dev/peps/pep-0009/ and you'll see that it is rendered in a fixed-width font with line breaks exactly where they are in the source, and the two spaces make a difference for readability.
How about in PEP 9 we keep the recommendation, perhaps weakened to "should" or "ought"; but in PEP 12 (the ReST equivalent) we remove it altogether because it doesn't affect the rendering.
And let's please not make this into a bikeshed discussion than it already is.
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
The term "French Spacing" is used for two spaces after a period ending a sentence, for those wishing to do more research. I have not found any authoritative answer. The balance has been towards two spaces when using a monospaced font.
That points towards a way forward. Why do programming languages continue to assume use of a monospaced font? It was natural when we used punch cards and line printers, but now? Python relies on the
Pete Forman -./.- Disclaimer: This post is originated WesternGeco -./.- by myself and does not represent pete.forman@westerngeco.com -./.- the opinion of Schlumberger or http://petef.port5.com -./.- WesternGeco.
Pete> That points towards a way forward. Why do programming languages
Pete> continue to assume use of a monospaced font? It was natural when
Pete> we used punch cards and line printers, but now? Python relies on
Pete> the indentation but could be flexible about other textual
Pete> attributes.
Nothing in Python assumes anything about fonts. That's all a function of the text editor you use and your editing preferences. Me, I find it easier to read code which is displayed or printed with monospaced fonts. Note, however, that I've been programming for 30 years. I started with IBM punch cards, so I might be a bit biased.
Skip
skip@pobox.com wrote:
Pete> That points towards a way forward.
Why do programming languages
Pete> continue to assume use of a monospaced font? It was natural when
Pete> we used punch cards and line printers, but now? Python relies on
Pete> the indentation but could be flexible about other textual
Pete> attributes.
Nothing in Python assumes anything about fonts. That's all a function of the text editor you use and your editing preferences. Me, I find it easier to read code which is displayed or printed with monospaced fonts. Note, however, that I've been programming for 30 years. I started with IBM punch cards, so I might be a bit biased.
I started in '98, and I also find monospaced fonts easier to read in various circumstances (email, code, shells, etc.). But indeed, Python makes no assumption about fonts. A person could use Wingdings for all Python cares.
skip@pobox.com schrieb:
Pete> That points towards a way forward.
Why do programming languages
Pete> continue to assume use of a monospaced font? It was natural when
Pete> we used punch cards and line printers, but now? Python relies on
Pete> the indentation but could be flexible about other textual
Pete> attributes.
Nothing in Python assumes anything about fonts. That's all a function of the text editor you use and your editing preferences. Me, I find it easier to read code which is displayed or printed with monospaced fonts. Note, however, that I've been programming for 30 years. I started with IBM punch cards, so I might be a bit biased.
Though being notably younger ;), I couldn't live without monospaced fonts for source code. Apart from being easier to read, it is essential for sketches or things that must be aligned, such as the class schema in SocketServer.py.
Georg
-- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.
Georg Brandl wrote:
I couldn't live without monospaced fonts for source code. Apart from being easier to read, it is essential for sketches or things that must be aligned, such as the class schema in SocketServer.py.
This just goes to show we're living in the dark ages wrt source code representation. We should be able to write our comments in HTML with embedded SVG diagrams. :-)
-- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiem! | Christchurch, New Zealand | (I'm not a morning person.) | greg.ewing@canterbury.ac.nz +--------------------------------------+
Greg Ewing schrieb:
Georg Brandl wrote:
I couldn't live without monospaced fonts for source code. Apart from being easier to read, it is essential for sketches or things that must be aligned, such as the class schema in SocketServer.py.
This just goes to show we're living in the dark ages wrt source code representation. We should be able to write our comments in HTML with embedded SVG diagrams. :-)
PowerPoint, coding edition?
Georg
-- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.
On 27/07/07, Georg Brandl g.brandl@gmx.net wrote:
PowerPoint, coding edition?
You just had to give them the idea, didn't you? :-) Paul.
Georg Brandl wrote:
Greg Ewing schrieb:
This just goes to show we're living in the dark ages wrt source code representation. We should be able to write our comments in HTML with embedded SVG diagrams. :-)
PowerPoint, coding edition?
It'll probably be called Microsoft Visual Presentation and Solution Studio (with Home, Office, Professional and Enterprise editions).
-- Greg
skip@pobox.com wrote:
Me, I find it easier to read code which is displayed or printed with monospaced fonts. Note, however, that I've been programming for 30 years. I started with IBM punch cards, so I might be a bit biased.
I normally use monospaced fonts for Python, but in my Think Pascal days I wrote most of my Pascal in Geneva. I thought it actually looked quite nice that way, especially with TP's auto-formatting.
It depends a lot on the font, though -- I don't think I'd like to program in Times, for instance.
-- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiem! | Christchurch, New Zealand | (I'm not a morning person.) | greg.ewing@canterbury.ac.nz +--------------------------------------+
I normally use monospaced fonts for Python, but in my Think Pascal days I wrote most of my Pascal in Geneva.
I had to read that sentence twice to understand that you didn't actually go to Switzerland to write Pascal (although this would have been very appropriate).
Regards, Martin
The term "French Spacing" is used for two spaces after a period ending a sentence, for those wishing to do more research. I have not found any authoritative answer.
This phrase sounded to me like one of the slurs the English invented during their various wars with the Dutch and the French (e.g. "Dutch courage"), so I looked into it a bit.
The practice of double-spacing after a period was standard even with proportional fonts before the advent of the Linotype machine, the mechanical design of which didn't accommodate it.
See http://webword.com/reports/period.html.
``If the [Linotype machine] operator typed two spaces in a row, you had two wedges next to each other, and that tended to gum up the operation. Clients who insisted could be accommodated by typing an en-space followed by a justifier-space, but printers charged extra for it and ridiculed it as 'French Spacing, oo-la-la, you want it all fancy, huh? Well it'll cost ya, bub, and plenty too...' and soon it became unfashionable in the US.''
Bill
Pete Forman wrote:
Why do programming languages continue to assume use of a monospaced font?
Programming languages don't -- I know of no (serious[1]) language that requires a monospaced font in order to work correctly. Even in Python, as long as you don't mix tabs and spaces, indentation still works since it's all at the beginning of a line.
Certain conventions sometimes used by programmers might require it, but that's a different thing.
[1] Brainf**k is an obvious exception.
-- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiem! | Christchurch, New Zealand | (I'm not a morning person.) | greg.ewing@canterbury.ac.nz +--------------------------------------+
skip@pobox.com wrote:
I'm with Barry. I still use Emacs. Emacs's paragraph filling algorithm, whether invoked explicitly via M-q or implicitly via auto-wrap mode, distinguishes the usage of periods based on the number of spaces following them. Two or more spaces are used to separate sentences. One space (for example, G. D. Montanaro) following a period is considered a non-breakable space.
How very twentieth-century :-)
regards
Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.holden --------------- Asciimercial ------------------ Get on the web: Blog, lens and tag the Internet Many services currently offer free registration ----------- Thank You for Reading -------------