# What Famous Idiom Does This Small Code Snippet Represent?

Inspired by his previous discovery, the lazy software engineer decided to look for more interesting snippets in his company's code repository. After searching for a while, he found this one:

int main()
{
int have = 1;
int eat = 1;

bool can = true;

if (have && eat)
{
can = false;
}
}


After failing again to extract any meaning from this snippet, the lazy software engineer headed over to Puzzling.SE to try and figure out a solution.

What famous idiom does this code snippet represent?

• (The comments made on the "previous discovery" puzzle are applicable here as well. This is less "puzzle" and more "what common phrase contains these keywords", and is, well, too obvious to be particularly interesting. I like this idea, but there needs to be something to solve, not merely something to recognize and identify.) – Rubio Mar 23 '18 at 14:38
• @Rubio I get that. I am trying to move my puzzles towards something that doesn't explicitly mention too many parts of the phrase. I am learning, so I will make my next puzzle harder to solve and more of a puzzle versus just a simple giveaway. – Arnav Borborah Mar 23 '18 at 14:41

It's:

You can't have your cake AND eat it too.

Because:

If both Have and Eat are equal to one, the boolian "Can" is set to false, i.e Cannot.

So if you attempt to "Have" and "Eat", you cannot, which relates to the phrase "You cannot have your cake and eat it too."

• Well done, but can you explain why? – Azync Mar 23 '18 at 13:16
• @Azync The reasoning is fairly self-explanatory. – Arnav Borborah Mar 23 '18 at 13:17
• I did begin to type a "Because" section, but if I'm honest it did seem a bit self-evident – Fifth_H0r5eman Mar 23 '18 at 13:18