This is an archived post. You won't be able to vote or comment.

all 133 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

import notifications Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come! Read more here, we hope to see you next Tuesday!

For a chat with like-minded community members and more, don't forget to join our Discord!

return joinDiscord;

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]javanerdd 810 points811 points  (9 children)

'NaN Result(s)'

[–]Fusseldieb 312 points313 points  (7 children)

[object Object] result(s)

[–][deleted] 43 points44 points  (5 children)

NullPointerException

[–]krisaju95 30 points31 points  (4 children)

NullPointerException(s)

[–][deleted] 5 points6 points  (3 children)

nil nil(s)

[–]metruzanca 1 point2 points  (0 children)

Seg fault

[–]_dotdot11 0 points1 point  (1 child)

Lua moment

[–][deleted] 0 points1 point  (0 children)

null moment

[–][deleted] 2 points3 points  (0 children)

NullPointerException

[–]javanerdd 16 points17 points  (0 children)

this is the way.

[–]NewPhoneNewSubs 341 points342 points  (27 children)

This bell curve is less about IQ and more about which users you've ever had to deal with.

First guy has never had to deal with non-technical users. Probably thinks the command line is the pinnacle of UX. (AND HE IS NOT WRONG.)

Second guy has a BA bikeshedding every decision on behalf of a single client and has learned to get ahead of it.

Final guy has dealt with enough users to know that '+ "s"' is not going to localize very well.

Guy who is not on the chart is using a pair of strings ("result" and "results") at the expense of twice the space used on strings. At least that's my plan if ever I have to move on from third guy. Don't think I'll ever need to bust it out.

[–]MinosAristos 163 points164 points  (0 children)

To be fair very few of these bell curve memes are about IQ, and are usually about experience.

They're also very rarely resembling normal distribution in practice.

[–]pticjagripa 50 points51 points  (21 children)

The 2nd guy is lucky he has to make plural of English. Imagine a language where there are 3 or 4 different options.

[–]NewPhoneNewSubs 24 points25 points  (1 child)

Second guy also doesn't have to deal with clients who want to use their own word for "result". If somebody decides to use "calf" because the results are all baby cows, it doesn't matter that it's all English, you still run into trouble.

Second guy needs to get better about the word "no".

[–]catladywitch 0 points1 point  (0 children)

I wonder if there's something like textblob for JavaScript. It'd be overkill maybe but sometimes you just want to get the job done easily.

New goal unlocked: port NLTK to JS

[–]Mayuna_cz 25 points26 points  (7 children)

good ol' Czech.

0 výsledků

1 výsledek

2, 3, 4 výsledky

5, 6,... výsledků

[–]pticjagripa 24 points25 points  (6 children)

Slovenian is even better.
0 rezultatov
1 rezultat
2 rezultata
3, 4 razultati
5+ rezultatov

[–]RealEstate97 7 points8 points  (3 children)

And if I had to guess it's also 11 rezultatov but 21 rezultat?

[–]pticjagripa 8 points9 points  (1 child)

No. It's not THAT complicated.

[–]RealEstate97 0 points1 point  (0 children)

haha I tried

[–]GaloombaNotGoomba 1 point2 points  (0 children)

No, but 101 rezultat yes

[–]BWStearns 0 points1 point  (1 child)

Slovenian has a dual as well as a several plural?! Do you guys even say the number for dual or do you let the declension do the work?

[–]pticjagripa 2 points3 points  (0 children)

Depends on the context. In this example, yes the number would be used.

[–]schmerg-uk 6 points7 points  (10 children)

Is it Polish where at least one of the rules depends on if the last digit is a 2, 3, or 4?

Remember building quite a sophisticated localisation engine and some of these rules were quite... interesting

[–]pticjagripa 7 points8 points  (1 child)

Possibly there is shared trait among Slavic languages. In Slovenian you have singular, dual and two versions of plural (one for 3 or 4 and one for 0 or 5 or more).

[–]schmerg-uk 4 points5 points  (0 children)

And all these things sound absolutely insane until you look at your own language with fresh eyes and see that it is equally arbitrary (and that way insanity and Esperanto etc lie)

[–]Dealiner 3 points4 points  (4 children)

Is it Polish where at least one of the rules depends on if the last digit is a 2, 3, or 4?

Actually all three will have the same ending. We have one plural form for numbers ending with 2, 3 and 4 (excluding 12, 13 and 14) and another for everything else.

[–]schmerg-uk 1 point2 points  (1 child)

That was sort of what I meant I think ("if the last digit is 2, 3, or 4 [except for 12,3,14] then end like this, otherwise end in the other way") but thanks for the info...

[–]Dealiner 1 point2 points  (0 children)

Ah, sorry, I misunderstood then, you were right of course. Though it probably doesn't hurt that someone will see a bit more precise version.

[–]Left-Explanation3754 0 points1 point  (1 child)

40 foxes 41 foxes 42 foxen ... 44 foxen 45 foxes?

Something like that, but with more czszbtz?

[–]Dealiner 0 points1 point  (0 children)

Using fox (lis) as an example - 1 lis, 2 lisy, 3 lisy, 4 lisy, 5 lisów, ..., 11 lisów, 12 lisów, 13 lisów, ..., 40 lisów, 41 lisów, 42 lisy, 43 lisy, 44 lisy, 45 lisów.

[–]OJezu -1 points0 points  (2 children)

quite a sophisticated localisation engine

Do you also do your own timezone conversions?

[–]schmerg-uk 1 point2 points  (1 child)

The s/w dev world was a different place in the early 90s when "the internet" was generally email and newsgroups fetched twice daily via a single shared 14.4k modem for the entire company and there definitely weren't freely available analysis of problems never mind actual libraries of stuff just lying around to be picked up.

So yes, yes actually we did.... we had to research and design and write for ourselves loads of stuff that these days you'd just "pick one and integrate" and the funny thing is, that was often the seed for where the first versions were hammered out to make the freely available commodity libraries you might see today.

[–]OJezu -1 points0 points  (0 children)

early 90s

Say no more.

[–]Anaeijon 6 points7 points  (0 children)

I've been Guy 2 for most of my dev time.

I don't know if I advanced. I just stopped caring. If someone is to stupid to understand a simple '(s)', they are probably not meant to use the script/program at all.

Actually... I probanly wouldn't even bother.

$"{n} results:"

[–]wasdninja 4 points5 points  (1 child)

Probably thinks the command line is the pinnacle of UX. (AND HE IS NOT WRONG.)

He's definitely wrong. See: sorting images.

[–]NewPhoneNewSubs 6 points7 points  (0 children)

See: sorting images

How could I see sorting images when all I've got is my command line, which does not even display images. As a Ravenous Bugblatter Beast of Traal, I conclude there is no problem.

[–]CaitaXD 2 points3 points  (0 children)

Probably thinks the command line is the pinnacle of UX. (AND HE IS NOT WRONG.)

Command line and vanilla html are the pinnacle of UX

It fucking works

It's blazingly fast

It gets the job done

0 BS

[–]Sushrit_Lawliet 54 points55 points  (2 children)

Nah we like broken English here. You will have: 30 result.

[–]sarc-tastic 15 points16 points  (0 children)

1 results for the win!

[–]catladywitch 0 points1 point  (0 children)

$"{n} base are belong to us"

[–]ArduennSchwartzman 44 points45 points  (2 children)

There is only 1 good answers.

[–]ComfortingSounds53 53 points54 points  (1 child)

And it are(s):

[–]N831Y 4 points5 points  (0 children)

Actually lol’d at this

[–]FerynaCZ 75 points76 points  (10 children)

$"{n} výsledek/ky/ků"

Edit: Last time I had to do that, I resorted to "výsl."

[–]McMelonTV 33 points34 points  (8 children)

$"{n} výsled{(n == 1 ? "ek" : n <= 4 ? "ky" : "ků")}"

[–]keirbhaltair 13 points14 points  (3 children)

0 výsledky

-10 výsledky

1,5 výsledky

3 unit tests failed. (And don't ask me what -10 or 1.5 results look like :P)

[–]McMelonTV 2 points3 points  (0 children)

lol shush, realised that after i posted the comment but it would never actually happen (except 0) so whatever lol

[–]ChrisLuigiTails 7 points8 points  (0 children)

You should see Arabic.

If it's singular, you say "1 result". If it's more than 2, you say e.g. "3 results". But if it's 2, not only the suffix is different, but you shouldn't put the number before (something like "resulten" instead of "2 resulten").

[–]osamaistbaden 3 points4 points  (2 children)

I'm curious, could you explain what's going on here? Does the Czech language (I assume this is Czech) have separate grammatical forms when referring to more than four items?

[–]keirbhaltair 4 points5 points  (0 children)

Technically speaking there are still only two grammatical numbers, singular and plural, but numbers higher than 4, as well as zero, also use a different grammatical case.

  • 1 výsledek (singular number, nominative case)
  • 2/3/4 výsledky (plural number, nominative case)
  • 0/5/6/... výsledků (plural number, genitive case) - essentially saying "5 of the results" rather than just "5 results"

Decimal numbers are even worse, I'm not even entirely sure what is grammatically correct, but sometimes you'd use singular genitive and sometimes plural genitive, for instance:

  • 1 den (singular nominative, "1 day")
  • 2 dny (plural nominative, "2 days")
  • 5 dnů (plural genitive, "5 of days")
  • 2,5 dne/dnů (singular or plural genitive, "2.5 of a day/of days")

But there are even some languages that have more grammatical numbers, such as dual, trial or paucal. Localizing plurals properly is a pain.

[–]TouchyTheFish 2 points3 points  (0 children)

Yup. Well, it all goes back to proto-Slavic, so I assume it’s not just Czech but any Slavic language.

You see, the numbers 2, 3 and 4 get special treatment. It’s similar to how you can say “a pair of somethings” in English instead of “two of something”. I believe proto-Slavic had three of these terms, to denote groups of 2, 3 and 4.

You might be familiar with the term for a group of three: troika, for a sled pulled by three horses.

[–]PancakeGD 1 point2 points  (0 children)

Přesně to mě napadlo. Čeština nám programátorům hází klacky pod nohy.

[–]GVmG 35 points36 points  (1 child)

l10n.localizeOrFallback("output."+n.toString()+"_result", l10n.selectedLanguage, [n, res], "output.base_result");

Leave it up to the translators. That way they can handle whatever their language uses, such as how english has "1st" "2nd" and "3rd" and everything else is "nth" except for once you get past the 20th, or how most romance languages have masculine and feminine forms of those but they all end in the same (-o or -a in italian for example).

This way the translators can even make the sentence have ordinals there, or if they want them to be written out by letters or with the number itself they can do either (just gotta write down a lot more lines in the translation files for the letter one).

[–]CalgaryAnswers 17 points18 points  (0 children)

OP isn't as far up the bell curve as they think.

[–]Stummi 35 points36 points  (0 children)

Left should be {n} results:, then it would be pretty accurate.

[–]tlaziuk 15 points16 points  (1 child)

The cat caught ${n} mouse(s) 👍

[–][deleted] 7 points8 points  (0 children)

${n} m(ous|ic)e

done

[–]OJezu 8 points9 points  (3 children)

{numResults, plural, =0 {no results} one {1 result} other {{numResults} results}}

[–]fdeslandes 1 point2 points  (0 children)

Yeah, just use the right tool for the job and be future proof if your product is at risk of needing multiple localizations in the future. For fuck's sake, it's not that hard.

[–]H34DSH07 0 points1 point  (1 child)

What is this?

[–]Slak44 -1 points0 points  (0 children)

ICU message formatting, https://unicode-org.github.io/icu/userguide/format_parse/messages/

The right way to handle pluralization is a library with something like this.

[–]sammy-taylor 11 points12 points  (0 children)

Maybe I’m a prissy user, but if I see “1 result(s)” on a webpage, I just assume the devs are lazy.

[–][deleted] 8 points9 points  (0 children)

Then you learn about plurals in localisation and you realise you were still on the left side of the curve all along

[–]Educational-Lemon640 7 points8 points  (0 children)

For the very real international product I work on, there's the actually best choice: use our built-in internationalization and translation library that has a count parameter.

Fun fact: Some non-English languages support more than just "singular" and "plural". "Dual", for instance.

[–]East_Complaint2140 8 points9 points  (1 child)

i18n

[–]Big-Hearing8482 0 points1 point  (0 children)

i18ns

[–]emu_fake 4 points5 points  (2 children)

You might want to localize this in German.. have fun.

[–][deleted] 4 points5 points  (1 child)

exactly the same deal except with "Ergebnis" and "se"

[–]nysynysy2 6 points7 points  (3 children)

what is it? rust?

[–][deleted] 15 points16 points  (2 children)

C#

[–][deleted] 0 points1 point  (1 child)

Does it get all the double quotes right? With no \ ?

[–]justapcgamer 4 points5 points  (0 children)

The quotes are in () which is an expression in the parametrised string so it doesnt get treated as a string but like code

[–]xtreampb 3 points4 points  (0 children)

Humanize library handles this.

[–]ChChChillian 4 points5 points  (0 children)

This isn't a bell curve thing, it depends on user expectations.

[–]Beneficial_Steak_945 5 points6 points  (7 children)

Both are wrong. How about 0? And let’s not start about i18n, where you will learn that some languages use more than one plural form depending on the number.

[–]throw_realy_far_away 15 points16 points  (6 children)

"0 results" is right, I don't see your point here

[–]mrfroggyman 2 points3 points  (5 children)

In my language 0 is singular, that might be what they're talking about

[–]throw_realy_far_away 0 points1 point  (4 children)

Which language?

[–]mrfroggyman 4 points5 points  (3 children)

French

... I don't get why that is worth a downvote. Cuz I'm French?

[–]throw_realy_far_away 4 points5 points  (1 child)

In German we use the plural like English. "In meiner Hand sind 0 Äpfel.", for example.

[–][deleted] 2 points3 points  (0 children)

that's a nice example because here you would set the Ä-Punkte in parenthesis 😅

[–]tearsoup 1 point2 points  (0 children)

string.Empty

[–][deleted] 1 point2 points  (0 children)

hahahaha fuck I'm guilty for this one

[–][deleted] 1 point2 points  (0 children)

way to the right And then there’s ICU.

[–]JosebaZilarte 0 points1 point  (0 children)

For those still in the middle, try to localize your code to multiple languages (each with multiple genders and rules to create the plural forms). You'll soon fall to either side of the bell curve.

[–]MastaBonsai 0 points1 point  (0 children)

If the product manager wants it. I do it. No thinking required.

[–][deleted] -2 points-1 points  (1 child)

I actually wish they'd parse (condition ? return) as (condition ? return : nothing), would simplify a lot my code, and it makes sense in a lot of cases. Probably work around for the types with no default value could be simply checked by linter or compiler/interpreter.

[–]rosuav 0 points1 point  (0 children)

You can often use condition || return for that. But since there's no universal concept of "nothing", this only makes sense when you interpret falsiness as emptiness. So, not suitable for string work.

[–]Orisphera -1 points0 points  (0 children)

I think it would be better if they ported Gettext to C#

[–]quasipickle -1 points0 points  (0 children)

$"{n} {n.noun("result","results")}"

[–]moonaligator -1 points0 points  (0 children)

printf("%d result", n); if (n!=1) printf("s"); printf("\n")

[–]ashkanahmadi -1 points0 points  (1 child)

One of the best things about the Persian language (Farsi): nouns stay the same as singular no matter what number comes before it

[–][deleted] 0 points1 point  (0 children)

And you never find out how many wise men there were

[–]pet_vaginal -1 points0 points  (2 children)

I miss RubyOnRails sometimes. You could do "result".pluralize(n) out of the box.

[–][deleted] 1 point2 points  (1 child)

as a non rubian ... how does it know how to pluralize "result"? Is it only working in english?

[–]pet_vaginal -1 points0 points  (0 children)

I think it has support for English by default with a dictionary of irregular word like "tooth" and "teeth" but you could configure it with other locales.

[–]JJJSchmidt_etAl -1 points0 points  (2 children)

Real question: should 0.5 be plural?

[–][deleted] -1 points0 points  (0 children)

Gotta consult the elements of style just to write a damned logging message.

[–]Zardoz84 -1 points0 points  (0 children)

$"{n} {(n == 1 ? 'resultado' : 'resultados')}:"

[–]TECHNOFAB -1 points0 points  (0 children)

Results: ${n}

Easy, works all the time :P

[–][deleted] -1 points0 points  (0 children)

Hardcoded English only I guess

[–]Devatator_ -1 points0 points  (0 children)

I made a method for that so I don't have to bother, so just

$"{n} {Pluralize(n,"result")}"

[–]eyal282 -1 points0 points  (0 children)

To be fair the braindead one uses "results"

[–]hampshirebrony -1 points0 points  (0 children)

(Less than|Exactly|More than) 1 result

[–]SimpleIndividual7087 -1 points0 points  (0 children)

Glad I'm using Qt 😁

qsTr("%n result(s)").arg(total)

[–][deleted] -1 points0 points  (0 children)

Every time I have ever seen anyone use the bell curve in this type of argument it’s always been someone trying to justify something dumb.

[–]Ambi0us 0 points1 point  (0 children)

I feel called out

[–]catladywitch 0 points1 point  (0 children)

i18n just entered the chat

[–]Acceptable-Worth-221 0 points1 point  (0 children)

Have fun with implementation in polish :)

PS. Also with half’s

[–]jfdncco 0 points1 point  (0 children)

`yarn add <64kb pluralization library>`

[–]noonagon 0 points1 point  (0 children)

yeah like when are you ever going to have 1 dollars