Confusion using digitalRead and internal pull up resistors

That makes sense. Does it work the other way as well? When setting the pins as an output I would expect that it would be prudent to initialize the pins to a known state (high or low) before exposing them by setting the corresponding bit in the data direction register.