Two things that suck about CurrentUICulture (Part 1, aka It's just too much!)

by Michael S. Kaplan, published on 2007/01/10 03:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/01/10/1442340.aspx


I have nothing against the CurrentUICulture. I do not picket it, stage protests aimed at it, arrange sit ins near it, plan acts of terrorism on it, architect wars of attrition against it, or ponder outright sd obliterate of its source.

But I have to be honest here, and point out that (as the title indicates) there are two things that suck about it.

Now this does not mean it is useless by any means. After all, I am sure if you ask folks who know me they might be able to come up with more than two things about me that suck. And I think I am still useful to have around, for more compelling reasons than as a negative example. If you know what I mean.

But that does not mean that there aren't two things that suck about the CurrentUICulture.

In this post, I will explain what those two things are, so that you can (a) know about them and (b) not use the class improperly....

To start, let me explain that the user interface culture that this property is to facilitate proper resource loading. Period. That is its only real and true intended use.

With that said....

The first thing that sucks about it is that the CultureInfo class is way too big and complicated to use as the arbitrator of the user interface in managed code.

After all, there are just a few properties that should ever be used for the user interface; they are:

Every other property of CultureInfo and the other objects attached to it from the Calendar to the CompareInfo to the DateTimeFormatInfo to the NumberFormatInfo to the OptionalCalendars to the other TextInfo properties beyond IsRightToLeft are all parasitic weight, not useful for the user interface language, wasteful of a tiny bundle of resources that you will never reclaim until you shut down the process, and really misleading by their very presence since they are all clearly intended for non-resource loading issues and that is just really way more confusing than it has to be.

It should be a much lighter and smaller object that takes no overrides from the control panel.

And what do I think about an object with literally hundreds of properties with just a baker's half dozen that one should ever use?

Yes, that is right, I think it sucks.

In part 2, I'll tell you about the other thing....


1 - It may make me sound like a teenager, but you may have noticed that by these criteria the
Parent sucks too.

 

This post brought to you by  (U+2f1d, a.k.a. KANGXI RADICAL MOUTH)


# Aldo.NET on 12 Jan 2007 1:29 AM:

Not sure I understand why the Parent property sucks - except the one of the WindowsOnly cultures (because it's always the Neutral one, so quite useless I'd say). Any hint? Thx.

# Michael S. Kaplan on 12 Jan 2007 1:59 AM:

Hey Aldo,

It sucks for the same reason that CurrentUICulture sucks -- it is a full huge object when you just needs those same seven props. If there were a lighterweight object for both of them then it would not be as bad.... but there ain't....


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.

referenced by

2010/01/16 Culture: don't have none, won't be none!

2008/04/29 User overrides are read/write, by definition

2007/12/22 CultureInfo subsetting attempts that suck

2007/08/20 It is true that your LCID sucks, but your LANGID sucks more

2007/02/22 Culture vs. Culture

2007/01/12 When you can't depend on your Parent

2007/01/11 Why we have both CurrentCulture and CurrentUICulture

2007/01/10 Two things that suck about CurrentUICulture, (Part 2, aka On judging a book by its cover)

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