Not giving someone their space can lead to SA (Separator Anxiety)

by Michael S. Kaplan, published on 2012/06/20 07:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2012/06/20/10322015.aspx


The separator.

Whether it is something you think of as LOCALE_SLIST:

Character(s) used to separate list items, for example, a comma is used in many locales. The maximum number of characters allowed for this string is four, including a terminating null character.

or System.Globalizaton.TextInfo.ListSeparator:

Gets or sets the string that separates items in a list.

the principle is the same.

Now theory is fine and dandy.

Like all that "The maximum number of characters allowed for this string is four, including a terminating null character" nonsense.

The limit info? That's pretty much just for users. Oh, and also in pseudo where it is two characters long -- as mentioned in Seeing double? You're not drunk; you're just running pseudo! (aka Announcement: Pseudo Day!).

I also previously mentioned ListSeparator in 'Managing' [List] Separator Anxiety., but that was just to point out an unrelated bug.

But then there is the problem many people have noticed for years, and which someone asked me yesterday:

Why does the CultureInfo.CurrentCulture.TextInfo.ListSeparator property return ","?  I would expect it to return ", "  (I.e. comma and whitespace).  When composing lists in the English language comma is by convention always followed by whitespace.

For example "Planes, Trains and Automobiles" rather than "Planes,Trains and Automobiles", even outlook’s grammar checker complains

Now it may be true that Word doesn't like it, but Excel tends to choke any time these "usually single character" locale properties are more than one character.

So I guess you could say we didn't think of it until after it would break Excel!

Not to mention other rules -- like whether a comma goes before the "and", after the penultimate item!

Regular readers likely know how much I'd like to stick it Word for its "helpful" text shortcuts that break so many keyboards layouts and remain the single most common customer complaint about MSKLC.

Can one thwack people from one's own company's paid products just because it is such a common source of problems for one's free ones? Would that be an SBC violation, or an HR issue? :-)

But can we really hurt Excel just because it is one of the main clients of the LOCALE_SLIST, even if its usage handcuffs us from making the locale data more useful? :Probably not.

Though if it were up to me, I'd make both Word and Excel to better here.

I'd make them fix their bugs. :-)


Doug Ewell on 20 Jun 2012 3:37 PM:

> like whether a comma goes after the "and" before the penultimate item!

Penultimate is next-to-last, or "Trains" in this example. Did you mean "ultimate," or simply "last"?

Michael S. Kaplan on 20 Jun 2012 3:57 PM:

I means "Trains", like "Planes, Trains and Automobiles" vs. "Planes, Trains, and Automobiles"....

Michael S. Kaplan on 20 Jun 2012 4:08 PM:

I updated the text to match what I meant. :-)


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day