r/ProgrammerHumor • • May 06 '21

Computer Science = World Domination

Post image
35.6k Upvotes

820 comments sorted by

View all comments

Show parent comments

0

u/[deleted] May 06 '21

[deleted]

148

u/the_brits_are_evil May 06 '21

cool, now run it :P

0

u/[deleted] May 06 '21

[deleted]

115

u/apppelll May 06 '21

Maybe ask on Stack Overflow for a solution.

138

u/w8eight May 06 '21

What a stupid question, nobody is using Africa like that, and this question is by the way duplicate. (Does not link duplicate and abandons thread)

24

u/Drauul May 06 '21

Was the OPs alt account trying to manually invoke Cunningham's Law

22

u/apppelll May 06 '21

The Moment somebody on Stack Overflow, when you read a question and the answer solves your problem and everybody rages about how duplicate it is, but it was the first entry Google found, and Google wouldn't show you the post for the original question. So the only way you could solve the problem was because somebody duplicated it in a way that Google likes better.

3

u/dev_null_developer May 06 '21

Possible duplicate of “Great Potato Famine”

→ More replies (2)

13

u/joemckie May 06 '21

Wait Africa isn’t a person

6

u/mghoffmann_banned May 06 '21

Also why do we need a vector of Africa's? Is there more than 1 Africa?

→ More replies (2)
→ More replies (1)

5

u/stratosfearinggas May 06 '21

You got no input parameters in that. You're feeding that person nothing.

3

u/OK6502 May 06 '21

World is a singleton, and feed has access to the person's private attributes.

5

u/SwitchbackHiker May 06 '21

Beware of Thanos' merge requests.

4

u/OK6502 May 06 '21

Each time he merges he deletes half the comments.

3

u/SwitchbackHiker May 06 '21

person.kill()

4

u/skeletalfury May 06 '21
static int i = 0;
if (i++% 2) {
    person.kill();
}

3

u/OK6502 May 06 '21

Technically he killed people randomly. This would kill ever other person so depending no how the array is arranged, could be non random.

→ More replies (1)

4

u/Kaiserwulf May 06 '21

LOL feeding people accessed by const reference. I hope for their sake their stomach was marked mutable.

→ More replies (1)

3

u/DanTheMan827 May 06 '21

But how would you account for the increase in obesity if you always feed someone when they're hungry?

I would think you'd have to have a logic branch that also takes water consumption into account or you'll have people that are hungry because they aren't drinking enough.

3

u/OK6502 May 06 '21

Those are implementation details encapsulated within the feed function. It throws FoodNotFound exception if food runs out so it's up to the caller to catch it.

2

u/[deleted] May 06 '21

Just gotta wait to ship it in the next release. Good luck getting that thru QA tho.

1

u/lazyplayer121 May 06 '21

What's the module name ? Thx in advance

1

u/aidonoyu May 06 '21

for(const auto& person : worldPopulation) if(person.isHungry()) person.kill();

Too

→ More replies (1)
→ More replies (3)