Hacker News new | ask | show | jobs
by denton-scratch 702 days ago
The question is malformed because it contains a term that cannot be evaluated.
2 comments

I see the question this way:

   fn is_n_prime_whether_or_not_God_exists()
       if (is_prime(3) && is_prime(5)) { // early return 
            return true;
       } else { 
            return three_if_God_exists_five_otherwise(); 
       }
   }
Even if evaluating that would make no difference?
"God" has some unique properties. One of those might be that God neither exists nor doesn't exist. If God has this property of 'neitherism', then the value of n is undefined. Neitherism has been attributed to many religious entities.

To answer a question, you first have to be able to parse the question.

That's the problem with side effects: you don't know if they make a difference until you evaluate them. And "God" is about the biggest imaginable side effect.
Well, the compiler says undefined behavior and optimizes it away :D