8 ms·
No, it's not a bad idea, and these 4 lines of bash script contain no solid reasoning, argument, or business logic as to why helping the other 80% of the world'
by officialchicken 11y ago
No, it's not a bad idea, and these 4 lines of bash script
contain no solid reasoning, argument, or business logic as to why helping the other 80% of the world's population is a very bad idea.
Doing internationalization without support libraries is a very bad idea, as this sample code helps illustrate.
- astrodust 11y agoIt's a terrible idea unless you can force the command to accept arguments in a specific language. Do you expect someone to iterate all the possible variants of "yes"?
- officialchicken 11y agoWith the proper support libraries, Da/Yes/Ha/Ja/etc/etc/etc it's trivial.
- delluminatus 11y agoWhat support libraries would you recommend?
- im3w1l 11y agoThere really should be a "Falsehoods programmers believe about languages". One entry would be: * All languages have the word "yes".
- krick 11y agoThat's actually an interesting point. Indeed, how works internalization for Irish, for example? I mean some big international app, like Windows or something. I don't think it's trivial to customize some internal "yes/no" dialog in Windows to use different words for every question, but only for some languages.
- Epenthesis 11y agoIt probably helps that dialogs usually use "ok"/"cancel" rather than "yes"/"no". Chinese, for example, doesn't really have a word for "yes", but it does have a word/phrase meaning basically "ok" ("好的"), which is what's used on windows for those dialogs.
- astrodust 11y agoJust wow. No. This couldn't be more wrong if you tried. There is literally no way to know what languages are supported, this is impossible to enumerate, and what might pass for correct at one time might be adjusted later to better reflect conversational usage. It's like insisting you could possibly know all the honorifics a personal name might have. If you think you can you're deluding yourself.
- mikeash 11y agoI'm pretty sure that's not bash. In any case, the script makes a cogent and concise argument. That argument is that command line options are not just a human interface, but also a machine interface, and localization of machine interfaces leads to pain and catastrophe. You certainly don't have to agree with that argument, but it's there.
- officialchicken 11y agoSure, any naive implementation will lead to pain and catastrophe. But I don't buy that this is a cogent and concise argument to NOT do it.
- mikeash 11y agoWhat does the non-naive implementation look like? You say "support libraries" but what sort of support do they provide for the machine-interface scenario? How do they avoid problems such as forgetting to put a switch through the libraries and ending up with code that only works in some localizations?
- mahouse 11y agoIt is PowerShell.
- Udik 11y agoShamelessly off-topic, but every time I see the Verb-Noun paradigm of Powershell I get into a fit of rage. Why, Microsoft, why!?
- Someone 11y agoScenario: I write a powershell script and use it for years. Then, I read a question from somebody in "the other 80%". I want to help the other 80%, so I send him my script, explaining that it will show what it does and ask for confirmation before it actually does something. He runs it; the script starts deleting files/sending emails/downloading files over expensive gsm connection without asking for confirmation. After some angry words, I discover that the command line flag '-d' for 'dry run' means 'do it now without asking for confirmation' in another locale. From another reply, it seems one can guard against that by running under the invariant culture, but I don't think one should require everybody who writes a script to be that vigilant. If you aren't convinced try googling for help on writing VBA macros in localized version of Excel or Word.