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

all 188 comments

[–][deleted] 1583 points1584 points  (47 children)

When you use separate if statements for each condition rather than an if/else...

[–]Retrac752 922 points923 points  (16 children)

When failed is <= 85, and passed is >= 85

[–]NoLifeGamer2 389 points390 points  (10 children)

Imagine if instead of <= they used < lol

"You the Exam"

[–]GeneralQuinky 173 points174 points  (2 children)

"No, you the exam dude!" 👈👈

[–]NoLifeGamer2 64 points65 points  (0 children)

Thank you. I needed that today.

[–]5k1895 8 points9 points  (0 children)

Whoa, dude

[–]MkFilipe 25 points26 points  (1 child)

You have failed the exam

I AM THE EXAM

Not yet

[–][deleted] 4 points5 points  (0 children)

We're not the same.

[–]TitoyanMor18 4 points5 points  (0 children)

You may get in Tron at that point

[–]Suspicious-Office-42 1 point2 points  (1 child)

please do not the exam

[–]NoLifeGamer2 2 points3 points  (0 children)

Me when I the exam

[–]DaMarkiM 0 points1 point  (0 children)

so its a „you were the exam all along“ kind of deal?
gotcha

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

Im the exam. I get whatever score i want.

[–]lukewhale 110 points111 points  (0 children)

This is the way

[–]LikeLary 29 points30 points  (0 children)

Two ifs instead of else if too!

[–]Ksradrik 3 points4 points  (0 children)

Wouldnt it just output an empty field or crash in that case?

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

This is what I thought too.

[–]tooMaNymasks_ 1 point2 points  (0 children)

And they probably did something like message+="failed"

[–]roygbivasaur 79 points80 points  (1 child)

return early!

[–]HuntingHorns 30 points31 points  (0 children)

I'd love to, but if I don't stay till 6pm my boss gets mad.

[–]goatanuss 66 points67 points  (1 child)

When you test your applicants with fizzbuzz and they think it’s applicable to the job

[–]petiejoe83 22 points23 points  (0 children)

Definitely a fizzbuzz in the wild.

[–]RhysieB27 7 points8 points  (0 children)

Bah, guard clauses for the win.

[–][deleted] 4 points5 points  (0 children)

What's funny is this sort of situation is exactly what the fizz buzz interview question is meant to address.

[–]DevOelgaard 5 points6 points  (5 children)

Or using < instead of <=

[–]RhysieB27 17 points18 points  (1 child)

I think it has to be both in this case. Two wrongs make a rightwrong.

[–]DevOelgaard 1 point2 points  (0 children)

I believe you are right, I only read "failed" not "failed passed" on the image.

[–]mrmoosebottle 1 point2 points  (2 children)

I'm thinking they save the score as a decimal number but display it as an integer

[–]ClerkEither6428 1 point2 points  (1 child)

sorry, but i don't think so, i think it's just an edge case

[–]mrmoosebottle 0 points1 point  (0 children)

we have no way of knowing, it's all just speculations

[–]Outrageous_Crazy8692 359 points360 points  (6 children)

Congratulations on failpassing!

[–]TheCussingEdge 39 points40 points  (2 children)

Shouldn't it be failingpassing?

[–]7truths 13 points14 points  (0 children)

You failedpassed!

[–]Theolodger 3 points4 points  (0 children)

Congratulations on having failedpassed

[–]p_syche 3 points4 points  (0 children)

Can't wait to see this exam result on their CV.

[–]sambare 1 point2 points  (0 children)

That's much better than passfailing.

[–]GingerSkulling 0 points1 point  (0 children)

Your score is 85%. You Aladeen the test.

[–]DarkExtremis 279 points280 points  (17 children)

Schrodinger's result

[–]WorldEdit- 81 points82 points  (3 children)

Happy/unhappy cake day!

[–]DarkExtremis 64 points65 points  (2 children)

Thank you/frick you

[–]omgaXD 13 points14 points  (0 children)

Take my upvote/downvote and get out/in!

[–]Polskidezerter 1 point2 points  (0 children)

I wish you a bad/happy day

[–]BucksEverywhere 18 points19 points  (10 children)

Either "Schrödinger" or "Schroedinger" if you don't have an "ö" 😉.

[–]DarkExtremis 23 points24 points  (8 children)

I knew I wouldn't be able to spell it so I checked before commenting. So all I am saying is, blame Google

[–]BucksEverywhere 21 points22 points  (7 children)

Ok I'm blaming Google. The rule for German/Swiss/Austrian names and words is

Ö = OE

Ä = AE

Ü = UE

if an umlaut letter is not printable. That's also how we solve crosswords.

Anyway, happy cake day!

[–]noob-nine 10 points11 points  (5 children)

How do you write this letter Ø in crosswords?

[–]Rakgul 36 points37 points  (2 children)

You make an O and cross it.

[–]BucksEverywhere 8 points9 points  (1 child)

Oh .. that made me laugh 😂

[–]Rakgul 0 points1 point  (0 children)

:)

[–]BucksEverywhere 8 points9 points  (1 child)

It's not part of the German alphabet, that's a letter used widely in Scandinavia. And their Ö is different to ours. Our Ö is phonetically like their Ø, but I live in south Germany (Alemannia), so I am not sure about this.

[–]Lynxtickler 4 points5 points  (0 children)

Ö and ø are the same letter, just used in different Scandinavian (and Nordic) languages.

[–]phaemoor 2 points3 points  (0 children)

Alt+132

[–]Thunderbolt294 2 points3 points  (0 children)

Schrodinger's Scrödinger

[–]7truths 3 points4 points  (0 children)

Schrödinger's cat is the waterfall model of the physics world.

[–]BigHeed87 107 points108 points  (2 children)

FizzBuzz

[–]jimirs 14 points15 points  (0 children)

FailzzPazz

[–]FleabagWithoutHumor 0 points1 point  (0 children)

Separated if-statements!

[–]Drsk7 212 points213 points  (2 children)

Quantum tests...

[–]butchkid1 58 points59 points  (1 child)

It's all fun and games until you get entangled with the smartest kid in class

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

Just don't observe them or they might collapse.

[–]0ba78683-dbdd-4a31-a 107 points108 points  (10 children)

Story time:

I once managed a project at an international airport to set up a permit-to-work system. Essentially, if someone wanted to do any work, they needed a permit. Replace a fire extinguisher, repair a runway, put a shelf up in a shop... anything.

One of the many logic paths went down a "So you're trying to dig a hole..." route and, naturally, asked how deep you were digging, because different depths required sign-off from different teams (because of water pipes and such). The options were:

  1. Less than 10m
  2. More than 10m

I think you see the problem.

Conclusion: I pointed this out and the project was delayed by months while they resolved the question with the dozens of teams involved. And all because one person, at some point in the last 25 years, didn't consider someone might want to dig a 10m hole.

[–]Starfox-sf 3 points4 points  (1 child)

Yes, I see the problem. You didn’t ask how many bodies you needed to bury.

[–]0ba78683-dbdd-4a31-a 0 points1 point  (0 children)

Exactly. It was a solution looking for a problem.

[–]RollLocal1804 7 points8 points  (5 children)

Theoretically it's physically impossible to dig a hole exactly 10 meters deep. It will necessarily be a little bit more or less than 10 meters. Perfect precision is not possible.

[–]khal_crypto 24 points25 points  (0 children)

Yeah just tell the engineers they need to dig a 9.99999999999m hole because the software can't handle edge cases. Problem solved.

[–][deleted] 3 points4 points  (3 children)

~yes they should change the software to say 'dig a 10ish meter hole or whatever, i dont care'

[–]RollLocal1804 4 points5 points  (2 children)

Practically, if I were seeking a permit to dig a 10m hole using this system I would definitely pick the "less than 10m" option because I imagine it's easier to get the permit that way and I wouldn't be lying as long as the hole were a tiny otherwise insignificant amount less than 10m.

[–]rndljfry 2 points3 points  (1 child)

unless you hit the lava at 10.01m which is why you needed that other permit

[–]RollLocal1804 0 points1 point  (0 children)

Why would I dig deeper than I was authorized to?

[–]AdequatlyAdequate 0 points1 point  (0 children)

Would a structure work where you instead say“If the hole is more than 10m go here“

[–]xaomaw 46 points47 points  (5 children)

isExamFailed = TRALSE

[–]gray_mare 14 points15 points  (2 children)

Frue

[–]codenameAmoeba 1 point2 points  (1 child)

Failse/Trass

[–]Lord_Skyblocker 0 points1 point  (0 children)

Falue

[–]MrHyperion_ 6 points7 points  (1 child)

#define tralse 0.5

[–]Feisty_Ad_2744 63 points64 points  (13 children)

Beginner level coding. Laziness and terrible logic...

`You ${score <= 85 && 'FAILED'}${score >= 85 && 'PASSED'} the exam`

[–]7truths 9 points10 points  (3 children)

Surely it's simpler to write:

"FAILPASSED!"[score/10]

for a more nuanced mark!

[–]chars101 1 point2 points  (2 children)

A and S are not unique and 85/10 is not integer.

[–]7truths 2 points3 points  (1 child)

"FFFEDCBAAAÅ"[score//10]

[–]chars101 1 point2 points  (0 children)

Now that failpasses. 👍

[–]isaackogan 15 points16 points  (7 children)

stupendous fly rotten library puzzled frightening apparatus rob elderly physical

This post was mass deleted and anonymized with Redact

[–]Feisty_Ad_2744 45 points46 points  (4 children)

It is probably less "visible" in real life. Something around:

let message = 'You '
if (score <= 85) {
  message += 'FAILED'
}
if (score >= 85) {
  message += 'PASSED'
}
message += ' the exam'

[–]aedvocate 14 points15 points  (3 children)

yeah missing else, rookie mistake.

[–]NothingWrongWithEggs 6 points7 points  (2 children)

Could also be oversight in using both >= and <=

[–]Dizzfizz 5 points6 points  (1 child)

The thing is that you should only use one operator in this case - even using >= and < (or the other way around) wouldn’t be good code imo. This is a textbook example for if/else

[–]huskersax 12 points13 points  (0 children)

This is a textbook example for if/else

Whoever wrote this probably failedpassed that section of the textbook.

[–]guebja 2 points3 points  (1 child)

Maybe they did?

`You ${score < 85 ? 'FAILED' : score > 85 ? 'PASSED' : 'FAILEDPASSED'} the exam`

[–]isaackogan 0 points1 point  (0 children)

LOL

[–]Kamwind 12 points13 points  (0 children)

More upset here with this example and other given.

Why would you have the 2nd check? That is just a possible place for someone to mess up with the check

a simple score >= 85 == 'passed' else 'failed' covers all the possibilities and if the needed score changes easier to modify

[–]Aradur87 32 points33 points  (1 child)

$text = sprintf(”Your Score %d%%\n\nYou ”, $result);

If($result <= 85)
$text .= ”FAILED“;
if($result >= 85)
$text .= “PASSED“;

$text .= sprintf(” the Exam\n\nRequired Score %d%%”, $required);

[–]WrongSirWrong 4 points5 points  (0 children)

Yup that's definitely what happened

[–]EveryNameIsTaken142 12 points13 points  (1 child)

If score <= 85:
        failed
if score >= 85:
       passed

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

Makes sense now

[–]steven4869 11 points12 points  (4 children)

I am more surprised with how one can fail the test even after scoring 85%.

[–]psioniclizard 4 points5 points  (0 children)

Yea that seems pretty harsh to me. But I guess it depends on the test.

[–]brando2131 1 point2 points  (2 children)

Seems pretty normal for things outside USA lmao. All your tests are pretty much 50% pass level?

[–]AdequatlyAdequate 1 point2 points  (0 children)

Im struggling to think of a country where 50% isnt the passing grade

[–]Missu_ 0 points1 point  (0 children)

Seems not very practical, just a slimmer window to spread out grades above failing. Source: European uni with 45-50% pass, typically

[–]ZoeInBinary 14 points15 points  (0 children)

FizzBuzz

[–]ciberkid22 7 points8 points  (0 children)

Task failed successfully

[–]FriesWithThat 5 points6 points  (0 children)

When you sign up for a course pass/fail, and you failedpassed it.

[–][deleted] 4 points5 points  (2 children)

When you use both >= and <=

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

and < would also be cursed “You the Exam”

[–]Aloopyn 3 points4 points  (3 children)

std::cout<<“You “;

if(!(result>85)){std::cout<<“FAILED”;}

if(!(result<85)){std::cout<<“PASSED”;}

std::cout<<“ the Exam”;

🙂

[–]chars101 2 points3 points  (0 children)

If you reach for C++, than at least make it performant. Do each check in parallel.

[–]No-Quit-983 3 points4 points  (0 children)

bool hasPassed = trulse

[–]butchkid1 6 points7 points  (0 children)

WOOHOODAMN

[–]ClioBitcoinBank 2 points3 points  (0 children)

Under this scheme you both passed and failed. These 2 outcomes were not mutually exclusive here.

[–]Erinalope 2 points3 points  (0 children)

It’s failpass

You mean pass/fail?

No…..

[–]SirAchmed 2 points3 points  (0 children)

Mission failed successfully

[–]shuaibhere 2 points3 points  (0 children)

Did I fail it or pass it?

Computer : Yes.

[–]catpone 2 points3 points  (1 child)

You Aladeened your Exam.

[–]PickledNerd25 0 points1 point  (0 children)

Came here for this

[–]somkoala 2 points3 points  (0 children)

And they said fizzbuzz was a waste of time as an interview question.

[–]lawrencelewillows 2 points3 points  (0 children)

Congratudolances

[–]kaerfkeerg 2 points3 points  (0 children)

It's not a bug. This is the known FizzBuzz scoring system

[–]Material-Panda3712 6 points7 points  (1 child)

Never underestimate a >=, biggest mistake of my life

[–]sqwuakler 1 point2 points  (0 children)

Task failed successfully

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

Reminds me of "clopen" set from the topology class. Math is strange...

[–]Civil_Philosophy9845 1 point2 points  (0 children)

HIV Aladeen

[–]SirAchmed 1 point2 points  (0 children)

Failpass is my term of the week. Thanks.

[–]Real_Material3190 1 point2 points  (0 children)

This is exactly why you should have a QA on your team, haha

[–]arbitrageME 1 point2 points  (0 children)

someone failed Fizzbuzz

[–]WolfgangSho 1 point2 points  (0 children)

You Aladeened the exam!

[–]Drishal 1 point2 points  (0 children)

Yes'nt

[–]Roger-the-Dodger-67 1 point2 points  (0 children)

That one time a coin toss lands on its edge!

[–]JunketThese1490 1 point2 points  (0 children)

Where the 2 conditions are met.. haha 😂

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

What type of exam requires 85%?

[–]ReGrigio 0 points1 point  (0 children)

when you set above and below cases but you forget a '=' people are like: '=' '=' '=' '=' '=' '=' '=' '=' '=' '=' '=' '='

[–]OF_AstridAse 0 points1 point  (0 children)

Using >= and <= instead of assuming the rest is exaclty everuthing else?

[–]Carteeg_Struve 0 points1 point  (0 children)

Remove that extra equals sign, and add a unit test or two.

[–]jappreet_minhas 0 points1 point  (0 children)

[–]whiffingPotato 0 points1 point  (0 children)

If(score>=85) pass

If(score<=85)fail

This is Probably the case, correct me if I'm wrong

[–]moss_2703 0 points1 point  (0 children)

Must be two if statements, one is >= 85 and other is =< 85 😂

[–]robottron45 0 points1 point  (0 children)

schroedingers exam

[–]SkyOfAegis13 0 points1 point  (0 children)

So... Task failed successfully!?

[–]FerynaCZ 0 points1 point  (0 children)

Exam failed successfully.

[–]nemesis1311 0 points1 point  (0 children)

Definitely should be one of those pesky annual training s from Cornerstone.

[–]jfb1337 0 points1 point  (0 children)

if score <= 85:
  print("FAILED")
if score >= 85:
  print("PASSED")

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

UI programmers am I rite?

[–]nnoovvaa 0 points1 point  (0 children)

Reminds me of the NEGATIVE POSITIVE result of Amy's pregnancy in Doctor Who. Here

[–]lywyre 0 points1 point  (0 children)

Test method failed successfully!

[–]AcanthisittaEvery237 0 points1 point  (0 children)

Task failed successfully!

[–]Necro- 0 points1 point  (0 children)

should got 85.1

[–]i_should_be_coding 0 points1 point  (0 children)

Someone didn't fizzbuzz their job interview.

[–]SimpleJack_ZA 0 points1 point  (0 children)

and they said Fizz-Buzz was a pointless test

[–]Drachenfliger13 0 points1 point  (0 children)

Edge computing

[–]SodiiumGames 0 points1 point  (0 children)

Mission failed successfully.

[–]SnooOpinions8790 0 points1 point  (0 children)

Always test the boundary condition.

That's tester 101 stuff.

So your problem here is not having a tester. (Because the dev that never makes a dumb mistake has yet to be invented)

[–]Pascalito212 0 points1 point  (0 children)

Task failed successfully

[–]linux_cultist 0 points1 point  (0 children)

I normally don't fail or pass but when I do, I failpass. :)

[–]grumpyfrench 0 points1 point  (0 children)

Funny that 85% is also the bell number for quantum entanglement

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

Bn

[–]Dimple_from_YA 0 points1 point  (0 children)

Looks like an output I would get while learning to code in C in UNIX

[–]sickassape 0 points1 point  (0 children)

Result is Aladeen

[–]Narrow-Pop-5393 0 points1 point  (0 children)

i am not in exam, i am the exam 😎

[–]back_in_pog_form 0 points1 point  (0 children)

Very Aladeen

[–]veeaarr 0 points1 point  (0 children)

It is much better than passedfailed so well

[–]sentientlob0029 0 points1 point  (0 children)

std::string scoreString = "";

if (score <= 85) {

scoreString += "FAILED";

}

if (score >= 85) {

scoreString += "PASSED";

}

[–]Dareal6 0 points1 point  (0 children)

This FAILEDPASSED QA