What was God doing before the beginning? We don’t know; we aren’t told – but we aren’t the first to wonder. Here’s what John Calvin, in his Commentary on Genesis, has to say about it:
Here also the impiety of those is refuted who cavil against Moses, for relating that so short a space of time had elapsed since the Creation of the World. For they inquire why it had come so suddenly into the mind of God to create the world; why he had so long remained inactive in heaven: and thus by sporting with sacred things they exercise their ingenuity to their own destruction. In the Tripartite History an answer given by a pious man is recorded, with which I have always been pleased. For when a certain impure dog was in this manner pouring ridicule upon God, he retorted, that God had been at that time by no means inactive because he had been preparing hell for the captious.
It turns out this was an old joke even in Calvin’s day. The Tripartite History Calvin cites was a church history written by Epiphaneus Scholasticus early in the sixth century. But Epiphaneus got the joke from Augustine’s Confessions, written more than a century earlier:
How, then, shall I respond to him who asks, “What was God doing before he made heaven and earth?” I do not answer, as a certain one is reported to have done facetiously (shrugging off the force of the question). “He was preparing hell,” he said, “for those who pry too deep.”
Augustine was writing his personal failings and trusting in God’s forgiveness; maybe that put him in a more tolerant mood than either Epiphaneus or Calvin. Augustine continues:
It is one thing to see the answer; it is another to laugh at the questioner – and for myself I do not answer these things thus. More willingly would I have answered, “I do not know what I do not know,” than cause one who asked a deep question to be ridiculed – and by such tactics gain praise for a worthless answer. Rather, I say that thou, our God, art the Creator of every creature. And if in the term “heaven and earth” every creature is included, I make bold to say further: “Before God made heaven and earth, he did not make anything at all. For if he did, what did he make unless it were a creature?” I do indeed wish that I knew all that I desire to know to my profit as surely as I know that no creature was made before any creature was made. (Book XI, Chapter XII, 14)