38

non-dev (but still in IT) friend: *sends meme* "I don't get it!"

me:
int ThingsToBuyFromGrocery()
{
int milk = 1;

if(store.HasEggs())
{
milk = 6;
}

return milk;
}

friend: "Woah! You're so smart!"

Comments
  • 4
    But that is completely wrong.

    you.bring(milk, 1)
    if store.has(eggs):
    you.bring(eggs, 6)

    Is what should happen.

    But, yea:
    Instructions unclear, got penis stuck in a bottle of milk.
  • 1
    Well sounds like a smart one :)
    int ThingsToBuyFromGrocery()
    return store.HasEggs() ? 6 : 1;
  • 0
    @maykdev I hate the ternary operator syntax though. (Probably because I had a college professor that taught it to us but then promptly told us to never use it because it's a spawn of the devil.)
  • 1
    @ajmoning probably because he didn't know how to use them properly but everyone has their own code preferance and I'm not here to judge about it ;)
  • 0
    @not-a-muggle not every language is Java. In go for example exported methods start with capital letter, amd private ones with lowercase.
Add Comment