Keith Devens .com |
Tuesday, December 2, 2008 | ![]() |
| There are two ways of constructing a software design; one way is to make it so simple that there are... – C. A. R. Hoare | ||
|
| ← More griping about ASP.NET | John Batchelor: Prelude to War → |

Keith Gaughan (http://talideon.com/) wrote:
Revence 27 wrote:
Yeah. You're right, Keith (Devens). I friggin' hate to see that. I hate wrong grammar, but if you are going to type a line just once and it will run for 5 billion years, why don't you take the trouble to make things neat?
On the other not-just-appending languages, I'd still use a nifty high-order function.
Awful and lazy, that.
cyba wrote:
@revence,
make it better then, could you? would be nice to see that... greetings
Revence 27 wrote:
To Cyba:
printf("Delete %d message%s", msg_num, (msg_num == 1 ? "" : "s"));
If, with correct grammar, zero is a plural (and it is).I'm writing this on phone, so I can't go any further than that.
Keith Gaughan (http://talideon.com/) wrote:
Now, try doing that so it copes with both English and French. When you get that, try Bulgarian (dual numbers, yay!), Polish (bizarre agreement based on number and gender, woohoo!), and a bunch of other languages. And that's just the easy stuff.
Revence, you know more languages than English surely? At the very least I'd assume you're familiar with Swahili and Luganda, right? In Luganda alone, I know that different words are used for the various digits depending on the noun class they're used with. You should know better than assume it's that easy for all languages. Getting this sort of thing right for more than one langauge, and even just one language in some cases, is hard.
Revence 27 wrote:
To Keith (Gaughan):
Yep. Hey, do you know everything? Now that's when a high-order func comes in. I'm the cafe, and I can't test the code, and I'm running out of minutes, but see this:
char * translater(char * from, char * to, char * (* translater) (char *, char *));
Yes, func pointers. Something like that. And then that func pointer can have a switch to deal with individual strings to translate (gets dirty, even with more decentralisation), or a formula, in the case of easier languages.
I never expect things to stay neat when I am dealing with many languages. It must get dirty. Must. If you want correct grammar, anyway. And I'm a shivering freak for correct grammar.
Or:
printf("Messages to delete: %d\n", msg_num);
That's usually cleaner, and it works in many langauges. (Yes, I have had to code for Luganda, English, French and Swahili, usually scripts for local websites -- you are a friggin' prophet! From the Isle of Saints and Scholars, after all! Matter of fact, it's on my agenda to write the first language based on an African tongue.)
Keith Gaughan (http://talideon.com/) wrote:
Yep. Hey, do you know everything?
I thought my omniscience would be well-established at this point. 
Now that's when a high-order func comes in.
Or maybe you should use something like GNU gettext?
That's usually cleaner, and it works in many langauges.
...but rather unnatural, and even that kind of thing doesn't work with all languages.
Revence 27 wrote:
I thought my omniscience would be well-established at this point.
It certainly is. The worst part of this is that I actually mean it.
Or maybe you should use something like GNU gettext?
Never used GNU gettext, but the reasons I didn't want to use it are:
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.185s.
(Used 8 db queries)

Lazy programming in a program that's hardwired for English, yes, but you just try and get that working in Polish or Russian: it's a whole lot harder...