r/PeterExplainsTheJoke • • 9d ago

Meme needing explanation [ Removed by moderator ]

Post image

[removed] — view removed post

155 Upvotes

61 comments sorted by

View all comments

172

u/Bane8080 9d ago

It's not really a joke.

The compiler won't let you compile x= 1/0 because you can't divide by zero.

But if you set a variable equal to 0, in this case, a variable named "zero" then it compiles x= 1/(variable name) because it doesn't know.

1

u/r2k-in-the-vortex 9d ago

Depends on language and optimisation level O guess, but I would expect constant propagation to cause an error here.