Rough draft: Proposed format specifier for a thousands separator

Hendrik van Rooyen mail at microcorp.co.za
Sat Mar 14 04:20:21 EDT 2009


"Tim Rowe" <dig....il.com> wrote:

8< -----------------------------------------------------------------

> ......... If "Finance users and non-professional
> programmers find the locale approach to be frustrating, arcane and
> non-obvious" then by all means propose a way of making it simpler and
> clearer, but not a bodge that will increase the amount of bad software
> in the world.

I do not follow the reasoning behind this.

It seems to be based on an assumption that the locale approach
is some sort of holy grail that solves these problems, and that
anybody who does not like or use it is automatically guilty of
writing crap code.

No account seems to be taken of the fact that the locale approach
is a global one that forces uniformity on everything done on a PC
or by a user.

So when you want to make a report in a format that would suit
what your foreign visitors are used to, do you have to change
your server's locale, and change it back again afterwards, or what ?

The locale approach has all the disadvantages of global variables.

To make software usable by, or expandable to, different languages
and cultures is a tricky design problem - you have to, at the 
minimum, do things like storing all your text, both for prompts and
errors, in some kind of database and refer to it by its key, everywhere.
You cannot simply assume, that because a number represents
a monetary value, that it is Yen, or Australian Dollar, or whatever -
you may have to convert it first, from its currency, to the currency
that you want to display it as, and only then can you worry about
the format that you want to display it in.

In all of this, as I see it, the locale approach addresses only a small
part, and solves very little.

Why is it still being defended and touted as if it were 42?  *

- Hendrik

* the answer to life, the universe, and everything. 
( - Douglas Adams' Hitchhiker books)





More information about the Python-list mailing list