I always leave the car running when I do a engine compartment. Just don't point a heavy stream of water right into the alternator, distributor, or wherever you see open electrical connections. Most engine compartments now adays are all filled with plastic covers. That's what I try to focus more of my attention on, as well as the hoses, underneath the hood, and the hood jam.
Be more careful if you're doing a carbureated engine. You want to make sure the air cover is on tight, because inside the engine is the last place you want water going.